[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
ilovepinkpony1
added a commit
that referenced
this pull request
Aug 27, 2026
The posterGeneric layout renders header -> barcode -> primary -> footer, but the poster dictionary only carried header/footer/back, so poster passes drew an empty primary row. Add a poster_primary_fields hook (defaulting to the classic primary_fields) and emit it. The classic and poster dictionaries ship in the same pass.json, so one accessor cannot serve both slots -- the Talkable app maps its secondary_fields to the poster primaries. Also fix the featured_actions doc example: "link" is not one of Apple's featured action types. Tests move to test/test_generator_poster.rb / TestGeneratorPoster so they no longer collide with the test/test_generator.rb added by PR #4, and the Rails.root stub is now guarded so it cannot repoint the dummy app that the controller tests boot in the same rake process.
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