-
Notifications
You must be signed in to change notification settings - Fork 61
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
🐛 Bug Report: Realtime channel still receiving data after user session is deleted/logout #25
Comments
This is a different unexpected behaviour but might share the same root cause with #24 |
Yeah, that is actually expected behavior as of right now. The realtime server is only aware of the session when the user connects. So once the user is connected and authenticated, the connection is assigned to a specific user - not session. To prevent this, I can only think of re-establishing the connection after a session is /created/deleted. This definitely require some more work and planning to fix. |
Thanks for the feedback To avoid non-authorized user receiving data from Websocket, currently I am thinking to refresh the page after user click logout. Do you have other recommendation? |
I have also noticed if I have unsubscribed to a channel, although the callback is not fired but I will still be receiving data from Websocket |
Can you provide me the list of channels where that happens? |
|
The logic should be, to only reconnect and therefore tell the Realtime Server the new list of channels, when you unsubscribe from a channel when there is no subscription attached to it anymore. I'll check on my side what's happening 🙂 |
@TorstenDittmann I think this has been fixed by #93 |
👟 Reproduction steps
Config/Setup:
To reproduce:
Login as
User A
, e.g.sdk.account.createSession(User A email, User A password)
At a React page, using WebSDK to subscribe to a channel like so
Update any of the documents on the said collection from Appwrite Console, and I can noticed data is received, and channel/subscription callback is executed
User A
logout,unsubscribe()
is fired, and thenUser A
is logout like sosdk.account.deleteSession('current')
/sdk.account.deleteSession(session_id)
NOTE: Don't refresh browser page or close the browser tab, if you have refreshed browser page or close the browser tab you can't reproduce the issue
Update any of the documents on the said collection from Appwrite Console, at the same browser tab where
sdk.account.deleteSession
is executed and I can noticed data is still being received As seen in image below where data still coming into Websocket , but channel/subscription callback is NOT executed👍 Expected behavior
As described in reproduction steps above, I am expecting Websocket stop receiving data after session is removed after
sdk.account.deleteSession('current')
/sdk.account.deleteSession(session_id)
👎 Actual Behavior
After
sdk.account.deleteSession('current')
/sdk.account.deleteSession(session_id)
, Websocket still receiving data🎲 Appwrite version
Different version (specify in environment)
💻 Operating system
Linux
🧱 Your Environment
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: