Skip to content

fix: make scopeSummaries hooks always use main write database#3249

Merged
tefkah merged 1 commit intomasterfrom
tfk/no-scope-summary
Mar 3, 2025
Merged

fix: make scopeSummaries hooks always use main write database#3249
tefkah merged 1 commit intomasterfrom
tfk/no-scope-summary

Conversation

@tefkah
Copy link
Member

@tefkah tefkah commented Mar 3, 2025

Issue(s) Resolved

Might resolve #3245 ?

Hypothesis: when hooks are run, there might have been enough delay between syncing the write db that we end up reading unsynced data. Instead, we force all scopeSummary queries to read from the master (write) db instead. that way we should be guaranteed to have the correct data.

All major write operations which have these hooks should probably run in a transaction instead, but that's quite some more work, and this should have a similar result for now.

https://sequelize.org/docs/v7/other-topics/hooks/#hooks-and-transactions

Test Plan

  1. 🙈

Screenshots (if applicable)

Optional

Notes/Context/Gotchas

Supporting Docs

@tefkah tefkah marked this pull request as ready for review March 3, 2025 18:24
@tefkah tefkah requested review from 3mcd and gabestein March 3, 2025 18:24
Copy link
Member

@gabestein gabestein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Seems to work locally. ¯_(ツ)_/¯

@tefkah
Copy link
Member Author

tefkah commented Mar 3, 2025

send it

@tefkah tefkah merged commit e5803da into master Mar 3, 2025
1 check passed
@isTravis isTravis deleted the tfk/no-scope-summary branch February 19, 2026 15:30
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.

Bug: pubs and collections can be created without scope summaries

2 participants