Skip to content

Refactor UUID generation to use RAL.crypto.randomUUID() - #1893

Merged
Dirk Bäumer (dbaeumer) merged 1 commit into
mainfrom
dbaeumer/coloured-armadillo-bronze
Oct 16, 2026
Merged

Dirk Bäumer (dbaeumer) merged 1 commit into
mainfrom
dbaeumer/coloured-armadillo-bronze

Conversation

@dbaeumer

Copy link
Copy Markdown
Member

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.

- 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.
@dbaeumer
Dirk Bäumer (dbaeumer) enabled auto-merge (squash) October 16, 2026 16:24
Copilot AI balanced review requested due to automatic review settings October 16, 2026 16:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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.

@dbaeumer
Dirk Bäumer (dbaeumer) merged commit 8ab2603 into main Oct 16, 2026
9 checks passed
@dbaeumer
Dirk Bäumer (dbaeumer) deleted the dbaeumer/coloured-armadillo-bronze branch October 16, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants