Skip to content

Conversation

josephperrott
Copy link
Member

@josephperrott josephperrott commented Jul 17, 2025

Use crypto.randomUUID instead of Date.now for unique string in the tmpdir path name for a TempScopedNodeJsSyncHost to prevent naming conflicts. When performaning tests on a fast enough machine which rely on this class, two instances can be instantiated within one second and can cause failures because the path already exists that is attempted to be used. Using crypto.randomUUID should not run into this issue.

@josephperrott josephperrott requested a review from clydin July 17, 2025 18:20
@josephperrott josephperrott added area: @angular-devkit/core target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker labels Jul 17, 2025
@josephperrott josephperrott force-pushed the use-performance branch 3 times, most recently from 1c6f210 to 0cce7f4 Compare July 17, 2025 19:50
@josephperrott josephperrott changed the title fix(@angular-devkit/core): use performance.now instead of Date.now for timestamp in tmp file names fix(@angular-devkit/core): use crypto.randomUUID instead of Date.now for unique string in tmp file names Jul 17, 2025
@clydin clydin added action: merge The PR is ready for merge by the caretaker and removed action: merge The PR is ready for merge by the caretaker labels Jul 18, 2025
@ngbot

This comment was marked as outdated.

…for unique string in tmp file names

Use crypto.randomUUID instead of Date.now for unique string in the tmpdir path name for a TempScopedNodeJsSyncHost to prevent naming conflicts.
When performaning tests on a fast enough machine which rely on this class, two instances can be instantiated within one second and can
cause failures because the path already exists that is attempted to be used. Using crypto.randomUUID should not run into this issue.
@jkrems jkrems merged commit 7595e1f into angular:main Jul 18, 2025
30 checks passed
@jkrems
Copy link
Contributor

jkrems commented Jul 18, 2025

The changes were merged into the following branches: main, 20.1.x

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: @angular-devkit/core target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants