coralproject / talk

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

Create a live icon for showing notification counts #4503

Closed nick-funk closed 7 months ago

nick-funk commented 7 months ago

What does this PR do?

Adds a live icon that shows notification counts.

These changes will impact:

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

None, piggybacks on existing notificationCount(...) query.

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

Adds the notificationsPollRate env var.

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

N/A

How do I test this PR?

Were any tests migrated to React Testing Library?

None

How do we deploy this PR?

Merge into epic branch and release that.

netlify[bot] commented 7 months ago

Deploy Preview for gallant-galileo-14878c canceled.

Name Link
Latest commit 957623aa02399af01f54c342753207b1135f0472
Latest deploy log https://app.netlify.com/sites/gallant-galileo-14878c/deploys/65b03e94820a2b0008b3b1ca
nick-funk commented 7 months ago

Looks good overall! Left a few small comments. Also, I did notice that the live bell is only working for admins/moderators and it's not working for regular commenters. This seems to be due to the @auth placed on the notificationCount.

I looked into it and have fixed this issue. The check is now handled gracefully in the resolver and no longer needs an @auth(...) directive since the conditions are simple. Should work properly now for all users!