chore(site): add generateConnectionSessionId helper function - #27935
Merged
Conversation
untra
reviewed
Aug 6, 2026
| * Generate a random hexadecimal string from the specified number of bytes. | ||
| */ | ||
| const generateRandomString = (bytes: number): string => { | ||
| const byteArr = crypto.getRandomValues(new Uint8Array(bytes)); |
Contributor
There was a problem hiding this comment.
getRandomValues not getRandomBytes 👍
bytes are mapped into hex characters as a string.
untra
approved these changes
Aug 6, 2026
Contributor
|
I approved this because it looked like the CI light was 🟢 , but apparently github actions was having a severe outage last night, and it's now clear no CI steps have run for this last commit. This PR has tests and the renamed functions are clear. hmu for a re-review after ci runs again |
Contributor
Author
|
@untra ready for review again! There's 1 failing check but it's an unrelated Pixel test |
untra
approved these changes
Aug 10, 2026
aslilac
reviewed
Aug 10, 2026
jeremyruppel
requested changes
Aug 10, 2026
aqandrew
marked this pull request as draft
August 10, 2026 23:41
aqandrew
marked this pull request as ready for review
August 10, 2026 23:59
jeremyruppel
approved these changes
Aug 11, 2026
jeremyruppel
left a comment
Contributor
There was a problem hiding this comment.
looks great! sorry for the bad info about Template Builder session IDs!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
generateConnectionSessionIdhelper function which reuses our existinggenerateRandomStringlogicgenerateConnectionSessionIdin utils/random.test.ts (utils/random.ts was previously untested)generateRandomStringfunction to begenerateRandomBase64Stringadditional context in #27671 (comment)
This PR doesn't change any of our UIs. The new
generateConnectionSessionIdfunction is a piece of frontend plumbing related to DEVEX-663. I originally implemented #27677 so that web terminal connections to workspaces would be identified by uuids--but according to the RFC for DEVEX-663, those connection session ids should be lowercase hexadecimal strings (not uuids).