Skip to content

issue/483 malformed stored version can permanently break c - #489

Merged
prestoncabe merged 4 commits into
mainfrom
issue/483-malformed-stored-version-can-permanently-break-c
Sep 4, 2026
Merged

issue/483 malformed stored version can permanently break c#489
prestoncabe merged 4 commits into
mainfrom
issue/483-malformed-stored-version-can-permanently-break-c

Conversation

@prestoncabe

@prestoncabe prestoncabe commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

closes #483

  • fix: ignore malformed published check versions
  • fix: keep a malformed version from breaking the check list
  • fix: reject stored versions that only look like versions
  • fix: skip published versions whose document id is taken

prestoncabe and others added 4 commits September 3, 2026 20:12
The published check list parsed stored versions with a bare Integer.parseInt,
so a single corrupt version field made GET /api/custom-checks fail with a 500
for every check the user owns, with no way to recover through the API.

Move version parsing into CheckVersion, shared by the publish path and the
read path, and order unreadable versions below readable ones instead of
throwing out of the comparison.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019VpGMR8VeD27SgrfNeWiUr
Java drops trailing empty parts when splitting, so "." and "..." split into no
parts at all: the parse loop never ran and the value was accepted as 0.0.0
rather than ignored as corrupt data.

Require one to three non-negative numeric parts, which also rejects negative
and over-long versions instead of silently reading the first three parts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019VpGMR8VeD27SgrfNeWiUr
A published document id is derived from the version, and Firestore refuses to
create an id that already exists. Ignoring a corrupt version field therefore
left publishing broken for good: the corrupt version dropped out of the maximum,
the next version landed back on an id an existing document already held, and
every retry failed the same way.

Compare each candidate against the ids the published documents actually carry,
which is the only remaining record of a version whose field was corrupted later,
and increment past the ones already taken. A corrupt working version now starts
at the initial version instead of being published as-is and carrying the
corruption into a new id.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019VpGMR8VeD27SgrfNeWiUr
@prestoncabe
prestoncabe force-pushed the issue/483-malformed-stored-version-can-permanently-break-c branch from c6f7b83 to 9d9f01a Compare September 4, 2026 00:17
@prestoncabe
prestoncabe merged commit 322cf95 into main Sep 4, 2026
3 checks passed
@prestoncabe
prestoncabe deleted the issue/483-malformed-stored-version-can-permanently-break-c branch September 4, 2026 00:35
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.

Malformed stored version can permanently break custom check publish with an opaque 500

1 participant