josh-berry / tab-stash

Firefox extension to save and restore tabs as bookmarks. Clear your tabs, clear your mind.
https://josh-berry.github.io/tab-stash/
Mozilla Public License 2.0
808 stars 45 forks source link

Node already exists at index N - Firefox reporting duplicate bookmark indexes #542

Closed taylortope closed 2 weeks ago

taylortope commented 1 month ago

Crash Details

Browser: Mozilla Firefox 131.0 20240923135042 (win x86-64)
Extension: Tab Stash 3.1.1 (normal)

Node already exists at index 12
placeNode@moz-extension://61202bf3-8aaf-48b5-9869-63247e03a2d3/assets/oops-notification.js:724:11
_upsertNode@moz-extension://61202bf3-8aaf-48b5-9869-63247e03a2d3/assets/oops-notification.js:1312:48
loaded/<@moz-extension://61202bf3-8aaf-48b5-9869-63247e03a2d3/assets/oops-notification.js:923:38

Node already exists at index 12
placeNode@moz-extension://61202bf3-8aaf-48b5-9869-63247e03a2d3/assets/oops-notification.js:724:11
_upsertNode@moz-extension://61202bf3-8aaf-48b5-9869-63247e03a2d3/assets/oops-notification.js:1312:48
loaded/<@moz-extension://61202bf3-8aaf-48b5-9869-63247e03a2d3/assets/oops-notification.js:923:38

Installed Extensions

Describe the Crash

I put my computer to sleep last night, when I went to open tabstash today both the tab and sidebar were blank with the following message:

"Oops! Something went wrong. Tab Stash will try to recover automatically."

It will show open tabs, but if I try to stash them, they disappear and they don't show up in deleted tabs. My tab stash also lists 13+ groups (I had more than that before), but doesn't have any groups stashed.

Expected Behavior

To recover all the bookmarks and groups I had.

Impact

I went through the steps on the troubleshooting page, there was no change.

Additional Details

No response

Vote for This Issue

josh-berry commented 1 month ago

My first thought is that maybe you had some sort of sync conflict between browsers that is causing Tab Stash to become confused about where your bookmarks are stored. Can you read through this page and let me know if it helps?

https://github.com/josh-berry/tab-stash/wiki/Problems-Locating-the-Tab-Stash-Bookmark-Folder

Also, can you share the crash details from the "Oops!" error message? Sorry, my bad, I see them above.

faralk commented 1 month ago

I had this issue very recently (~2 days) too except mine said Node already exists at index 14. I don't exactly remember what happened, but I was moving bookmarks between two Firefox profiles and I think (I say this with low certainty) I introduced another "Tab Stash" folder and that let Tab Stash become confused...

However, upon deleting the other Tab Stash that I accidentally generated, the error would still persist. I think I fixed it by moving all the folders out of the Tab Stash folder to another temporary folder and then moved them back into the "Tab Stash" folder... maybe you can try that?

josh-berry commented 1 month ago

Yeah, I took a closer look at this, and you're right @faralk, I think it's more likely to be a Firefox bookmarks database issue than a sync issue. Another way to work around this would be to export and re-import your bookmarks using Firefox's built-in bookmarks editor, which should fix the incorrect indexes.

I'll have to look at ways of making Tab Stash more resilient to this—it's unfortunately an issue in Firefox itself where sometimes the index (or position) of each bookmark in its parent folder gets messed up. I have seen it happen once in a while before, but not exactly in this way (where multiple bookmarks get assigned the same index).

@taylortope If re-creating the Tab Stash folder itself as @faralk describes doesn't help, I would suggest exporting and re-importing your bookmarks and see if that resolves the issue. Let us know what you find!

taylortope commented 1 month ago

So there wasn't a duplicate Tab Stash folder, but I was able to fix it by restoring my Firefox bookmarks from a saved backup. Thanks for y'alls help!

josh-berry commented 1 month ago

Glad to hear it! I'll keep this open and give it a new title, so I have a reminder to look into how to make Tab Stash more resilient to this type of thing. Thanks for letting me know about the crash!

josh-berry commented 1 month ago

For future reference / anyone else who finds this bug, I've written up detailed instructions on how to rebuild your bookmarks database here: https://github.com/josh-berry/tab-stash/wiki/Rebuilding-Your-Bookmarks-Database

(And if you've already solved this with backup/restore and want to give me feedback on what I wrote, that's always appreciated!)

josh-berry commented 2 weeks ago

Should be fixed in the next release!