Closed
Bug 1256264
Opened 9 years ago
Closed 9 years ago
requestId should be a string
Categories
(WebExtensions :: Untriaged, defect)
WebExtensions
Untriaged
Tracking
(firefox48 fixed)
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: ma1, Assigned: TheOne, Mentored)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [webRequest] [good first bug])
Attachments
(2 files, 3 obsolete files)
58 bytes,
text/x-review-board-request
|
Details | |
2.73 KB,
patch
|
kmag
:
review+
|
Details | Diff | Splinter Review |
We've finally got requestId passed on every WebRequest event, but we pass an integer while in Chrome string (which appears still to be a monotonously increment integer as weel, just stringified) gets passed.
I can see the rationale behind it: if lots and lots (frankly, too many for a lifetime-long browser session) of requests are initiated, we might exhaust the 54 bits available for precise integer representation and start skipping ids, at some point in the next century or so. Hence, bonus point if you manage to make this integer potentially unlimited (i.e. a big integer), but I'd consider this fixed if we just achieve chrome compatibility by stringifying the id as it's fetched for the first time, i.e. in the RequestId.create() object.
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8730173 -
Flags: review?(kmaglione+bmo)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → awagner
Status: NEW → ASSIGNED
Reporter | ||
Comment 2•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/39753/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/39753/
Attachment #8730197 -
Flags: review?(kmaglione+bmo)
Assignee | ||
Comment 3•9 years ago
|
||
Fixed eslint errors
Attachment #8730230 -
Flags: review?(kmaglione+bmo)
Assignee | ||
Updated•9 years ago
|
Attachment #8730173 -
Attachment is obsolete: true
Attachment #8730173 -
Flags: review?(kmaglione+bmo)
Reporter | ||
Comment 4•9 years ago
|
||
Comment on attachment 8730197 [details]
MozReview Request: Bug 1256264 Make requestId a string
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/39753/diff/1-2/
Reporter | ||
Comment 5•9 years ago
|
||
Comment on attachment 8730197 [details]
MozReview Request: Bug 1256264 Make requestId a string
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/39753/diff/1-2/
Comment 6•9 years ago
|
||
Comment on attachment 8730230 [details] [diff] [review]
patch v2
Review of attachment 8730230 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/components/extensions/test/mochitest/test_ext_webrequest.html
@@ +250,5 @@
>
> + let lastRequestId = -1;
> + let lastRequestUrl = null;
> + function validateRequestIdType(currentId) {
> + browser.test.assertTrue(typeof lastRequestId === "string");
`browser.test.assertEq("string", typeof(lastRequestId), ...)` Same for the tests below.
Please also include a description of each test, or the test output is going to be difficult to follow.
@@ +252,5 @@
> + let lastRequestUrl = null;
> + function validateRequestIdType(currentId) {
> + browser.test.assertTrue(typeof lastRequestId === "string");
> + browser.test.assertTrue(typeof currentId === "string");
> + browser.test.assertTrue(typeof parseInt(currentId, 10) === "number");
This will always be true. Do you mean `!isNaN(...)`?
@@ +253,5 @@
> + function validateRequestIdType(currentId) {
> + browser.test.assertTrue(typeof lastRequestId === "string");
> + browser.test.assertTrue(typeof currentId === "string");
> + browser.test.assertTrue(typeof parseInt(currentId, 10) === "number");
> + browser.test.assertTrue(parseInt(lastRequestId, 10) !== parseInt(currentId, 10));
Why do you need parseInt here?
@@ +264,5 @@
> + lastRequestUrl = details.url;
> + lastRequestId = details.requestId;
> + } else if (lastRequestUrl != details.url) {
> + validateRequestIdType(details.requestId);
> + }
Why these changes?
::: toolkit/modules/addons/WebRequest.jsm
@@ +43,5 @@
> var RequestId = {
> count: 1,
> KEY: "mozilla.webRequest.requestId",
> create(channel = null) {
> + let id = (this.count++).toString();
`String(this.count++)`
Attachment #8730230 -
Flags: review?(kmaglione+bmo)
Assignee | ||
Comment 7•9 years ago
|
||
Updated according to the comments, the open questions have been discussed and resolved in-person.
Attachment #8730267 -
Flags: review?(kmaglione+bmo)
Assignee | ||
Updated•9 years ago
|
Attachment #8730230 -
Attachment is obsolete: true
Updated•9 years ago
|
Attachment #8730267 -
Flags: review?(kmaglione+bmo) → review+
Updated•9 years ago
|
Attachment #8730197 -
Flags: review?(kmaglione+bmo)
Assignee | ||
Comment 8•9 years ago
|
||
Assignee | ||
Comment 9•9 years ago
|
||
Assignee | ||
Comment 10•9 years ago
|
||
Sorry for the noise, v4 failed some eslint tests which I didn't realize until after the review.
Attachment #8731113 -
Flags: review?(kmaglione+bmo)
Assignee | ||
Updated•9 years ago
|
Attachment #8730267 -
Attachment is obsolete: true
Updated•9 years ago
|
Attachment #8731113 -
Flags: review?(kmaglione+bmo) → review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 11•9 years ago
|
||
Keywords: checkin-needed
Comment 12•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Updated•6 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•