ankit / stylebot

Change the appearance of the web instantly
https://stylebot.dev/
MIT License
1.38k stars 204 forks source link

[Bug] new sync missed and clobbered previous sync #751

Open mentalisttraceur opened 1 year ago

mentalisttraceur commented 1 year ago
  1. Installed Stylebot yesterday on one laptop (Brave browser on Linux). Opened a website, pasted my custom CSS for it into Stylebot (worked great, loved it!).
  2. Turned on sync, verified that Stylebot's JSON file appeared in Google Drive with my CSS. Lovely!
  3. Installed Stylebot later on second laptop (Brave browser on Windows). Opened the same website.
  4. Noticed that my styles were not applied. Opened Stylebot to the "code" tab, saw that it was blank. Remembered that on this laptop I didn't yet turn on sync.
  5. Turned on sync, sync allegedly came on, but my upstream CSS didn't appear in the code tab.
  6. Toggled between the code tab and other tabs once or twice. Hit the sync button once or twice.
  7. Checked in Google Drive: the JSON file was wiped to an empty slate.

Seems like second browser's Stylebot failed to see/register/apply the changes from the first, or at least didn't update the state of the built-in code editor, and then saved that still blank state over what I previously synced.

Expected behavior

When a new instance of Stylebot has cloud sync first turned on, I'd expect it to successfully load and apply all of the CSS that was already synced to that account for all webpages that have CSS saved, even in edge cases like Stylebot's code editor being already open on one of those pages.

mentalisttraceur commented 1 year ago

Okay, it looks like sync just never looks at the information in Google drive - it's just a one-way push/override to the cloud?

What's the receptivity to a PR which will download and compare what's in Google Drive to what the local StyleBot has configured, and pick the latest (based on some basic heuristic like timestamp to start)?