Skip to content

Conversation

Chriztiaan
Copy link
Contributor

@Chriztiaan Chriztiaan commented Apr 10, 2024

There was a small window between getting the first result and setting up the onchange handler. The window is smaller now, considered setting up the onchange handler before retrieving first result. Will look into it as part of investigating backpressure. Also took a fix found from the vue branch and added it here to handle an uncaught exception.

Christiaan Landman added 2 commits April 10, 2024 16:52
…nating a potential race condition between initial result and changes. Also handling a potential uncaught exception.
@Chriztiaan Chriztiaan marked this pull request as ready for review April 10, 2024 15:03
rkistner
rkistner previously approved these changes Apr 10, 2024
@Chriztiaan
Copy link
Contributor Author

Chriztiaan commented Apr 11, 2024

Two unit test were failing because of this change. It seems that previously a watch with an immediate insert would end up with two onResult yields. That case now results in a single onResult yield (with the post-insert data). For these specific tests which check that only watched table table changes trigger yields - I put a sleep between setting up the watch and the insert.

@stevensJourney confirm that this is expected please.

@Chriztiaan Chriztiaan merged commit 8cc1337 into main Apr 11, 2024
@Chriztiaan Chriztiaan deleted the watch-race-condition branch April 11, 2024 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants