-
Notifications
You must be signed in to change notification settings - Fork 111
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
[My store] Fix error banner so it appears when stats data can't be loaded #10262
Conversation
You can test the changes from this Pull Request by:
|
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.
Nice catch on the issue, works as expected
periodGroup.leave() | ||
periodStoreStatsGroup.leave() | ||
group.leave() |
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.
nit: maybe it's worth making a comment so that we don't accidentally reorder it?
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 thought!
Closes: #10259
Description
The error banner (to explain there is a problem loading data) was not showing up on the My store dashboard. This PR fixes 3 related issues:
StoreStatsAndTopPerformersViewController
there are several dispatch groups used for syncing (group
,periodGroup
, andperiodStoreStatsGroup
). We now callgroup.leave()
last to make sure all the work for the time period is complete (including setting any period sync error) before checking for and handling sync errors for the dashboard as a whole.DashboardViewModel
we check if the store is authenticated with WPCom before dispatching those actions, to avoid extra API calls and unnecessary sync errors.DashboardViewController
we hide the error banner optimistically on pull to refresh.Testing instructions
You can test using a store with or without Jetpack, to confirm the expected stats load in both cases.
Screenshots
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-07-19.at.14.10.56.mp4
RELEASE-NOTES.txt
if necessary.