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

feat: reduce unnecessary api calls #129

Merged
merged 2 commits into from
Jan 8, 2024
Merged

Conversation

zacharis278
Copy link
Contributor

@zacharis278 zacharis278 commented Jan 5, 2024

Every sequence navigation renders a new ExamWrapper component causing us to hit the /latest endpoint every time. We really only need to do this in a few cases.

  1. If the sequence is an exam itself
  2. If we've first loaded the UI and there is an active exam in another sequence

If the store already has a latest exam there's no reason to keep checking it on every user navigation, the polling function will already take care of refreshing data. I expect this change to drastically reduce the number of API calls we're generating.

@zacharis278 zacharis278 force-pushed the zhancock/reduce-api-calls branch from be40480 to 56b3935 Compare January 5, 2024 17:21
Copy link

codecov bot commented Jan 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8457727) 94.13% compared to head (a404050) 94.14%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #129   +/-   ##
=======================================
  Coverage   94.13%   94.14%           
=======================================
  Files          71       71           
  Lines        1058     1059    +1     
  Branches      289      290    +1     
=======================================
+ Hits          996      997    +1     
  Misses         57       57           
  Partials        5        5           

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

Copy link
Contributor

@alangsto alangsto left a comment

Choose a reason for hiding this comment

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

👍

@zacharis278 zacharis278 merged commit 7f6f442 into main Jan 8, 2024
7 checks passed
@zacharis278 zacharis278 deleted the zhancock/reduce-api-calls branch January 8, 2024 15:47
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.

3 participants