damianmgarcia / Hide-n-Seek

Hide promoted jobs and companies on LinkedIn, Indeed, and Glassdoor.
https://damianmgarcia.com
36 stars 4 forks source link

Restore not working when using flatpak #40

Open wchen342 opened 1 month ago

wchen342 commented 1 month ago

Hi there, I was trying to backup the list, but after a successful backup (the json file that was saved is valid), I cannot restore it. Basically after I chose the json file, nothing happens. I tried two scenarios:

  1. Restore using a new installation, nothing was restored.
  2. Remove part of the list and then restore a backup, the removed part was not added back.

This only happens when the chromium is installed using Flatpak. Can you have a look if this can be fixed? Thanks.

wchen342 commented 1 month ago

I did some debugging, I think the error was QUOTA_BYTES_PER_ITEM quota exceeded. I tried to add unlimitedStorage to permissions in manifest.json, but that didn't work. Strangely, if I open the developer tools for popup.js then the restore can be done normally.

Edit: also, after restarting chromium I will lose part of the list. I think the maximum number of items in the list is around 500, anything beyond that will be lost.

damianmgarcia commented 1 month ago

Thanks so much for reporting this!

It looks like this is a Chrome sync storage quota issue. I'll see if there's any way I can get around this, but I may have to fall back to Chrome local storage in cases like this, which would mean the extension should still be able to store larger datasets, but unfortunately not be able to sync them.

damianmgarcia commented 2 weeks ago

Thank you so much for reporting this issue. I redid the syncing implementation, and now users should be able to block thousands of jobs instead of just a few hundred. The new version is on its way to the extension stores. When you have time, can you please let me know if the issue is resolved for you? I hope that it is, but if not, I'll continue working on it. Thanks again! :)

wchen342 commented 2 weeks ago

Hi, thanks for the update! I have tested the new version and it seems the loss of data was solved. However the import is still not working. There is no longer an error but somehow import still only works if I have developer tools open for the popup, which is pretty weird.

Actually now thinking about this, there may be two separate problems. I suspect the import problem has nothing to do with file size. I will test again when I have time.

damianmgarcia commented 1 week ago

Thanks for the update!

Today I installed Ubuntu/Chromium and discovered what the issue is. Unlike on Windows/Chrome, selecting a file causes the popup to lose focus and close immediately, which kills popup.js and prevents it from importing the data from the file. The reason the import works when you have devtools open is because it prevents the popup from closing. Unfortunately, the closing of the popup varies with the browser, and Firefox also has this same issue. I'll look into what the options are for fixing this, including possibly using the sidePanel API (https://developer.chrome.com/docs/extensions/reference/api/sidePanel) in the future.

wchen342 commented 1 week ago

That's a very interesting discovery! I haven't used Chrome on Windows for a while so I didn't realize the differences between platforms. Apparently there is a bug report for Chromium but it seems they are not in a hurry to fix it, so I guess you will have to use some workarounds for now.