Skip to content

Add backward-compat deserialization tests for legacy offer conditions#3172

Merged
vegaro merged 1 commit into
cesar/update-conditionfrom
facundo/add-backward-compat-tests
Mar 4, 2026
Merged

Add backward-compat deserialization tests for legacy offer conditions#3172
vegaro merged 1 commit into
cesar/update-conditionfrom
facundo/add-backward-compat-tests

Conversation

@facumenzella

@facumenzella facumenzella commented Mar 4, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds tests verifying that old-format JSON with extra operator+value fields (e.g. {"type": "intro_offer", "operator": "=", "value": true}) correctly deserializes to the plain IntroOffer/PromoOffer objects, silently ignoring the extra fields.
  • This is the key backward-compat scenario that [Conditions] Update JSON keys #3168 exists to solve, and it wasn't explicitly tested.

Test plan

  • ComponentOverridesTests pass

🤖 Generated with Claude Code


Note

Low Risk
Low risk: test-only change that adds coverage for backward-compatible JSON deserialization behavior without modifying production code.

Overview
Adds parameterized test cases in ComponentOverridesTests to verify backward compatibility: legacy intro_offer/promo_offer condition JSON that includes extra operator/value fields is accepted and deserializes to Condition.IntroOffer/Condition.PromoOffer (silently ignoring the extra fields).

Written by Cursor Bugbot for commit 2a1a829. This will update automatically on new commits. Configure here.

Verifies that old-format JSON with extra operator+value fields
(e.g. {"type": "intro_offer", "operator": "=", "value": true})
correctly deserializes to the plain IntroOffer/PromoOffer objects,
silently ignoring the extra fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@facumenzella facumenzella requested a review from a team as a code owner March 4, 2026 11:08
@vegaro vegaro merged commit 918d463 into cesar/update-condition Mar 4, 2026
5 of 6 checks passed
@vegaro vegaro deleted the facundo/add-backward-compat-tests branch March 4, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants