'cfx docs' /api/idle handler throws silent exception, resets timer anyways

RESOLVED FIXED in 1.0

Status

Add-on SDK
Documentation
P2
minor
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: warner, Assigned: wbamberg)

Tracking

unspecified

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
Created attachment 515696 [details] [diff] [review]
don't throw exception in the /api/idle handler

A combination of bugs is causing a minor error in the 'cfx docs' server, then failing to actually break anything. But it'd be nice to clean up.

The WSGI webserver thread started by 'cfx docs' is supposed to exit as soon as the user closes the docs-viewing tab which it auto-opened. To accomplish this, the server terminates after 60 seconds of no requests, and the frontend javascript code does an idle ping (a GET to /api/idle) every 5 seconds.

"Cork" on IRC noticed that the docs server shuts down surprisingly if you have JS disabled in the browser (we could stand to have a warning about that, but that's not the purpose of this ticket). In the process of discovering that, I noticed that doing a GET of /api/idle actually throws an exception and returns a 500 "internal server error". The frontend code stops pinging if it sees a 501 or 404. So the exception would have caused the frontend to stop pinging (and thus the server to stop running before the tab was closed, and thus be an actual bug), except that 500!=501. Oh, and the exception isn't logged, because the server is normally run in "quiet" mode.

The attached patch fixes the exception.
(Assignee)

Updated

7 years ago
Assignee: warner-bugzilla → nobody
Component: General → Documentation
QA Contact: general → documentation
(Assignee)

Comment 1

7 years ago
Thanks for this fix Brian. It looks good to me, shall I just apply it and close the bug?
Priority: -- → P2
Target Milestone: --- → 1.0
(Assignee)

Updated

7 years ago
Assignee: nobody → wbamberg
(Reporter)

Comment 2

7 years ago
sounds good by me. thanks!
(Assignee)

Comment 3

7 years ago
Fixed by: https://github.com/mozilla/addon-sdk/commit/f85ee223b9f86b0102c1733b85b8774b27a74411
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.