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

Only emit 'update' events after the entire state cache has been updated. #433

Merged
merged 1 commit into from Mar 20, 2022

Conversation

evert
Copy link
Collaborator

@evert evert commented Mar 20, 2022

Currently Ketting has a race condition for updates with embedded items.
If items are embedded, we were sending out 'update' events even if the
entire request wasn't processed yet.

This can make it unpredictable to know whether a resource's parent or
child is updated.

This change processes an entire _embedded tree with sub-dependencies,
and only after the entire tree is cached it will start sending out
'update' events.

Now, when you receive an 'update' event the entire cache state is
consistent.

Currently Ketting has a race condition for updates with embedded items.
If items are embedded, we were sending out 'update' events even if the
entire request wasn't processed yet.

This can make it unpredictable to know whether a resource's parent or
child is updated.

This change processes an entire _embedded tree with sub-dependencies,
and only after the entire tree is cached it will start sending out
'update' events.

Now, when you receive an 'update' event the entire cache state is
consistent.
@evert evert added the bug label Mar 20, 2022
@evert evert requested review from mhum and merrickread March 20, 2022 21:01
@evert evert self-assigned this Mar 20, 2022
@evert evert enabled auto-merge March 20, 2022 21:02
@evert evert merged commit 1c77cc6 into main Mar 20, 2022
@evert evert deleted the state-cache-race-condition branch March 20, 2022 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants