fix: remember exact release highlight acknowledgements

Merged
SU
2mo ago
+130-18

Summary

Fix repeated What's new popups after dismissing a hotfix such as v0.7.5-hotfix.1 when v0.7.5 was already acknowledged.

  • Track exact acknowledged release tags in user preferences instead of using version ordering to decide whether a dismissal can be saved.
  • Honor existing last_seen_release_tag values immediately and retain valid legacy acknowledgements on the first subsequent write; no data migration required.
  • Merge acknowledgements under the existing row lock so stale instances and release-channel switches do not discard previous acknowledgements.
  • Preserve unrelated preferences and deduplicate repeated dismissals.
  • Leave release numbering, eligibility and the client dismissal flow unchanged.

Regression coverage

  • Base release → hotfix → base release.
  • Existing legacy acknowledgement before any new write.
  • Stale user instances acknowledging stable/alpha releases, duplicate dismissal, and a genuinely unseen release.
  • Dismiss endpoint followed by another release-notes request.
  • Browser close icon, overlay, Escape and Done, each followed by full reload.

Validation

  • Regression confirmed against the original methods: dismissing v0.7.5-hotfix.1 after v0.7.5 leaves the hotfix pending (expected failure).
  • Focused model/controller tests: 19 runs, 38 assertions, 0 failures/errors.
  • Chrome system tests: 4 runs, 16 assertions, 0 failures/errors; close icon, outside-click, Escape and Done each persist acknowledgement across full reload.
  • Full Rails suite: 10,503 runs, 44,318 assertions, 0 failures, 0 errors, 33 skips (exit 0).
  • Repository Ruby lint, ERB lint (733 files), Biome (135 files), and design-token check passed.
  • Brakeman: 0 errors, 0 security warnings.

The initial outside-click test used an element-relative click that did not hit the backdrop; corrected to an explicit viewport coordinate before the passing browser run. No application JavaScript changed.

Scope

This fixes acknowledgement persistence, not transient network failures in the dismissal request. Release-tag parsing and release eligibility are unchanged. Existing acknowledgements are recognized without a migration; only previously recorded tags can be preserved.

Summary by CodeRabbit

  • Bug Fixes

    • Release highlights stay dismissed after acknowledging a hotfix, even if its base release was already acknowledged.
    • Previously acknowledged releases continue to be recognized, and dismissals are retained across release channels and after reloading.
    • Dismissing a highlight preserves other saved preferences.
  • Tests

    • Added coverage for dismissing highlights with the close button, overlay, Escape key, or Done button.