Closed
Bug 1218746
Opened 9 years ago
Closed 9 years ago
Suppress "ERROR ClientID::getCachedClientID - invalid client id in preference" on fresh profiles
Categories
(Toolkit :: Telemetry, defect, P3)
Toolkit
Telemetry
Tracking
()
RESOLVED
FIXED
mozilla45
People
(Reporter: Dexter, Assigned: hanue, Mentored)
References
(Blocks 1 open bug)
Details
(Whiteboard: [measurement:client][lang=js][good first bug])
Attachments
(1 file, 2 obsolete files)
912 bytes,
patch
|
gfritzsche
:
review+
Dexter
:
feedback+
|
Details | Diff | Splinter Review |
Since bug 1186488 landed, when creating a new profile or starting Firefox for the first time, this error appears in the browser console: "Toolkit.Telemetry ERROR ClientID::getCachedClientID - invalid client id in preferences, resetting: null" This is happening because we're checking for the cached clientID validity even when it is null [0]. To fix this, in [0], just after |let id = Preferences...|, we should check if the id is null and explicitly return null. To check if this works, start Firefox with a fresh profile and check that the error message is no longer present in the browser console. Moreover, we should also run other xpcshell tests to make sure nothing breaks: ./mach xpcshell-test toolkit/components/telemetry [0] - https://dxr.mozilla.org/mozilla-central/rev/6c7c983bce46a460c2766fbdd73283f6d2b03a69/toolkit/modules/ClientID.jsm#177
Reporter | ||
Updated•9 years ago
|
Blocks: 1201022
Points: --- → 1
Priority: -- → P4
Whiteboard: [measurement:client][lang=js][good first bug]
Updated•9 years ago
|
Priority: P4 → P3
Assignee | ||
Comment 1•9 years ago
|
||
Hello! Please find attached my patch for this bug.
Attachment #8684409 -
Flags: review?(alessio.placitelli)
Reporter | ||
Updated•9 years ago
|
Assignee: nobody → hanue
Status: NEW → ASSIGNED
Reporter | ||
Comment 2•9 years ago
|
||
Comment on attachment 8684409 [details] [diff] [review] rev1 - Invalid ClientID Fix in ClientID.jsm Review of attachment 8684409 [details] [diff] [review]: ----------------------------------------------------------------- Hi Eduard, thank you for submitting your patch! ::: toolkit/modules/ClientID.jsm @@ +173,5 @@ > } > > // Not yet loaded, return the cached client id if we have one. > let id = Preferences.get(PREF_CACHED_CLIENTID, null); > + if (id == null) { The |if(!isValidClientID(..))| part should not be removed. Instead, we should add a new if to strictly check ("===") that id is null and, if that's the case, we should return null instead of going on with the next isValidClientID check.
Attachment #8684409 -
Flags: review?(alessio.placitelli)
Assignee | ||
Comment 3•9 years ago
|
||
Hello Alessio! Sorry for the misunderstanding. Please find attached my updated patch.
Attachment #8684596 -
Flags: review?(alessio.placitelli)
Reporter | ||
Updated•9 years ago
|
Attachment #8684409 -
Attachment is obsolete: true
Reporter | ||
Comment 4•9 years ago
|
||
Comment on attachment 8684596 [details] [diff] [review] rev2 - Invalid ClientID Fix in ClientID.jsm Review of attachment 8684596 [details] [diff] [review]: ----------------------------------------------------------------- We're almost there Eduard! Thank you for posting the updated patch. This looks good, there are just a couple of minor stylistic changes left. ::: toolkit/modules/ClientID.jsm @@ +173,5 @@ > } > > // Not yet loaded, return the cached client id if we have one. > let id = Preferences.get(PREF_CACHED_CLIENTID, null); > + if (id === null) { We don't use tabs for the indentation: please use 2 spaces per logic level as described in the Coding Style guide here: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Indentation @@ +176,5 @@ > let id = Preferences.get(PREF_CACHED_CLIENTID, null); > + if (id === null) { > + return null; > + } > + else if (!isValidClientID(id)) { Since we're returning in the previous if branch, we can drop the |else| here and just go to a new line with the |if (!isValidClientID(id)) {|. For more info, see: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#General_C.2FC.2B.2B_Practices
Attachment #8684596 -
Flags: review?(alessio.placitelli) → feedback+
Assignee | ||
Comment 5•9 years ago
|
||
No problem, Alessio. You will find attached my latest patch with the necessary indentation and separate if statement changes.
Attachment #8685180 -
Flags: review?(alessio.placitelli)
Reporter | ||
Updated•9 years ago
|
Attachment #8684596 -
Attachment is obsolete: true
Reporter | ||
Comment 6•9 years ago
|
||
Comment on attachment 8685180 [details] [diff] [review] rev3 - Invalid ClientID Fix in ClientID.jsm Review of attachment 8685180 [details] [diff] [review]: ----------------------------------------------------------------- Thanks Eduard, this looks good now. Just a small suggestion: whenever you submit an updated revision of the patch, be sure to mark the old revision as obsolete, as it may create confusion to have all those patches attached to the bug. I'm moving the review to :gfritzsche. ::: toolkit/modules/ClientID.jsm @@ +175,5 @@ > // Not yet loaded, return the cached client id if we have one. > let id = Preferences.get(PREF_CACHED_CLIENTID, null); > + if (id === null) { > + return null; > + } Nit: I would personally add a newline after this line, but it's a matter of taste.
Attachment #8685180 -
Flags: review?(gfritzsche)
Attachment #8685180 -
Flags: review?(alessio.placitelli)
Attachment #8685180 -
Flags: feedback+
Comment 7•9 years ago
|
||
Comment on attachment 8685180 [details] [diff] [review] rev3 - Invalid ClientID Fix in ClientID.jsm Review of attachment 8685180 [details] [diff] [review]: ----------------------------------------------------------------- Thanks!
Attachment #8685180 -
Flags: review?(gfritzsche) → review+
Reporter | ||
Comment 8•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7245388ffad7
Reporter | ||
Comment 9•9 years ago
|
||
Eduard, I've pushed the patch to the try servers. We'll land this as soon as the tests are complete!
Assignee | ||
Comment 10•9 years ago
|
||
Great news! Thank you, Alessio!
Reporter | ||
Comment 11•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/235ea6e281382979a28349b438ea70689f21ad38 Bug 1218746 - Invalid ClientID Fix in ClientID.jsm. r=gfritzsche
Reporter | ||
Comment 12•9 years ago
|
||
Good news Eduard: the test failures look unrelated, so I've pushed this for you on fx-team. If all the tests pass, this will be merged soon!
Comment 13•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/235ea6e28138
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in
before you can comment on or make changes to this bug.
Description
•