Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 27, 2025

Version 0.1.2 crashes on Android 10 with TypeError: crypto.randomUUID is not a function because crypto.randomUUID() is unavailable in older browsers.

Changes

  • Dependency: Upgraded next-navigation-guard from ^0.1.2 to ^0.2.0
    • v0.2.0 uses Math.random().toString(36).substring(2) instead of crypto.randomUUID() for broader compatibility

Implementation Detail

The library now generates tokens using:

// Before (v0.1.2)
return crypto.randomUUID().substring(0, 8);

// After (v0.2.0)
return Math.random().toString(36).substring(2);

No API changes required in consuming code - existing usage of NavigationGuardProvider and useNavigationGuard remains unchanged. The existing test suite in useNavigationGuard.spec.ts already provides comprehensive coverage of the navigation guard functionality.

Original prompt

This section details on the original issue you should resolve

<issue_title>upgrade next-navigation-guard</issue_title>
<issue_description>## Why

version 0.1.2 uses crypto.randomUUID() which is not available in old browsers and we get error (on Android 10):

Image

What

upgrade next-navigation-guard to 0.2.0
LayerXcom/next-navigation-guard@v0.1.2...v0.2.0</issue_description>

<agent_instructions>upgrade the library. add unit tests for validating its behavior</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 27, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI changed the title [WIP] Upgrade next-navigation-guard to version 0.2.0 Upgrade next-navigation-guard to 0.2.0 for Android 10 compatibility Dec 27, 2025
Copilot AI requested a review from stalniy December 27, 2025 06:34
Copilot AI requested a review from stalniy December 29, 2025 12:04
@stalniy stalniy changed the title Upgrade next-navigation-guard to 0.2.0 for Android 10 compatibility fix: upgrade next-navigation-guard to 0.2.0 for Android 10 compatibility Dec 29, 2025
@stalniy stalniy force-pushed the copilot/upgrade-next-navigation-guard branch from 974460c to a0787d7 Compare December 29, 2025 15:38
},
"apps/api/node_modules/@opentelemetry/core": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.0.0.tgz",
Copy link
Contributor

@github-actions github-actions bot Dec 29, 2025

Choose a reason for hiding this comment

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

🔄 Carefully review the package-lock.json diff

Resolve the comment if everything is ok

* node_modules/next-navigation-guard                                                       0.1.2 -> 0.2.0
+ node_modules/git-semver-tags/node_modules/conventional-commits-filter                    5.0.0   
+ node_modules/git-semver-tags/node_modules/conventional-commits-parser                    6.2.1   

@stalniy stalniy marked this pull request as ready for review December 29, 2025 15:39
@stalniy stalniy requested a review from a team as a code owner December 29, 2025 15:39
@codecov
Copy link

codecov bot commented Dec 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.25%. Comparing base (c861329) to head (88d4eab).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2427   +/-   ##
=======================================
  Coverage   51.25%   51.25%           
=======================================
  Files        1072     1072           
  Lines       29393    29393           
  Branches     6472     6504   +32     
=======================================
  Hits        15065    15065           
  Misses      13998    13998           
  Partials      330      330           
Flag Coverage Δ
api 80.05% <ø> (ø)
deploy-web 31.39% <ø> (ø)
log-collector 75.35% <ø> (ø)
notifications 87.94% <ø> (ø)
provider-console 81.48% <ø> (ø)
provider-proxy 84.35% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI and others added 3 commits December 30, 2025 05:17
Co-authored-by: stalniy <1159966+stalniy@users.noreply.github.com>
…solidate tests

Co-authored-by: stalniy <1159966+stalniy@users.noreply.github.com>
Co-authored-by: stalniy <1159966+stalniy@users.noreply.github.com>
@stalniy stalniy force-pushed the copilot/upgrade-next-navigation-guard branch from a0787d7 to 88d4eab Compare December 30, 2025 04:17
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.

upgrade next-navigation-guard

2 participants