Skip to content

Return BlobNotFound for conditional reads of missing blobs - #2809

Open
Akanksha Jain (jainakanksha-msft) with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-azure-azurite-issue-2751
Open

Akanksha Jain (jainakanksha-msft) with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-azure-azurite-issue-2751

Conversation

Copilot AI commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Azurite returned 412 ConditionNotMet for GET/download and HEAD/get-properties requests against nonexistent blobs when If-Match was set. Azure returns 404 BlobNotFound before evaluating target conditional headers.

  • Blob metadata stores
    • Updated Loki and SQL download/get-properties paths to check missing or logically uncommitted blobs before validateReadConditions.
    • Preserved conditional validation ordering for existing blobs.
if (!doc) {
  throw StorageErrorFactory.getBlobNotFound(context.contextId);
}

validateReadConditions(context, modifiedAccessConditions, doc);
  • Regression coverage

    • Added focused @loki @sql tests for GET/download and HEAD/get-properties with If-Match targeting a missing blob.
  • Release notes

    • Added an Upcoming Release Blob changelog entry for the Azure-compatible error precedence change.
Original prompt

Fix Azure/Azurite issue #2751. For GET/download and HEAD/get-properties requests targeting a nonexistent blob with If-Match, return BlobNotFound/404 before evaluating target conditional headers, matching Azure instead of returning 412. Preserve conditional behavior for existing resources and unrelated operations. Apply consistently to Loki and SQL metadata paths and add focused GET and HEAD regression tests tagged for both backends. Add Upcoming Release ChangeLog entry and run targeted tests, build, lint, and diff check. The locally validated version changed LokiBlobMetadataStore.ts, SqlBlobMetadataStore.ts, tests/blob/apis/blob.test.ts, and ChangeLog.md. Include 'Fixes #2751' in the PR body.

Copilot AI lite review requested due to automatic review settings September 24, 2026 08:38

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 wasn't able to review any files in this pull request.


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: jainakanksha-msft <181211853+jainakanksha-msft@users.noreply.github.com>
Copilot AI and others added 2 commits September 24, 2026 08:43
Co-authored-by: jainakanksha-msft <181211853+jainakanksha-msft@users.noreply.github.com>
Co-authored-by: jainakanksha-msft <181211853+jainakanksha-msft@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

Targeted tests, lint, build, and validation checks remain unverified.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: None

Copilot AI review requested due to automatic review settings September 24, 2026 08:44
@jainakanksha-msft Akanksha Jain (jainakanksha-msft) changed the title [WIP] Fix Azure/Azurite issue #2751 for conditional headers Fix missing blob If-Match precedence Sep 24, 2026
@jainakanksha-msft
Akanksha Jain (jainakanksha-msft) marked this pull request as ready for review September 24, 2026 08:45
Copilot AI changed the title Fix missing blob If-Match precedence Return BlobNotFound for conditional reads of missing blobs Sep 24, 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

🟡 Changes recommended

Targeted tests, lint, build, and validation checks remain pending.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: None

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 issues were identified, and all reviewers assessed it as ready.

Review effort: Lite
Findings: None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blob HEAD and GET return 412 instead of 404 for a missing blob with If-Match

3 participants