Name dropping build metadata unvalidated as a semver concession - #7502
Merged
Conversation
Raised in review on the Android port: everything from the first + on is discarded without being checked, so "1.0.0++junk" compares as "1.0.0". That is intended, but it sat outside the list of concessions and read as an oversight. A fixture now pins it. Co-authored-by: Cursor <cursoragent@cursor.com>
ajpallares
added a commit
to RevenueCat/purchases-android
that referenced
this pull request
Aug 25, 2026
Raised in review: everything from the first + on is discarded without being checked, so "1.0.0++junk" compares as "1.0.0". That is intended, but it sat outside the list of concessions and read as an oversight. A fixture now pins it. iOS counterpart: RevenueCat/purchases-ios#7502. Co-authored-by: Cursor <cursoragent@cursor.com>
ajpallares
marked this pull request as ready for review
August 25, 2026 10:53
rickvdl
approved these changes
Aug 25, 2026
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.
Checklist
purchases-androidand hybridsMotivation
Raised reviewing the Android port, RevenueCat/purchases-android#4077:
rc.semverComparediscards everything from the first+on without checking it, so"1.0.0++junk"compares as"1.0.0". That is intended, but it sat outside the documented list of concessions and read as an oversight.Description
The doc now counts it as the third concession, alongside partial versions and leading zeros, and a fixture pins it.
Behavior is unchanged.
Note
Low Risk
Comment and test-only change;
rc.semverCompareruntime behavior is unchanged.Overview
Documents and tests an existing
rc.semverComparebehavior—no parsing or comparison logic changes.The
SemanticVersiondoc comment now lists a third real-world concession: everything from the first+is stripped for precedence without validating build metadata (e.g."1.0.0++not a valid identifier"still compares as"1.0.0"). That matches the existingprefix { $0 != "+" }parsing, which was already implied by §10 but easy to read as an oversight when porting.A predicate fixture
semver_build_metadata_is_dropped_unvalidatedpins that case, and the fixture suite count is bumped 518 → 519.Reviewed by Cursor Bugbot for commit 13caee5. Bugbot is set up for automated code reviews on this repo. Configure here.