Page MenuHomePhabricator

mw.user.generateRandomSessionId should return a UUID
Open, MediumPublic


Session IDs created by mw.user.generateRandomSessionId currently take the form of a random 80-bit hex integer. To better conform to industry standards and support cross-platform consistency, mw.user.generateRandomSessionId should instead return a v4 (random) UUID.

mw.user.generateRandomSessionId should be left in place to support its many existing consumers but should be updated to call out to a new mw.user.generateUUIDv4 method rather than employing a custom ID generation algorithm.

Existing consumers shouldn't be relying on the ID format, but it's always possible that they are, so the change should be announced in advance.

Proposed migration plan:

  • Announce the planned change on wikitech-l
  • Create a a new mw.user.generateUUIDv4 method leveraging the uuid library
  • Update affected schemas to accept UUIDs where the current format is expected
  • Update mw.user.generateRandomSessionId to call mw.user.generateUUIDv4 internally
  • Update impacted EP instruments to produce events according to the updated schema versions

Open questions:

  • Are only Event Platform schemas affected? Legacy EL schemas probably don't support pattern-based field data validation, but we should double-check this.

Event Timeline

Restricted Application added a project: Analytics. · View Herald TranscriptOct 29 2020, 5:05 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Mholloway updated the task description. (Show Details)Oct 29 2020, 5:09 PM
sdkim assigned this task to Mholloway.Nov 2 2020, 4:27 PM
sdkim triaged this task as Medium priority.
sdkim moved this task from Inbox to Next on the Product-Data-Infrastructure board.
sdkim added a project: Better Use Of Data.
sdkim added a subscriber: sdkim.
sdkim moved this task from Inbox to To Do on the Better Use Of Data board.Nov 2 2020, 4:34 PM
razzi edited projects, added Analytics-Radar; removed Analytics.Nov 4 2020, 5:39 PM
sdkim moved this task from To Do to Backlog on the Better Use Of Data board.Jan 5 2021, 8:43 PM
Mholloway removed Mholloway as the assignee of this task.Jan 22 2021, 7:58 PM
Mholloway updated the task description. (Show Details)Tue, Feb 16, 5:28 PM