Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Sync up" is broken if I close and reopen Firefox when 'Always use private browsing mode' is enabled #123

Open
bgx opened this issue Sep 18, 2019 · 1 comment
Labels

Comments

@bgx
Copy link

@bgx bgx commented Sep 18, 2019

Describe the issue you are experiencing
"Sync up" is broken if I close and reopen Firefox when 'Always use private browsing mode' is enabled

"sync up" - pushing local updates to server
"sync down" - pulling updates from server

How can the issue be reproduced?
Steps to reproduce the behavior:
[Verify working state]

  1. Open Firefox, sign in to xBrowserSync, and verify sync (up and down) is working

[Proceed to broken state]
2. Go to 'Options'
3. Click on 'Privacy & Security'
4. Scroll down to History
5. In "Firefox will" dropdown, select 'Use custom settings for history', and enable 'Always use private browsing mode' (I believe this is the same as selecting 'Never remember history')
6. If prompted to "Restart Firefox", select 'Restart Firefox now'; otherwise, close and reopen Firefox
7. The xBrowserSync add-on has a red circle in the lower right corner
image

[Sync up is broken]
8. Modify bookmarks in Firefox
9. Notice no "sync up" is performed. Notice the add-on's Gear > Update Sync button is always disabled, with message "Sync is up to date."

[Sync down seems okay, and sync up after sync down is okay]
10. In another browser, make changes to bookmarks
11. Back in Firefox, click xBrowserSync add-on icon, click gear, and verify 'Update Sync' button is enabled. Notice text reads "Updates available, next sync at ."
image
12. Click 'Update Sync' button
13. Verify changes from step 9 are synced down correctly. Notice changes from step 8 are lost.

[Similar settings that do not cause issue]
14. Go to 'Options'
15. Click on 'Privacy & Security'
16. Scroll down to History
17. In "Firefox will" dropdown, select 'Use custom settings for history', and disable 'Always use private browsing mode'. If prompted to "Restart Firefox", select 'Restart Firefox now', and repeat steps 14-16
18. Enable 'Clear history when Firefox closes'. Click Settings... button, check all options, and click OK
19. Scroll up to 'Cookies and Site Data'
20. Enable 'Delete cookies and site data when Firefox is closed
21. Close and reopen Firefox
22. Observe that sync up and down works correctly

Desktop browser
Please complete the following information for all affected desktop browsers:

  • OS: Windows 10 Pro, Version 1903 [specifically, Version 10.0.18362 Build 18362]
  • Browser: Firefox
  • Version: 69.0 (64-bit)

Application log
Please include the logs from the affected clients:

2019-09-18 01:42:55.479 [trace] onCreated event detected
2019-09-18 01:42:55.485 [trace] Sync 1gii7wj (push) queued (1 waiting to sync)
2019-09-18 01:42:56.749 [trace] Sync 1gii7wj completed (0 waiting to sync)
2019-09-18 01:43:22.744 [trace] Updates available, local:2019-09-18T01:42:57.434Z remote:2019-09-18T01:43:18.147Z
2019-09-18 01:43:25.431 [trace] Sync x2b4cn (pull) queued (1 waiting to sync)
2019-09-18 01:43:36.861 [trace] Local population completed in 10.109s
2019-09-18 01:43:36.876 [trace] Sync x2b4cn completed (0 waiting to sync)
2019-09-18 01:47:11.550 [trace] Updates available, local:2019-09-18T01:43:18.147Z remote:2019-09-18T01:47:08.018Z
2019-09-18 01:47:15.655 [trace] Sync 1ccp192 (pull) queued (1 waiting to sync)
2019-09-18 01:47:27.566 [trace] Local population completed in 10.52s
2019-09-18 01:47:27.576 [trace] Sync 1ccp192 completed (0 waiting to sync)
2019-09-18 01:48:46.099 [trace] Starting up
2019-09-18 01:48:46.131 [trace] {"displayHelp":false,"displayOtherSyncsWarning":false,"lastUpdated":"2019-09-18T01:47:08.018Z","networkDisconnected":false,"syncBookmarksToolbar":true,"syncEnabled":true,"syncId":"be93817750ef4fef86040c9b7f3c2c77","syncVersion":"1.5.0","appVersion":"1.5.0","platform":{"name":"firefox","version":"69.0.0","mobile":false,"os":"Windows 10"}}
2019-09-18 01:49:56.802 [trace] Starting up
2019-09-18 01:49:56.857 [trace] {"displayHelp":false,"displayOtherSyncsWarning":false,"lastUpdated":"2019-09-18T01:47:08.018Z","networkDisconnected":false,"syncBookmarksToolbar":true,"syncEnabled":true,"syncId":"be93817750ef4fef86040c9b7f3c2c77","syncVersion":"1.5.0","appVersion":"1.5.0","platform":{"name":"firefox","version":"69.0.0","mobile":false,"os":"Windows 10"}}
2019-09-18 01:50:01.056 [trace] onRemoved event detected
2019-09-18 01:50:01.061 [trace] Sync 1cqz1ri (push) queued (1 waiting to sync)
2019-09-18 01:50:02.395 [trace] Sync 1cqz1ri completed (0 waiting to sync)
2019-09-18 01:50:20.016 [trace] Updates available, local:2019-09-18T01:50:03.084Z remote:2019-09-18T01:50:17.539Z
2019-09-18 01:50:20.797 [trace] Sync crhmnm (pull) queued (1 waiting to sync)
2019-09-18 01:50:31.794 [trace] Local population completed in 9.889s
2019-09-18 01:50:31.813 [trace] Sync crhmnm completed (0 waiting to sync)
2019-09-18 01:51:28.265 [trace] Updates available, local:2019-09-18T01:50:17.539Z remote:2019-09-18T01:51:24.832Z
2019-09-18 01:51:29.244 [trace] Sync ajoo9h (pull) queued (1 waiting to sync)
2019-09-18 01:51:40.291 [trace] Local population completed in 9.894s
2019-09-18 01:51:40.301 [trace] Sync ajoo9h completed (0 waiting to sync)

Edit: I forgot to include steps in between step 13 and step 14 showing that sync up seems to be working correctly after a sync down. I don't have time to update the steps and logs right now.

@nero120

This comment has been minimized.

Copy link
Member

@nero120 nero120 commented Sep 19, 2019

@bgx thanks for the detailed info, I've recreated this. Unfortunately it's not a straightforward fix.

The problem is caused because the runtime.onStartup event does not fire when the browser is in "private" mode. This is also consistent with the Chrome behaviour, except they call it "incognito" mode.

Helpfully, someone realised that not triggering a startup event is not particularly helpful when your extension relies on it, and reported a bug to the Chrome devs... back in 2013. Those devs clearly didn't think it was important because they didn't even bother to respond to the bug report, and it's an issue that remains to this day. When Mozilla implemented the Web Extensions API they probably copied the same behaviour to be consistent with Chrome.

Anyways, I'm not sure what the best thing to do here is. I very much doubt Google or Mozilla will address this anytime in the foreseeable future so it's either xBrowserSync doesn't support private/incognito mode or I need to start hacking around events which could lead to more issues.

I'll give it some thought...

@nero120 nero120 added the blocked label Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.