Conversation
elsenhans
reviewed
Mar 13, 2026
Contributor
elsenhans
left a comment
There was a problem hiding this comment.
Looking good!
Just seems like on every mount, two fetches are triggered now: One with the timestamp from initialValue, immediately followed by a second with the timestamp from useEffect.
slaemmer
approved these changes
Mar 13, 2026
|
elsenhans
reviewed
Mar 26, 2026
| timestamp: { | ||
| initialValue: timestamp, | ||
| }, | ||
| timestamp: { initialValue: Date.now() }, |
Contributor
There was a problem hiding this comment.
Consider initializing with initialValue: null since the value will be overwritten by the useEffect anyway.
| }} | ||
| onNeedMoreData={() => { | ||
| source.fetchMore(30); | ||
| if (source.totalCount() > source.records().length) { |
Contributor
There was a problem hiding this comment.
Consider adding a test for the onNeedMoreData guard to verify that fetchMore is only called when totalCount() > records().length.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



https://folio-org.atlassian.net/browse/UIEUS-512
Purpose
When users navigate to the jobs page (
/eusage/jobs), stale data from the initial module load is displayed because the timestamp used in the query was set once at module evaluation time. Users had to manually refresh to see current job information.Approach
timestampvariable with auseEffecthook inJobsViewRoutethat callsmutator.timestamp.replace(Date.now())on each mount, ensuring a fresh fetch on every navigationonNeedMoreDatainJobsViewto only callsource.fetchMore()when loaded records are fewer than total available records