Repository navigation
Refactor UUID generation to use RAL.crypto.randomUUID() - #1893
Merged
Merged
Conversation
- Removed the UUID utility module and its references across the codebase. - Updated all instances of UUID generation to use RAL().crypto.randomUUID() for consistency and improved security. - Ensured compatibility with both Node.js and browser environments for UUID generation. - Added tests for randomUUID functionality in both Node and browser contexts.
There was a problem hiding this comment.
🔵 Needs a closer look
Cross-package runtime and typing compatibility still needs Node.js and browser build/test verification.
0 open findings
What changed in this PR
Centralizes client and server UUID generation in the runtime abstraction layer, replacing duplicated utilities with cryptographically secure implementations.
Changes:
- Adds Node.js UUID generation and a browser implementation with a secure fallback.
- Migrates registration IDs and progress tokens to the shared API.
- Adds regression tests, fixes partial buffer reads, and updates Node.js requirements and typings.
| File | Description |
|---|---|
| server/src/common/utils/uuid.ts | Removes legacy UUID utility. |
| server/src/common/server.ts | Migrates registration IDs. |
| server/src/common/progress.ts | Migrates progress tokens. |
| jsonrpc/src/node/test/ral.test.ts | Tests UUIDs and partial buffer reads. |
| jsonrpc/src/node/ril.ts | Adds native UUIDs; fixes buffer slicing. |
| jsonrpc/src/common/ral.ts | Defines shared crypto capability. |
| jsonrpc/src/browser/test/test.ts | Tests native and fallback UUID generation. |
| jsonrpc/src/browser/ril.ts | Implements browser UUID generation. |
| jsonrpc/README.md | Documents runtime requirements and crypto API. |
| jsonrpc/package.json | Updates Node.js minimum and typings. |
| jsonrpc/package-lock.json | Synchronizes dependency metadata. |
| client/src/common/workspaceSymbol.ts | Migrates symbol registration IDs. |
| client/src/common/workspaceFolder.ts | Migrates folder registration IDs. |
| client/src/common/utils/uuid.ts | Removes legacy UUID utility. |
| client/src/common/textSynchronization.ts | Migrates synchronization registration IDs. |
| client/src/common/textDocumentContent.ts | Migrates content registration IDs. |
| client/src/common/signatureHelp.ts | Migrates signature-help registration IDs. |
| client/src/common/rename.ts | Migrates rename registration IDs. |
| client/src/common/reference.ts | Migrates reference registration IDs. |
| client/src/common/notebook.ts | Migrates notebook registration IDs. |
| client/src/common/inlineCompletion.ts | Migrates inline-completion registration IDs. |
| client/src/common/hover.ts | Migrates hover registration IDs. |
| client/src/common/formatting.ts | Migrates formatting registration IDs. |
| client/src/common/fileOperations.ts | Migrates file-operation registration IDs. |
| client/src/common/features.ts | Migrates shared feature registration IDs. |
| client/src/common/executeCommand.ts | Migrates command registration IDs. |
| client/src/common/documentSymbol.ts | Migrates document-symbol registration IDs. |
| client/src/common/documentLink.ts | Migrates document-link registration IDs. |
| client/src/common/documentHighlight.ts | Migrates highlight registration IDs. |
| client/src/common/diagnostic.ts | Migrates diagnostic progress tokens. |
| client/src/common/definition.ts | Migrates definition registration IDs. |
| client/src/common/configuration.ts | Migrates configuration registration IDs. |
| client/src/common/completion.ts | Migrates completion registration IDs. |
| client/src/common/codeLens.ts | Migrates CodeLens registration IDs. |
| client/src/common/codeAction.ts | Migrates code-action registration IDs. |
| client/src/common/client.ts | Migrates initialization tokens and watcher IDs. |
Files not reviewed (1)
- jsonrpc/package-lock.json: Generated file
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Henning Dieterichs (hediet)
approved these changes
Oct 16, 2026
Connor Peet (connor4312)
approved these changes
Oct 16, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replace the existing UUID utility with RAL.crypto.randomUUID() for improved security and consistency across the codebase. Ensure compatibility with both Node.js and browser environments, and add tests for the new functionality. Update the Node.js version requirement to 14.17.0 or newer.