salarcode / SmartProxy

Firefox/Chrome browser extension. SmartProxy will automatically enable/disable proxy for the sites you visit, based on customizable patterns.
https://addons.mozilla.org/en-US/firefox/addon/smartproxy/
GNU General Public License v3.0
1.93k stars 117 forks source link

Restore backup fails when quiting Firefox with X #387

Closed dik23 closed 3 months ago

dik23 commented 4 months ago

Description

When I restore a backup to a clean SmartProxy I see an error depending on how I close Firefox

If I close FF with the window's X in the top right the settings are borked

If I close FF with the exit option under the three line menu the settings are fine

Steps to Reproduce

To start "Factory reset" SmartProxy

Then backup / restore > restore backup > choose backup json

Restore completes. If I go to Smart Proxy then the profile name is Smart Proxy and all my settings are good

Close FF with the window's X in the top right

Reopen FF

The SmartProxy settings are missing and the profile name is {profile-name}

If I repeat this but use the Exit option from the menu rather than the window's X then the settings are there after restarting FF

Which browsers did you test this on?

Firefox

Affected browser versions

Firefox 127.0.2, Windows 11

Affected SmartProxy versions

SmartProxy 1.4.7

Screenshots of the problems or steps to reproduce

Settings restored: settings restored

Settings lost after FF restart with X settings lost

Firefox Exit - using this means the settings are good FF exit

Any additional context

No response

salarcode commented 3 months ago

You might have a broken backup! If you can please attach it here or send it to me privately at my email salarcode [at] gmail.com

dik23 commented 3 months ago

I have now emailed the backup json

salarcode commented 3 months ago

Thanks got the email. Your backup is indicating you are using version 1.1.1. Please make sure you are using the latest version of the extension. Update manually from extensions page if needed

That must work, but if that didn't work, don't restore any backup, just try to create the settings again as you don't have much and should be easy to do

dik23 commented 3 months ago

This is not fixed

The backup was originally made with an earlier version of SmartProxy but as I wrote above the restore problem was with v1.4.7. I have just updated to v1.5 and am seeing the same problem.

Are we really supposed to make a new backup every time SmartProxy is updated? Shouldn't backups be compatible?

Also I have now made a backup using the newly released v1.5 and I am experiencing the exact same as when I used the v1.1.1 backup

If I manually enter the Proxy Server and Smart Proxy Profile and then close using the X in FF I still lose the settings as described above - so this is not a bug in the backup / restore - it seems to be a bug in the initial settings being saved when the X is used to close Firefox

To add - this only happens if the SmartProxy Options tab isn't closed before FF is exited. If I close the tab before using X the settings are saved.

In fact if I close the Options tab, close Firefox with X, then reopen FF and the reopen the Options tab closing FF with the Options tab open causes the settings to be cleared

dik23 commented 3 months ago

Here's a video to better explain:

Screencast from 2024-07-22 16-32-25.webm

salarcode commented 3 months ago

Here's a video to better explain: Screencast.from.2024-07-22.16-32-25.webm

What is happening here is completely normal and expected! Maybe not pleasant for users which I can prevent it later with some code.

So basically you have the options page restored by Firefox rather it being open from SmartProxy itself. There is no state when the page is being loaded by Firefox, the state of the Extension is very important as you might imagine. Just close/reopen the page from SmartProxy itself.

salarcode commented 3 months ago

This is not fixed

The backup was originally made with an earlier version of SmartProxy but as I wrote above the restore problem was with v1.4.7. I have just updated to v1.5 and am seeing the same problem.

Are we really supposed to make a new backup every time SmartProxy is updated? Shouldn't backups be compatible?

Also I have now made a backup using the newly released v1.5 and I am experiencing the exact same as when I used the v1.1.1 backup

If I manually enter the Proxy Server and Smart Proxy Profile and then close using the X in FF I still lose the settings as described above - so this is not a bug in the backup / restore - it seems to be a bug in the initial settings being saved when the X is used to close Firefox

To add - this only happens if the SmartProxy Options tab isn't closed before FF is exited. If I close the tab before using X the settings are saved.

In fact if I close the Options tab, close Firefox with X, then reopen FF and the reopen the Options tab closing FF with the Options tab open causes the settings to be cleared

Backups from older version are semi-compatible and there is no promise on that, rather they are being upgraded in the restore process. Your configs might get lost and change. Backups are compatible between immediate previous releases though. Always keep backups from latest versions.

dik23 commented 3 months ago

Here's a video to better explain: Screencast.from.2024-07-22.16-32-25.webm

What is happening here is completely normal and expected! Maybe not pleasant for users which I can prevent it later with some code.

So basically you have the options page restored by Firefox rather it being open from SmartProxy itself. There is no state when the page is being loaded by Firefox, the state of the Extension is very important as you might imagine. Just close/reopen the page from SmartProxy itself.

Ok, got it. Thank you. You're right, that's not pleasant for users!!