Skip to content

[Images] Read a non-object .NET release index as invalid response - #589

Merged
LarsLaskowski merged 15 commits into
mainfrom
claude/admiring-sagan-njkqq9
Nov 28, 2026
Merged

LarsLaskowski merged 15 commits into
mainfrom
claude/admiring-sagan-njkqq9

Conversation

@LarsLaskowski

@LarsLaskowski LarsLaskowski commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Pull Request

📖 Description

A .NET release index whose root is not a JSON object (an array, string, number, true, false or null) made DotNetReleaseMetadataService throw InvalidOperationException, which was reported as unexpected error, while the Docker Engine, registry and Docker Hub clients answer invalid response for the same body. The index is now parsed with RemoteJsonDocument.ParseObjectAsync, so a non-object root and a string that does not decode both read invalid response. An entry of releases-index that is not a JSON object is left out, as every other client does, instead of failing the whole index. This is a bug fix; no message, log event or API member is added.

🎫 Issues

💬 Reviewer Notes

The production change is two statements in LoadIndexAsync (src/DockerUpdateGuard/Images/DotNetReleaseMetadataService.cs). One trade-off is recorded in 0076: a string that does not decode in a field the service never reads now fails the whole index, where before it was harmless. Area documents integration-failures.md, base-images.md and telemetry.md are updated.

📑 Test Plan

Unit tests in DotNetReleaseMetadataServiceTests.cs: a non-object root (six kinds) answers invalid response and logs the fixed refusal (AC1), an undecodable string in a read and an unread field answers invalid response (AC2), and a non-object entry is left out beside a valid one (AC3). The new tests failed on the old code. Coverage of the changed lines is 100 % (3/3 lines, 2/2 conditions).

Criterion Verification Result
AC1 unit pass
AC2 unit pass
AC3 unit pass

✅ Checklist

  • I have added or updated Unit Tests for the change.
  • I have tested my changes.
  • I have run Format and Build from .squad/stack.md, and the Analyzer gate reports no diagnostic in a changed file.
  • The Coverage gate in .squad/stack.md passes (new or changed production code with the branch conditions its report records, line coverage overall).
  • I have updated the project documentation (README.md, ARCHITECTURE.md) and the area document of every changed behavior to reflect my changes.
  • Each decision with lasting weight has its decision record, committed with the change.
  • I have read the CONTRIBUTING documentation and followed the project's code style guidelines.
  • New dependencies, if any, were added the way Dependencies in .squad/stack.md prescribes.
  • The PR carries its release-notes label (CONTRIBUTING); a change that breaks existing users carries breaking-change and says so in the Description.
  • The C# rules in csharp.instructions.md are followed.

⏭ Next Steps

None.

@LarsLaskowski LarsLaskowski added the bug Something isn't working label Nov 28, 2026 — with Claude
@sonarqubecloud

Copy link
Copy Markdown

@LarsLaskowski
LarsLaskowski marked this pull request as ready for review November 28, 2026 16:42
@LarsLaskowski
LarsLaskowski merged commit 77f9f47 into main Nov 28, 2026
7 checks passed
@LarsLaskowski
LarsLaskowski deleted the claude/admiring-sagan-njkqq9 branch November 28, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Images] A .NET release index whose root is not a JSON object reads unexpected error

2 participants