[PR-27262] Omit barcode keys from pass.json when pass has none - #4
Open
Vitalini wants to merge 1 commit into
Open
[PR-27262] Omit barcode keys from pass.json when pass has none#4Vitalini wants to merge 1 commit into
Vitalini wants to merge 1 commit into
Conversation
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.
What
Passkit::Generator#generate_json_passwrote thebarcodekey unconditionally whenbarcodeswas empty, so a pass with no barcode at all produced"barcode": nullin pass.json — an out-of-schema value iOS can silently reject. Now, when a pass has neitherbarcodesnorbarcode, 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
nullor[].Behavior
barcodespresentbarcodeswrittenbarcodesempty,barcodepresentbarcodewritten (legacy fallback)"barcode": nullTests
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