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
add back sessionDate to api call. #285
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cache the
sessionDate
to when the instance ofAvUserPermissionsResourceFactory
is instantiated. All of the calls afterwards would have the samesessionDate
. Is this what is wanted or should it create a newsessionDate
value when the calls is made (or eventually expire)?A problem I could see happening is if this
sessionDate
is old (the user has been on the page for a little while) and this is older than the cache on the server this will trigger the server to not repull even though the cache on the server was out-of-date. And if that is the case, you would be better off caching the inital results in memory on the client (not saying that is a good idea, just saying that it would avoid unneeded network calls since you could determine that the server would return the same cached results).Also,
new Date().toJSON()
does the same thing and is native to the browser.moment
tends to get overused and while it is nice for parsing, comparing, and fancy formatting and is already included in the project, it would be nice to only use it when the browser doesn't already natively support the feature.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behavior is as desired that only bust cache on server potentially on initial load. Subsequent calls would hit cache. I agree that is essentially same as caching on client, but currently not sure good way to change back in logic without significant risk. This change was how it was working before in 1.x version due to issues with switching region and server not having the must current region for user. I will make change to new Date()