You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically a logout should be a client action only - it deletes the database and then tries to do an initial sync based on anonymous user to get schema and public data in sync. If this sync fails, user is still technically logged out but hasn't got public data from the server yet. But as soon as the app goes online again it should do the initial sync.
Is the bug happening when client is offline, there are unsynced changes, and user choose to log out? Does it leave the db in a buggy state?
I have a solution for my request WebPush for DexieCloud Feature Request #1986, which requires writing some database entries when the user is about to log out. Actually I could solve this client side, but when inspecting the cloud add-on code, I thought it would be nice to push any pending changes before the actual logout. This may be necessary if a table write is immediately followed by the logout request.
In fact, the bug happens when offline. Again, this could be solved client-side, but I think it might be good practice not to block an asynchronous operation when a potentially valid state occurs. I suggest propagating the described error upstream to catch and inform the user.
Suggestions to improve logout behavior (version 4.0.7)
Dexie.js/addons/dexie-cloud/src/authentication/logout.ts
Line 62 in 795f60c
when not online an 'error in syncIfPossible()' exception will be thrown here
Dexie.js/addons/dexie-cloud/src/sync/syncIfPossible.ts
Line 93 in 795f60c
but not propagated upstream in order to catch and inform user that logout is not possible.
The text was updated successfully, but these errors were encountered: