-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Stats: Remove state list request persistence. #11580
Conversation
Test live: https://calypso.live/?branch=fix/stats/stuck |
@@ -10,7 +10,7 @@ import { merge, unset } from 'lodash'; | |||
import { createReducer } from 'state/utils'; | |||
import { isValidStateWithSchema } from 'state/utils'; | |||
import { getSerializedStatsQuery } from './utils'; | |||
import { itemSchema, requestsSchema } from './schema'; |
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.
Will want to remove the exported requestsSchema
from ./schema
since it's no longer used.
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.
Good catch timmy, Tks. The reason I persisted the resquests is to keep the last update date visible on the page. Since the data is shown (from persisted state), I figured we should also show the date of this data.
What if we keep persistence or tweak the serialize action to drop pending requests? One other option is to separate the date into its own reducer.
I can see the reasoning here, but seems like the latest date will still be shown after the first request to |
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.
LGTM 🚢
This branch fixes an issue introduced in #11035 that causes a stats page to become "stuck" on an old set of data. The auto-refresh feature introduced in the branch currently persists the state of the
state.stats.lists.requests
subtree, which allows the status of various stats API requests to be permanently stuck in apending
state.When a given query for a stats endpoint is set to
pending
in the state tree, the<QuerySiteStats />
component will not issue any further API requests that match the endpoint/query that is set topending
. As such the only way for a user to fix this problem currently is to deleteindexedDB
manually, or log out.It is helpful to reproduce the issue for yourself to properly test out this branch:
To Reproduce The Issue
There are other ways to get to this state, but I found the above to be the easiest way to reproduce the problem.
To Test the Fix
Run this branch locally, and follow the same steps. Upon reloading the stats page in the last step, the last updated timestamp should be current, and it should update as expected in 3 minutes