Closed Bug 1334513 Opened 5 years ago Closed 5 years ago

Make sure Keyed Scalars APIs don't allow empty keys

Categories

(Toolkit :: Telemetry, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: Dexter, Assigned: Dexter)

References

(Blocks 1 open bug)

Details

(Whiteboard: [measurement:client])

Attachments

(1 file, 1 obsolete file)

We have to make sure that we're not allowing to store keyed scalrs with empty keys.
Assignee: nobody → alessio.placitelli
Blocks: 1275517
Priority: -- → P1
Whiteboard: [measurement:client]
Attached patch bug1334513.patch (obsolete) — Splinter Review
This patch makes the scalars print an error if an empty key is provided when changng keyed scalars.
Attachment #8831622 - Flags: review?(gfritzsche)
Status: NEW → ASSIGNED
Comment on attachment 8831622 [details] [diff] [review]
bug1334513.patch

Review of attachment 8831622 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/components/telemetry/TelemetryScalar.cpp
@@ +819,5 @@
>      case ScalarResult::StringTooLong:
>        errorMessage.Append(NS_LITERAL_STRING(" - Truncating scalar value to 50 characters."));
>        break;
> +    case ScalarResult::InvalidKeyLength:
> +      errorMessage.Append(NS_LITERAL_STRING(" - The key must not be empty and must be limited to 70 characters."));

I think we should have two distinct error messages here.
Attachment #8831622 - Flags: review?(gfritzsche) → feedback+
Attached patch bug1334513.patchSplinter Review
Attachment #8831622 - Attachment is obsolete: true
Attachment #8832032 - Flags: review?(gfritzsche)
Attachment #8832032 - Flags: review?(gfritzsche) → review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fbe43964eb8d
Make sure Keyed Scalars APIs don't allow empty keys. r=gfritzsche
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/fbe43964eb8d
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.