eduvpn / eduvpn-common

Code to be shared between eduVPN clients
MIT License
5 stars 3 forks source link

Persist internal state regularly #22

Closed rozmansi closed 1 year ago

rozmansi commented 1 year ago

Unregistering engine saves the internal state (user settings). Unregister is called when client is terminating. However, client might be terminated by force. We had this problem with Windows client: manually installing newer version of the client kills all running client processes and user changes are lost.

If eduvpn-common doesn't implement in-between saves, we will experience this issue again.

In .NET this was fixed by introducing a timer which is reset to 5 seconds on each settings change. When timer triggers, settings are saved.

See: https://github.com/Amebis/eduVPN/issues/222

jwijenbergh commented 1 year ago

In V1 I save the configuration after adding servers, removing servers, getting a configuration and of course deregister.

In V2 it's only in deregister. We can either do periodically saving in the background or determine that the V1 approach was enough.

rozmansi commented 1 year ago

V1 approach is enough, provided we don't miss any change of the user configuration.

jwijenbergh commented 1 year ago

Fixed in v2 add4b39805a38e92068636e47019d9234d62e613