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

[Stats Refresh] Period queries being cancelled #11742

Closed
ScoutHarris opened this issue May 21, 2019 · 1 comment · Fixed by #11805
Closed

[Stats Refresh] Period queries being cancelled #11742

ScoutHarris opened this issue May 21, 2019 · 1 comment · Fixed by #11805
Assignees
Milestone

Comments

@ScoutHarris
Copy link
Contributor

A while back, a cancelQueries method was added to StatsPeriodStore to force cancel queries because they were being re-run when they weren't needed. I.e. overview queries were being re-run when Post Stats was displayed, and vice versa.

However, with the ongoing improvements/changes, I think this is causing some issues.

  1. When stats is accessed for the first time, the overview chart is frequently blank.

When this happens, there are a slew of cancelled query messages in the logs. Example:

2019-05-21 14:41:00:166 WordPress[58418:31284690] Error fetching search terms: Optional("cancelled")
2019-05-21 14:41:00:166 WordPress[58418:31284690] Stats: Finished fetching search terms.
2019-05-21 14:41:00:167 WordPress[58418:31284690] Error fetching referrers: Optional("cancelled")
2019-05-21 14:41:00:167 WordPress[58418:31284690] Stats: Finished fetching referrers.
2019-05-21 14:41:00:167 WordPress[58418:31284690] Error fetching posts: Optional("cancelled")
....

  1. When accessing a details view (via View more), then return to Period overview, several stats frequently show No data for this period even though there was data displayed before accessing the details view.
@ScoutHarris
Copy link
Contributor Author

I was finally able to reproduce the issue where the error view shows upon first launch. I'm not sure this is a real world scenario, but this is how I trigger it.

  • The last view selected is a Period (so when the app launches and stats is first accessed, it's on the Period view).
  • From a new branch, run the app in the same simulator.
  • When the app launches, it goes directly to stats Period.
  • I see this view:

error

This is in the logs:

2019-05-22 12:00:56:938 WordPress[58245:35145890] Error fetching posts: Optional("cancelled")
2019-05-22 12:00:56:938 WordPress[58245:35145890] Stats: Finished fetching posts.
2019-05-22 12:00:56:938 WordPress[58245:35145890] Error fetching referrers: Optional("cancelled")
2019-05-22 12:00:56:938 WordPress[58245:35145890] Stats: Finished fetching referrers.
2019-05-22 12:00:56:939 WordPress[58245:35145890] Error fetching authors: Optional("cancelled")
2019-05-22 12:00:56:939 WordPress[58245:35145890] Stats: Finished fetching authors.
2019-05-22 12:00:56:939 WordPress[58245:35145890] Error fetching clicks: Optional("cancelled")
2019-05-22 12:00:56:939 WordPress[58245:35145890] Stats: Finished fetching clicks.
2019-05-22 12:00:56:939 WordPress[58245:35145890] Error fetching search terms: Optional("cancelled")
2019-05-22 12:00:56:939 WordPress[58245:35145890] Stats: Finished fetching search terms.
2019-05-22 12:00:56:939 WordPress[58245:35145890] Error fetching countries: Optional("cancelled")
2019-05-22 12:00:56:939 WordPress[58245:35145890] Stats: Finished fetching countries.
2019-05-22 12:00:56:940 WordPress[58245:35145890] Error fetching Post Stats: Optional("cancelled")
2019-05-22 12:00:56:940 WordPress[58245:35145890] Stats: Finished fetching post stats.
2019-05-22 12:00:56:940 WordPress[58245:35145890] Error fetching videos: Optional("cancelled")
2019-05-22 12:00:56:940 WordPress[58245:35145890] Stats: Finished fetching videos.
2019-05-22 12:00:56:940 WordPress[58245:35145890] Stats: All fetching operations finished.
2019-05-22 12:00:56:955 WordPress[58245:35145890] Error fetching Post Stats: Optional("cancelled")
2019-05-22 12:00:56:955 WordPress[58245:35145890] Stats: Finished fetching post stats.
2019-05-22 12:00:56:955 WordPress[58245:35145890] Stats: All fetching operations finished.
2019-05-22 12:00:56:958 WordPress[58245:35145890] Error fetching Post Stats: Optional("cancelled")
2019-05-22 12:00:56:958 WordPress[58245:35145890] Stats: Finished fetching post stats.
2019-05-22 12:00:56:959 WordPress[58245:35145890] Stats: All fetching operations finished.
2019-05-22 12:00:56:969 WordPress[58245:35145890] Stats: Finished loading data from Core Data.
2019-05-22 12:00:56:969 WordPress[58245:35145890] Stats: Finished setting data to store from Core Data.
2019-05-22 12:00:56:980 WordPress[58245:35145890] Stats: Finished loading data from Core Data.
2019-05-22 12:00:56:980 WordPress[58245:35145890] Stats: Finished setting data to store from Core Data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants