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

H-3609: Reduce cost of polling for notification and draft entities counts #5838

Merged
merged 7 commits into from
Dec 11, 2024

Conversation

CiaranMn
Copy link
Member

@CiaranMn CiaranMn commented Dec 9, 2024

🌟 What is the purpose of this PR?

We display a count of (a) notifications and (b) draft entities requiring processing in the top navigation bar and sidebar.

The data for this is currently fetched by an app-wide context which polls for notifications and draft entities. This fetches all the notification and draft entities, because it is also used by the notifications and draft queue pages, which require the actual entity data.

App-wide we only need the count of entities, not the entities themselves. This PR therefore splits those contexts out into (1) app-wide contexts for fetching the count only, and (2) contexts used in the relevant pages only, which gets the rest of the data.

This reduces the amount of data we are polling for while not on the notifications or draft queue pages.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

🛡 What tests cover this?

  • None yet.

❓ How to test this?

  1. Not possible via the preview deployment as it relies on Node API changes.

@CiaranMn CiaranMn self-assigned this Dec 9, 2024
@github-actions github-actions bot added area/apps > hash* Affects HASH (a `hash-*` app) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team type/eng > backend Owned by the @backend team area/apps labels Dec 9, 2024
@CiaranMn CiaranMn changed the title H-3609: Reduce cost of polling for notification and draft entities H-3609: Reduce cost of polling for notification and draft entities counts Dec 9, 2024
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 22.99%. Comparing base (3790335) to head (f423140).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5838      +/-   ##
==========================================
- Coverage   22.99%   22.99%   -0.01%     
==========================================
  Files         569      569              
  Lines       19096    19094       -2     
  Branches     2709     2709              
==========================================
- Hits         4392     4390       -2     
  Misses      14652    14652              
  Partials       52       52              
Flag Coverage Δ
apps.hash-ai-worker-ts 1.32% <ø> (ø)
apps.hash-api 1.16% <ø> (ø)
local.hash-backend-utils 8.80% <ø> (ø)
local.hash-isomorphic-utils 0.99% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@CiaranMn CiaranMn requested a review from vilkinsons December 11, 2024 11:32
@CiaranMn CiaranMn marked this pull request as ready for review December 11, 2024 11:32
@CiaranMn CiaranMn enabled auto-merge December 11, 2024 11:40
@CiaranMn CiaranMn added this pull request to the merge queue Dec 11, 2024
Merged via the queue into main with commit cc36894 Dec 11, 2024
65 checks passed
@CiaranMn CiaranMn deleted the cm/reduce-notification-polling-data branch December 11, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apps > hash* Affects HASH (a `hash-*` app) area/apps area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team type/eng > frontend Owned by the @frontend team
Development

Successfully merging this pull request may close these issues.

2 participants