-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Agent V2: fix #3434 by avoiding clone of WorkerBridge and WorkerProviderState #3435
Conversation
Visit the preview URL for this PR (updated for commit 96649bc): https://yew-rs-api--pr3435-fix-3434-aogu5kkl.web.app (expires Mon, 09 Oct 2023 15:01:39 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
Size Comparison
✅ None of the examples has changed their size significantly. |
Thank you for the pull request. After examining this issue, I think this bug came from the E.g: Creating a bridge and cloning it 4 times then dropping all of them, worker will receive 1 connected message but 5 disconnected messages. Cloning does not result in multiple handler id being assigned, which is not correct. We should not allow Bridges to be cloned. Users should use fork. Would you like to file a pull request to gloo-worker to fix the underlying implementation? |
I found another problem, the |
if remove the Clone of |
Why isn't using |
I think the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looks good to me.
I am approving this pull request not because the underlying issue of gloo-worker doesn't need fixing any more but this pull request has moved away from WorkerBridge::clone
so it is no longer an issue for Yew Agents.
I would argue that we should fix the underlying issue so gloo-worker consumers can also benefit from it. This PR's fix feels like a bandaid over a bigger issue |
I agree this PR covers the issue of The yew_agent release version or the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gloo worker patch is also released: rustwasm/gloo#388 (comment)
Description
Fixes #3434