Skip to content
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

websocket onConnected firing late sometimes #6

Closed
sandros94 opened this issue Jun 12, 2024 · 0 comments
Closed

websocket onConnected firing late sometimes #6

sandros94 opened this issue Jun 12, 2024 · 0 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@sandros94
Copy link
Owner

sandros94 commented Jun 12, 2024

https://github.com/Sandros94/nuxt-surrealdb/blob/57e46f334a0848069b82cd8a00925ba1cbccb8d7/src/runtime/composables/surreal-ws.ts#L59-L80

Currently, like in the example below, it can happen that the use message within onConnected is sent after the live message, although it should be the other way around. It suggests a racing condition not being respected with the useBuffer.

https://github.com/Sandros94/nuxt-surrealdb/blob/0fb0bf34f703613bb65230e80fc56ffae43d539b/playground/pages/ws-examples.vue#L21-L22

In the following screenshot the request with id 1 is the configuration message (method: 'use'), while the request with id 0 is the live('products'). For no reason, at random, they switch order like this.
image

@sandros94 sandros94 added bug Something isn't working help wanted Extra attention is needed labels Jun 12, 2024
@sandros94 sandros94 self-assigned this Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant