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

[CORL-3166] Prime comment cache when loading single conversation view #4612

Merged
merged 2 commits into from
May 7, 2024

Conversation

nick-funk
Copy link
Contributor

@nick-funk nick-funk commented May 3, 2024

What does this PR do?

Adds a check to see if the comment cache has been primed when loading a single conversation view's comment replies.

Ensures that the whole story is primed into Redis before trying to use the cache to load the single conversation view with its parents and replies around the target shared comment.

These changes will impact:

  • commenters
  • moderators
  • admins
  • developers

What changes to the GraphQL/Database Schema does this PR introduce?

None

Does this PR introduce any new environment variables or feature flags?

No

If any indexes were added, were they added to INDEXES.md?

N/A

How do I test this PR?

See the reproduction steps laid out in the reporting issue:
#4609

Useful mutations when testing:

POST: http://localhost:3000/api/graphql

mutation {
  enableFeatureFlag(input: {
    clientMutationId: "1",
    flag: DATA_CACHE
  }) {
    flags
  }
}

POST: http://localhost:3000/api/graphql

mutation {
  disableFeatureFlag(input: {
    clientMutationId: "1",
    flag: DATA_CACHE
  }) {
    flags
  }
}

You can flush redis using: http://localhost:3000/admin/controlpanel

Were any tests migrated to React Testing Library?

No

How do we deploy this PR?

Merge into develop and add to upcoming release.

…view

adds a check to only prime once in the `commentCache` so we can keep
calling it to ensure it's at least done once when loading a stories
comments whether in the regular stream or a singular conversation view
so as to ensure the cache is primed to return all appropriate ancestors
and replies.
@nick-funk nick-funk requested a review from kabeaty May 3, 2024 16:58
Copy link

netlify bot commented May 3, 2024

Deploy Preview for gallant-galileo-14878c canceled.

Name Link
🔨 Latest commit 1da4691
🔍 Latest deploy log https://app.netlify.com/sites/gallant-galileo-14878c/deploys/6635179be7d6f900082d4dfd

Copy link
Contributor

@kabeaty kabeaty left a comment

Choose a reason for hiding this comment

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

Looks great!

@tessalt tessalt added this pull request to the merge queue May 7, 2024
@tessalt tessalt added this to the v9.0.5 milestone May 7, 2024
Merged via the queue into develop with commit cb67a39 May 7, 2024
6 checks passed
@tessalt tessalt deleted the fix/CORL-3166-single-convo-cache-prime branch May 7, 2024 18:57
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.

None yet

3 participants