Skip to content

fix(inject-route-fragment): return default values even when falsy - #697

Merged
eneajaho merged 1 commit into
ngxtension:mainfrom
endlacer:feature/fix-inject-route-fragment-falsy-default
Jul 3, 2026
Merged

fix(inject-route-fragment): return default values even when falsy#697
eneajaho merged 1 commit into
ngxtension:mainfrom
endlacer:feature/fix-inject-route-fragment-falsy-default

Conversation

@endlacer

@endlacer endlacer commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

defaultValue used a truthy check, so falsy defaults (0, '', false) were silently discarded and null was returned instead.

@nx-cloud

nx-cloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit caaf293

Command Status Duration Result
nx affected --target=build --parallel=3 --exclu... ✅ Succeeded 10s View ↗
nx affected --target=test --parallel=3 --exclud... ✅ Succeeded 7s View ↗
nx affected --target=lint --parallel=3 ✅ Succeeded 27s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-03 06:59:02 UTC

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request fixes an issue in injectRouteFragment where falsy default values (such as 0) were ignored and fell back to null by changing the check to verify if defaultValue is not undefined. A test case was added to verify this behavior. The reviewer noted a type safety issue in the test component where providing a numeric default value without a parser could lead to a runtime type mismatch if a string fragment is present, and suggested using a parser like numberAttribute.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@eneajaho eneajaho left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks

@eneajaho
eneajaho merged commit faddef7 into ngxtension:main Jul 3, 2026
1 check passed
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.

2 participants