Validate Table Edm.Int64 writes and preserve legacy reads - #2805
Conversation
Validate Table Edm.Int64 values with exact signed 64-bit bounds and add unit and REST regression coverage for issue #2558. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the range regression coverage in a focused REST test suite. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Address legacy persisted-value compatibility and add the required changelog entry.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Fixes Table Edm.Int64 validation using exact signed 64-bit range checks.
Changes:
- Added
BigIntboundary validation while preserving string serialization. - Added unit and REST coverage for valid, invalid, and overflow values.
- Reports Azure-compatible
400 InvalidInputbehavior.
| File | Summary |
|---|---|
tests/table/unit/EdmInt64.unit.test.ts |
Tests boundaries, overflow, underflow, and invalid formats. |
tests/table/apis/table.entity.int64.rest.test.ts |
Verifies REST validation responses. |
src/table/entity/EdmInt64.ts |
Implements signed 64-bit range validation. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Move the unit and REST cases into the existing serialization and validation suites. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
aa5ee0e to
bc5c42a
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Legacy-read compatibility, REST error-path coverage, and the required changelog entry remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Preserve reads of legacy out-of-range values, expand REST write coverage, and document the behavior change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Add handler-level read-path regression coverage and correct the documented targeted test command.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
Seed a pre-validation value directly in Table metadata and verify both entity read handlers preserve it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>


Summary
Azure Table Storage accepts only signed 64-bit values for
Edm.Int64, but Azurite previously accepted any string, includingulong.MaxValue. This allowed local writes that later failed against Azure with400 InvalidInput.This change:
Edm.Int64as a decimal integer within the signed 64-bit range on insert, update, and merge pathsBigIntfor exact boundary checks without changing the persisted string representation400 InvalidInputresponses for underflow, overflow, andulong.MaxValueFixes #2558
Compatibility and test coverage
ulong.MaxValue400 InvalidInputValidation
npx mocha --require ts-node/register --no-timeouts --exit tests/table/unit/serialization.unit.test.ts NODE_TLS_REJECT_UNAUTHORIZED=0 npx mocha --require ts-node/register --no-timeouts --grep "signed Edm.Int64 range|legacy out-of-range Edm.Int64" --exit tests/table/apis/table.validation.rest.test.ts npm run lint npm run buildCI note
The linked upgrade compatibility run ran against
mainat unrelated commit25c459a, not this PR's head. Its Table upgrade compatibility tests passed on Ubuntu and Windows. The run failed because the VSIX job timed out connecting to the Marketplace while resolving the published version (ETIMEDOUT/ENETUNREACH), and the Windows Blob upgrade setup exceeded its 600-second hook timeout. These failures are unrelated to the Table changes in this PR.