Skip to content

fix(comparator): fix change detection for schema evolution and cold starts - #2228

Merged
jcscottiii merged 1 commit into
mainfrom
jcscottiii/fix-comparator
Feb 5, 2026
Merged

fix(comparator): fix change detection for schema evolution and cold starts#2228
jcscottiii merged 1 commit into
mainfrom
jcscottiii/fix-comparator

Conversation

@jcscottiii

Copy link
Copy Markdown
Collaborator

This change fixes a bug where new browser implementation data was not triggering notifications if the feature previously had no browser data (the "Cold Start" problem). It also standardizes how optional fields are compared to support clean schema evolution.

Key Changes:

  • Comparator Logic (lib/blobtypes/v1/comparator.go):

    • Refactored compareBrowserImpls to remove an early return when the old state is unset. It now correctly detects when browser data is added for the first time.
    • Standardized all compareXYZ methods to explicitly handle the four states of OptionallySet fields: Unset/Unset (No Change), Unset/Set (Added), Set/Unset (Removed), and Set/Set (Value comparison).
    • Implemented "Quiet Rollout" logic for browsers: additions are ignored if the status is "Unavailable" and no other details (version/date) are present, reducing noise during backfills.
    • Refactored Name comparison to be robust against Unset states.
  • Documentation:

    • Added a "Guide for Adding New Fields" to comparator.go to ensure future maintainers follow the same robust comparison patterns.
    • Documented the "Quiet Rollout" and "Cold Start" philosophies.
  • Testing:

    • Added test cases to verify parent-level container additions (e.g., adding the first BrowserImplementations or BaselineStatus to a feature).
    • Verified that all transitions (Unset <-> Set) for names and baseline statuses trigger correct changes.

Base automatically changed from jcscottiii/more-details-on-unmatch to main February 5, 2026 15:54
@jcscottiii
jcscottiii force-pushed the jcscottiii/fix-comparator branch from 39ad4b8 to a41d332 Compare February 5, 2026 16:05
@jcscottiii
jcscottiii enabled auto-merge February 5, 2026 21:32
@jcscottiii
jcscottiii disabled auto-merge February 5, 2026 21:46
@jcscottiii
jcscottiii enabled auto-merge February 5, 2026 21:46
…tarts

This change fixes a bug where new browser implementation data was not triggering notifications if the feature previously had no browser data (the "Cold Start" problem). It also standardizes how optional fields are compared to support clean schema evolution.

Key Changes:
- **Comparator Logic (`lib/blobtypes/v1/comparator.go`):**
  - Refactored `compareBrowserImpls` to remove an early return when the old state is unset. It now correctly detects when browser data is added for the first time.
  - Standardized all `compareXYZ` methods to explicitly handle the four states of `OptionallySet` fields: Unset/Unset (No Change), Unset/Set (Added), Set/Unset (Removed), and Set/Set (Value comparison).
  - Implemented "Quiet Rollout" logic for browsers: additions are ignored if the status is "Unavailable" and no other details (version/date) are present, reducing noise during backfills.
  - Refactored Name comparison to be robust against Unset states.

- **Documentation:**
  - Added a "Guide for Adding New Fields" to `comparator.go` to ensure future maintainers follow the same robust comparison patterns.
  - Documented the "Quiet Rollout" and "Cold Start" philosophies.

- **Testing:**
  - Added test cases to verify parent-level container additions (e.g., adding the first `BrowserImplementations` or `BaselineStatus` to a feature).
  - Verified that all transitions (Unset <-> Set) for names and baseline statuses trigger correct changes.
@jcscottiii
jcscottiii force-pushed the jcscottiii/fix-comparator branch from a41d332 to 5b9899d Compare February 5, 2026 22:07
@jcscottiii
jcscottiii added this pull request to the merge queue Feb 5, 2026
Merged via the queue into main with commit a89c29a Feb 5, 2026
8 checks passed
@jcscottiii
jcscottiii deleted the jcscottiii/fix-comparator branch February 5, 2026 23:17
@jrobbins jrobbins mentioned this pull request Feb 6, 2026
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.

2 participants