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

Fix fallback interval not causing new visits to be loaded #528

Merged
merged 1 commit into from
Nov 30, 2024

Conversation

acelaya
Copy link
Member

@acelaya acelaya commented Nov 30, 2024

The fallback interval was being tracked in a ref which was updated as a side effect. Since refs do not cause re-renders, the visits for the fallback interval were never loaded.

This PR changes the logic to update a piece of local state instead, which causes a re-render and makes the new visits to be loaded.

Updating local state as a side effect is not a great solution, but this component and how we handle the visits store needs a deeper refactoring to be able to solve this. This is a simple solution for now.

Closes #504

Copy link

codecov bot commented Nov 30, 2024

Codecov Report

Attention: Patch coverage is 37.50000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 77.43%. Comparing base (db3e0d8) to head (79564d6).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/visits/VisitsStats.tsx 37.50% 1 Missing and 4 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #528   +/-   ##
=======================================
  Coverage   77.43%   77.43%           
=======================================
  Files         177      177           
  Lines        7237     7237           
  Branches     1501     1501           
=======================================
  Hits         5604     5604           
  Misses        162      162           
  Partials     1471     1471           

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

@acelaya acelaya merged commit a4252f6 into shlinkio:main Nov 30, 2024
7 of 8 checks passed
@acelaya acelaya deleted the feature/fallback-interval-fix branch November 30, 2024 09:21
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.

Visits fall back does not always work
1 participant