Skip to content

[PR-27262] Omit barcode keys from pass.json when pass has none - #4

Open
Vitalini wants to merge 1 commit into
talkable:mainfrom
Vitalini:vb-PR-27262-optional-barcode
Open

[PR-27262] Omit barcode keys from pass.json when pass has none#4
Vitalini wants to merge 1 commit into
talkable:mainfrom
Vitalini:vb-PR-27262-optional-barcode

Conversation

@Vitalini

@Vitalini Vitalini commented Aug 18, 2026

Copy link
Copy Markdown

What

Passkit::Generator#generate_json_pass wrote the barcode key unconditionally when barcodes was empty, so a pass with no barcode at all produced "barcode": null in pass.json — an out-of-schema value iOS can silently reject. Now, when a pass has neither barcodes nor barcode, neither key is written.

Why

Talkable is making the Wallet pass barcode optional for Wallet-only / referral-free sites (PR-27262, scoped in PS-38830). Apple documents both keys as optional; a truly barcode-free pass must omit them entirely — never emit null or [].

Behavior

Pass state Before After
barcodes present barcodes written unchanged
barcodes empty, barcode present barcode written (legacy fallback) unchanged
neither "barcode": null no barcode key at all

Tests

New test/test_generator.rb (first generator coverage in the fork): all three rows above, asserting on the parsed pass.json. Written red-first — the omission test failed against the old code, green after the one-line guard. Full suite: same pre-existing failures as before, count unchanged (api-controller breakage unrelated to this change).

Jira: PR-27262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant