Closed Bug 806591 Opened 8 years ago Closed 8 years ago

Add function to generate UUIDs

Categories

(Cloud Services :: Firefox: Common, defect)

defect
Not set
normal

Tracking

(firefox18 fixed, firefox19 fixed, firefox20 fixed)

RESOLVED FIXED
mozilla20
Tracking Status
firefox18 --- fixed
firefox19 --- fixed
firefox20 --- fixed

People

(Reporter: gps, Assigned: gps)

Details

Attachments

(1 file)

Add CommonUtils.generateUUID().
Attachment #676361 - Flags: review?(rnewman)
Comment on attachment 676361 [details] [diff] [review]
Add CommonUtils.generateUUID()

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

::: services/common/tests/unit/test_utils_uuid.js
@@ +5,5 @@
> +
> +function run_test() {
> +  let uuid = CommonUtils.generateUUID();
> +  do_check_eq(uuid.length, 36);
> +  do_check_eq(uuid[8], "-");

Your function comment says "with no extra characters". One of you is lying :D

::: services/common/utils.js
@@ +472,5 @@
> +   * Generate a new UUID.
> +   *
> +   * Returns a hex-formatted UUID string with no extra characters (like {}).
> +   *
> +   * @return string

This comment should probably be:

  Generate a new UUID using nsiUUIDGenerator, removing extraneous
  characters such as [{}].

  Example: "..."

  @return (string) a hex-formatted UUID string.

::: services/healthreport/service.jsm
@@ +115,5 @@
>      // TODO pull namespace from prefs
>      // TODO Generate UUID for ID
>      // TODO delete old ID if present.
> +    let promise = client.uploadJSON("healthreport", "foobar",
> +                                    this._getJSONPayload());

Pretty sure this snuck in by mistake.
Attachment #676361 - Flags: review?(rnewman) → review+
https://hg.mozilla.org/projects/larch/rev/fb3d94492902
Status: NEW → ASSIGNED
Whiteboard: [fixed-in-larch]
Comment on attachment 676361 [details] [diff] [review]
Add CommonUtils.generateUUID()

Bulk-setting approval flags for FHR landing for FxOS ADU ping (Bug 788894).
Attachment #676361 - Flags: approval-mozilla-beta?
Attachment #676361 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/integration/mozilla-inbound/rev/86b0762e70ed
Assignee: nobody → gps
Whiteboard: [fixed-in-larch]
Target Milestone: --- → mozilla20
https://hg.mozilla.org/mozilla-central/rev/86b0762e70ed
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Comment on attachment 676361 [details] [diff] [review]
Add CommonUtils.generateUUID()

FHR for B2G ADU ping, won't be built/enabled for Mobile/Desktop.
Attachment #676361 - Flags: approval-mozilla-beta?
Attachment #676361 - Flags: approval-mozilla-beta+
Attachment #676361 - Flags: approval-mozilla-aurora?
Attachment #676361 - Flags: approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.