Initial fetch is made too early. |
||||||||||
Issue descriptionObserved on N6, connected on GIN-2G: (already logged in, cleared stored snippets, then killed and restarted Chrome on the NTP) UI: - NTP loads - "No snippets" card loads - ... - ... - Hit the reload button - Snippets are displayed Logs: (I added some more, but the logic is the same) I/chromium: [INFO:ntp_snippets_service.cc(763)] DGN - EnterState(0, 2) <= Initial connection to the DB in the constructor V/chromium: [VERBOSE1:ntp_snippets_status_service.cc(82)] [GetNewDisabledReason] Enabled I/chromium: [INFO:ntp_snippets_service.cc(763)] DGN - EnterState(1, 2) <= DB load finished V/chromium: [VERBOSE1:ntp_snippets_service.cc(780)] Entering state: READY I/chromium: [INFO:ntp_snippets_service.cc(263)] DGN - Initiating fetch <= We had no snippets se we do a fetch E/chromium: [ERROR:ntp_snippets_fetcher.cc(440)] Unable to get token: Request canceled. - fetching the snippets without authentication. <= Uh oh... I/chromium: [INFO:ntp_snippets_service.cc(836)] DGN - UpdateCategoryStatus 1 D/cr_DGN : [StatusListItem.java:142] StatusListItem#create(AVAILABLE) <= UI notified of the results from fetch D/cr_NtpCards: [StatusListItem.java:89] Registering card for status: No Snippets D/cr_Ntp : [NewTabPageAdapter.java:144] Received 0 new snippets. I/chromium: [INFO:ntp_snippets_service.cc(263)] DGN - Initiating fetch <= Hit reload on the card I/chromium: [INFO:ntp_snippets_service.cc(836)] DGN - UpdateCategoryStatus 2 D/cr_DGN : [StatusListItem.java:146] StatusListItem#create(AVAILABLE_LOADING) D/cr_NtpCards: [StatusListItem.java:89] Registering card for status: No Snippets V/chromium: [VERBOSE1:ntp_snippets_fetcher.cc(358)] Sending a NTP snippets request to https://... <= Now it loads! I removed the dependency on sync (https://codereview.chromium.org/2191343002/), which makes us do the initial fetch much earlier. That seems to early for the fetcher (hit OnGetTokenFailure) even though we are definitely signed in. Should the fetcher cache the request until it knows it can make it?
,
Jul 29 2016
,
Jul 29 2016
,
Aug 1 2016
I'll try to take a look this week. Possible solution: OAuth2TokenService::Observer has an OnRefreshTokensLoaded method - "Called after all refresh tokens are loaded during OAuth2TokenService startup". Maybe we need to wait for that before attempting a fetch?
,
Aug 5 2016
,
Aug 5 2016
,
Aug 5 2016
,
Aug 8 2016
,
Aug 9 2016
,
Aug 11 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/36f23cf9e0aae1b88b19afab849ac4a7c80d5e80 commit 36f23cf9e0aae1b88b19afab849ac4a7c80d5e80 Author: jkrcal <jkrcal@chromium.org> Date: Thu Aug 11 14:35:26 2016 Add robustness against OAuth2 Token requests getting canceled. OAuth2 token requests get canceled whenever new refresh tokens are loaded. On Android this happens soon after startup and (on slow devices) quite reliably cancels the requests for content suggestions. This CL adds one retry in case the token request gets canceled. BUG= 632740 Review-Url: https://codereview.chromium.org/2239653002 Cr-Commit-Position: refs/heads/master@{#411325} [modify] https://crrev.com/36f23cf9e0aae1b88b19afab849ac4a7c80d5e80/components/ntp_snippets/ntp_snippets_fetcher.cc [modify] https://crrev.com/36f23cf9e0aae1b88b19afab849ac4a7c80d5e80/components/ntp_snippets/ntp_snippets_fetcher.h
,
Aug 11 2016
|
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by dgn@chromium.org
, Jul 29 2016