-
Notifications
You must be signed in to change notification settings - Fork 4k
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: Web SDK fails to disconnect when the unsubscribe function is returned #7584
Comments
@collinmyers, thanks for raising this issue! 🙏🏼 This definitely looks like a bug in the SDK. It doesn't look the the SDK is closing the websocket because of this code: https://github.com/appwrite/sdk-for-web/blob/ca8cb1d9f2c0393ec99c7d5cb50f3be543987918/src/client.ts#L211 Related Discord thread: https://discord.com/channels/564160730845151244/1201047679338295429 |
Waiting for update about this issue, it was really headache for my chat app 🚀 |
Any updates here ? |
@xuelink https://github.com/ZachHandley/AppwriteReactRealtimeTest can you fork this and give me a reproducible example perchance -- this is 1.5, but I imported the built SDK right in and I don't think the Realtime changed in between, but I can test it on 1.4 if there's an issue Can't seem to get it to break myself though that's a really simple example |
@ZachHandley Thank you for your interest here but im not comfortable with react well, so maybe @collinmyers can do it for reproduction for you to understand easily. This closed issue is the same issue as reproduced with angular: appwrite/sdk-for-web#91 I just bypassed this issue by forking sdk and commenting this related line temporarily. ref |
Fixed in appwrite/sdk-for-web#93 |
👟 Reproduction steps
This occurs with both the useEffect and useFocusEffect hooks. Upon subscribing to the real-time event from the database, you receive a function within the logic to eventually unsubscribe. When navigating away from the page, the components in the return statement of the useEffect or useFocusEffect should execute. The function returned from the subscribe operation should disconnect the real-time connection.
👍 Expected behavior
Upon unmounting the component, the unsubscribe function should terminate the real-time connection.
👎 Actual Behavior
The real-time connection remains active even after the component has been unmounted.
🎲 Appwrite version
Version 1.4.x
💻 Operating system
Windows
🧱 Your Environment
I'm utilizing Appwrite v1.4.13, along with SDK version 13.0.1, in a self-hosted environment. This setup is integrated within a React Native application.
👀 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: