Skip to content

fix: preserve --var values as strings instead of auto-coercing to numbers#198

Merged
felipefreitag merged 4 commits intomainfrom
fix/preserve-var-strings-8e51
Apr 10, 2026
Merged

fix: preserve --var values as strings instead of auto-coercing to numbers#198
felipefreitag merged 4 commits intomainfrom
fix/preserve-var-strings-8e51

Conversation

@bukinoshita
Copy link
Copy Markdown
Member

@bukinoshita bukinoshita commented Apr 9, 2026

Summary by cubic

Preserves --var values as strings in the emails send command to stop numeric auto-coercion that corrupted IDs and OTPs. Fixes BU-624 and aligns CLI parsing with template variable types.

  • Bug Fixes
    • Always pass --var values as strings; removed Number() coercion.
    • Protects leading zeros, large IDs beyond Number.MAX_SAFE_INTEGER, and scientific notation strings.
    • Updated tests to expect strings and added edge cases.

Written for commit 7fb5822. Summary will update on new commits.

…bers

The send command's --var parser was converting any numeric-looking value
to a JavaScript number, corrupting identifiers like OTPs with leading
zeros, large IDs beyond MAX_SAFE_INTEGER, and scientific notation strings.

Remove the Number() coercion and always pass --var values as strings,
which is consistent with the template definition path where variable
types are explicitly declared.

Resolves BU-624

Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.com>
@bukinoshita
Copy link
Copy Markdown
Member Author

@cubic-dev-ai can you review?

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Apr 9, 2026

@cubic-dev-ai can you review?

@bukinoshita I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

@bukinoshita bukinoshita marked this pull request as ready for review April 10, 2026 16:18
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

@felipefreitag felipefreitag merged commit fee2478 into main Apr 10, 2026
7 checks passed
@felipefreitag felipefreitag deleted the fix/preserve-var-strings-8e51 branch April 10, 2026 18:20
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.

3 participants