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

Invalidate GQL cache for org when a new project added to it #976

Merged
merged 4 commits into from
Jul 25, 2024

Conversation

rmunn
Copy link
Contributor

@rmunn rmunn commented Jul 23, 2024

Fixes #933.

This PR attempts to only invalidate the projects field of orgById to minimize the amount of information the next GQL query needs to pull, however in practice it looks like we'd have to run more granular queries to take advantage of that. URQL apparently does not reduce the info requested in a query just because the GraphQL cache is up-to-date for most of it (since that could fail if you're using persisted queries), so our orgById query pulls the entire org data even when it would only have needed to pull the projects field. So we could, in theory, do away with commit 3db96a6. In practice, it might as well stay since it does no harm and may, in the future, do some good.

@rmunn rmunn self-assigned this Jul 23, 2024
@rmunn rmunn requested a review from hahn-kev July 23, 2024 04:12
Copy link

github-actions bot commented Jul 23, 2024

UI unit Tests

12 tests  ±0   12 ✅ ±0   0s ⏱️ ±0s
 4 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit bb835dc. ± Comparison against base commit 43baf7c.

♻️ This comment has been updated with latest results.

hahn-kev
hahn-kev previously approved these changes Jul 23, 2024
Copy link
Collaborator

@hahn-kev hahn-kev left a comment

Choose a reason for hiding this comment

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

looks good to me. Let's wait for #972 to be merged in and then add that as an invalidation path here too.

rmunn added 3 commits July 24, 2024 14:48
This ensures that navigating to the org will show the new project.
This may avoid unnecessary data returning from GraphQL queries that need
to refresh the list of projects.
@rmunn rmunn force-pushed the bug/933-invalidate-gql-for-projects-created-in-org branch from 3db96a6 to b398515 Compare July 24, 2024 07:51
@rmunn rmunn requested a review from hahn-kev July 24, 2024 07:52
Copy link
Collaborator

@hahn-kev hahn-kev left a comment

Choose a reason for hiding this comment

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

looks good to me, I tested it and found a crash in the backend, fixed it. Wasn't caused by the changes here.

@hahn-kev hahn-kev enabled auto-merge (squash) July 25, 2024 02:37
Copy link

C# Unit Tests

53 tests   53 ✅  5s ⏱️
10 suites   0 💤
 1 files     0 ❌

Results for commit bb835dc.

@hahn-kev hahn-kev merged commit fa97734 into develop Jul 25, 2024
12 checks passed
@hahn-kev hahn-kev deleted the bug/933-invalidate-gql-for-projects-created-in-org branch July 25, 2024 02:39
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.

newly created projects which are added to an org don't invalidate the org gql cache
2 participants