issue/483 malformed stored version can permanently break c - #489
Merged
prestoncabe merged 4 commits intoSep 4, 2026
Merged
Conversation
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
force-pushed
the
issue/483-malformed-stored-version-can-permanently-break-c
branch
from
September 4, 2026 00:17
c6f7b83 to
9d9f01a
Compare
prestoncabe
deleted the
issue/483-malformed-stored-version-can-permanently-break-c
branch
September 4, 2026 00:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #483