question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature request] Add a way to act on warning "X has changed before removal"

See original GitHub issue

Context: I’m using Minisearch to build a search plugin for the note-taking app Obisidian. To make it as fast as possible, I’m reloading Minisearch from cached data when the application boots up.

Since bugs happen, the cached index and cached files can become desynced, and the message MiniSearch: document with ID xyz has changed before removal appears. Unfortunately, we can’t act on this, the errors pile up, and eventually the search index becomes unusable or corrupted.

I think a new callback field on the Options object would be a simple and efficient solution. It could be called when the console.warn is shown, so library users could manage it effectively.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
scambiercommented, Nov 24, 2022

oh my, that’s awesome. Thank you for this!

1reaction
scambiercommented, Nov 7, 2022

Throwing an error makes sense but - for my use-case - I’d rather just warn the user, set a flag somewhere, and trigger a reindex for later (i.e. at next boot). When the first warning pops up, it’s usually relatively benign and affects a small subset of documents. I’d rather not kill the search engine outright while it is being used, and impose a (sometimes long) reindex when it is still 99% good.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add logger option to specify a custom logger by lucaong · Pull ...
Successfully merging this pull request may close these issues. [Feature request] Add a way to act on warning "X has changed before removal"....
Read more >
Safely open apps on your Mac - Apple Support
Go to Security & Privacy. Click the Open Anyway button in the General pane to confirm your intent to open or install the...
Read more >
Strict Mode - React
When strict mode is enabled, React compiles a list of all class components using the unsafe lifecycles, and logs a warning message with...
Read more >
Feature request response email templates - LiveAgent
If a customer is inquiring about a feature that has been removed, provide an honest explanation of why it has been done to...
Read more >
Unexplained Windows or software behavior may be caused ...
Click Programs, and then click Programs and Features. In the Uninstall or change a program list, find programs that you do not recognize...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found