Closed
Bug 1511640
Opened 6 years ago
Closed 6 years ago
Snippets fail to load with "JSON.parse: unexpected end of data at line 1 column 1 of the JSON data"
Categories
(Firefox :: Messaging System, defect, P2)
Firefox
Messaging System
Tracking
()
RESOLVED
WONTFIX
Iteration:
66.1 - Dec 10-23
People
(Reporter: dao, Assigned: ianbicking)
References
(Blocks 1 open bug)
Details
Since yesterday I don't get snippets in about:newtab anymore, and there's this message in the browser console:
JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
_remoteLoader resource://activity-stream/lib/ASRouter.jsm:134
throw self-hosted:1227
I'm using Nightly on Windows 10.
Comment 1•6 years ago
|
||
Thanks for filing ::dao. This looks like an Activity Stream problem.
Component: Service → Activity Streams: Newtab
Product: Snippets → Firefox
Updated•6 years ago
|
Iteration: --- → 66.1 - Dec 10-23
Priority: -- → P2
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → ianb
Assignee | ||
Comment 2•6 years ago
|
||
Dao, are you still seeing this issue? My assumption is that there's some ops issue that is causing the snippets endpoint to return no data (despite a 200 OK response code). A hiccup in the service doesn't seem particularly concerning, assuming that it's not persistent.
If it resolved, I'll propose that we fall back to a cached snippet when we get an empty response (which is what the code does for other kinds of failures). If it's not resolved, then we have to figure out why the endpoint isn't returning any data.
Flags: needinfo?(dao+bmo)
Comment 3•6 years ago
|
||
The snippets endpoint may return no data because there are no snippets for the release / locale / build combination to return.
We used to return 204 - Empty Response but AS couldn't handle that initially (see bug 1428274), so we changed that to 200.
If the service returns no content, thus no snippets, no snippets should be displayed.
I read the code in AS [0] and I'm not sure whether AS will store and cache an empty array for a 204 response.
Anyways I filed an issue [1] in the snippets service to make it always return json valid responses.
[0] https://github.com/mozilla/activity-stream/blob/f40d201cfe4d67fec4ba7adc10d46c4c97924af6/lib/ASRouter.jsm#L108
[1] https://github.com/mozmeao/snippets-service/issues/888
Reporter | ||
Comment 4•6 years ago
|
||
(In reply to Ian Bicking (:ianbicking) from comment #2)
> Dao, are you still seeing this issue?
Getting neither snippets nor the error message at the moment.
Flags: needinfo?(dao+bmo)
Assignee | ||
Comment 5•6 years ago
|
||
I'm going to WONTFIX this, as the actual behavior is correct/intentional: when we get a 200 response with no body from the server, then no snippets are displayed. The only problem is the error message in browser console.
The snippets bug (https://github.com/mozmeao/snippets-service/issues/888) is fixed, and so this error shouldn't occur once that change is deployed.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Updated•6 years ago
|
Component: Activity Streams: Newtab → Messaging System
You need to log in
before you can comment on or make changes to this bug.
Description
•