URL-encode offering IDs in PaywallComponentsTemplatePreviewRecorder#3586
Merged
JayShortway merged 4 commits intoJun 12, 2026
Merged
Conversation
Android derived the paywall-rendering-validation directory name by parsing the offering ID out of the Paparazzi snapshot file name. Paparazzi rewrites file-name-unsafe characters (e.g. spaces become underscores), so offering IDs with spaces (e.g. "Virtual currencies subscription") landed in a different, underscore-named directory than iOS, splitting the same paywall across two folders. Reversing that sanitization isn't safe because some IDs contain real underscores (e.g. "wide_badge_style"). Hex-encode the offering ID in the recorder's parameterized test name, and hex-decode it in the screenshot upload lane, so Android recovers the exact offering ID and writes to the same directory as iOS. Co-authored-by: joop <joop@revenuecat.com>
Percent-encoding keeps the snapshot/Emerge names human-readable (e.g. "Virtual%20currencies%20subscription") while still surviving Paparazzi's file-name sanitization and round-tripping exactly. We keep only [A-Za-z0-9.-] literal and percent-encode everything else - including underscores - so the token never contains an underscore and the triple-underscore delimiters stay unambiguous. Co-authored-by: joop <joop@revenuecat.com>
Removed comment about percent-decoding offering IDs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3586 +/- ##
=======================================
Coverage 80.35% 80.35%
=======================================
Files 377 377
Lines 15417 15417
Branches 2140 2140
=======================================
Hits 12389 12389
Misses 2171 2171
Partials 857 857 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
Paparazzi replaces any spaces in test names with underscores. This is a problem in paywall-rendering-validation. An offering ID with a space, such as "Virtual currencies 1", would cause Android's screenshot to show up under "Virtual_currencies_1". Other platforms don't have this limitation.
Fix
The fix is to URL encode the offering IDs in Paparazzi tests, and decode them before they're uploaded to paywall-rendering-validation.
Note
Low Risk
Scoped to Paparazzi snapshot naming and the Fastlane screenshot upload path; no runtime SDK or purchase behavior changes.
Overview
Fixes Android paywall template screenshots landing under wrong folder names in paywall-rendering-validation when offering IDs contain spaces (Paparazzi turns spaces into underscores in test/snapshot names).
PaywallComponentsTemplatePreviewRecordernow puts a percent-encoded offering ID in the parameterized test name (___…___), using a small UTF-8 encoder that only leaves letters, digits,., and-unescaped so filenames stay stable.The
record_and_push_paywall_template_screenshotsFastlane lane parses those encoded segments with a stricter regex and **CGI.unescape**s them back to the real offering ID before writingscreenshots/templates/{offering_id}/android.png.Reviewed by Cursor Bugbot for commit 64e97b8. Bugbot is set up for automated code reviews on this repo. Configure here.