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

Prevent lazy loading of SQLAlchemy relationships. #960

Merged
merged 3 commits into from
May 27, 2024
Merged

Conversation

gperetin
Copy link
Contributor

@gperetin gperetin commented May 25, 2024

This is somewhat complex area so I added a few comments in key places, hopefully it clarifies it.
The gist is that we have "boundary", things that are eagerly loaded and things that aren't. That boundary is set/reset in 3 places: when creating a project, when loading a project and when a StateManager.commit() is done. The goal of this diff is to ensure that the set of eagerly loaded models is always the same regardless of how we get to a certain state, so the rest of the app doesn't have to do any awaiting/lazy loading, and can rely that the models will be in place.

@gperetin gperetin marked this pull request as draft May 25, 2024 16:32
@gperetin gperetin requested a review from senko May 26, 2024 10:33
@gperetin gperetin marked this pull request as ready for review May 26, 2024 10:34
Copy link
Contributor

@senko senko left a comment

Choose a reason for hiding this comment

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

Seems legit! :shipit:

@senko senko merged commit 49cb711 into rewrite May 27, 2024
6 checks passed
@senko senko deleted the prevent-lazy-loads branch May 27, 2024 12:36
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