coralproject / talk

A better commenting experience from Vox Media
https://coralproject.net
Other
1.88k stars 355 forks source link

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

Closed nick-funk closed 3 months ago

nick-funk commented 3 months ago

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:

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: https://github.com/coralproject/talk/issues/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.

netlify[bot] commented 3 months ago

Deploy Preview for gallant-galileo-14878c canceled.

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