Skip to content

Validate Table Edm.Int64 writes and preserve legacy reads - #2805

Merged
Akanksha Jain (jainakanksha-msft) merged 5 commits into
mainfrom
fix/2558-edm-int64-range
Sep 23, 2026
Merged

Akanksha Jain (jainakanksha-msft) merged 5 commits into
mainfrom
fix/2558-edm-int64-range

Conversation

@jainakanksha-msft

@jainakanksha-msft Akanksha Jain (jainakanksha-msft) commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Azure Table Storage accepts only signed 64-bit values for Edm.Int64, but Azurite previously accepted any string, including ulong.MaxValue. This allowed local writes that later failed against Azure with 400 InvalidInput.

This change:

  • validates Edm.Int64 as a decimal integer within the signed 64-bit range on insert, update, and merge paths
  • uses BigInt for exact boundary checks without changing the persisted string representation
  • returns Azure-compatible 400 InvalidInput responses for underflow, overflow, and ulong.MaxValue
  • preserves GET and collection-query access to out-of-range values persisted by earlier Azurite versions
  • documents the behavior change in the upcoming Table release notes

Fixes #2558

Compatibility and test coverage

  • unit coverage for signed boundaries, values beyond JavaScript's safe-integer range, malformed values, underflow, overflow, and ulong.MaxValue
  • insert and upsert REST coverage for 400 InvalidInput
  • handler-level legacy metadata coverage through both single-entity and collection-query REST paths
  • Table PR checks pass across Ubuntu, Windows, and macOS on Node.js 22, 24, and 26

Validation

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 build

CI note

The linked upgrade compatibility run ran against main at unrelated commit 25c459a, 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.

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>
Copilot AI lite review requested due to automatic review settings September 23, 2026 07:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Fixes Table Edm.Int64 validation using exact signed 64-bit range checks.

Changes:

  • Added BigInt boundary validation while preserving string serialization.
  • Added unit and REST coverage for valid, invalid, and overflow values.
  • Reports Azure-compatible 400 InvalidInput behavior.
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.

Comment thread src/table/entity/EdmInt64.ts
Comment thread src/table/entity/EdmInt64.ts
Move the unit and REST cases into the existing serialization and validation suites.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Unresolved validation, legacy-read, serialization-coverage, and release-note issues remain.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 Medium severity · 1 Low severity

Open (3)

Comment thread tests/table/unit/serialization.unit.test.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Legacy-read compatibility, changelog coverage, and the documented test command remain unresolved.

Review effort: Lite
Findings: 2 Medium severity · 1 Low severity

Open (3)

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 Medium severity · 1 Low severity

Open (2)
Resolved since last review (3)

Comment thread src/table/handlers/TableHandler.ts
Comment thread tests/table/unit/serialization.unit.test.ts
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>
Copilot AI review requested due to automatic review settings September 23, 2026 11:31
@jainakanksha-msft Akanksha Jain (jainakanksha-msft) changed the title Fix Edm.Int64 range validation Validate Table Edm.Int64 writes and preserve legacy reads Sep 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified.

Review effort: Lite
Findings: None

Resolved since last review (2)

@jainakanksha-msft
Akanksha Jain (jainakanksha-msft) merged commit dd401c5 into main Sep 23, 2026
46 checks passed
@jainakanksha-msft
Akanksha Jain (jainakanksha-msft) deleted the fix/2558-edm-int64-range branch September 23, 2026 12:22
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.

[BUG] Azurite Table Emulator accepts ulong.MaxValue but Azure does not

2 participants