Skip to content

URL-encode offering IDs in PaywallComponentsTemplatePreviewRecorder#3586

Merged
JayShortway merged 4 commits into
mainfrom
cursor/encode-offering-id-in-paywall-screenshot-names-7727
Jun 12, 2026
Merged

URL-encode offering IDs in PaywallComponentsTemplatePreviewRecorder#3586
JayShortway merged 4 commits into
mainfrom
cursor/encode-offering-id-in-paywall-screenshot-names-7727

Conversation

@JayShortway

@JayShortway JayShortway commented Jun 11, 2026

Copy link
Copy Markdown
Member

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.

Open in Web Open in Cursor 

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).

PaywallComponentsTemplatePreviewRecorder now 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_screenshots Fastlane lane parses those encoded segments with a stricter regex and **CGI.unescape**s them back to the real offering ID before writing screenshots/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.

cursoragent and others added 2 commits June 11, 2026 11:21
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>
@JayShortway JayShortway self-assigned this Jun 11, 2026
Removed comment about percent-decoding offering IDs.
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.35%. Comparing base (20bcdf6) to head (64e97b8).
⚠️ Report is 10 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@JayShortway JayShortway changed the title Encode offering ID in paywall template screenshot file names Jun 12, 2026
@JayShortway JayShortway changed the title URL-encode offering ID in paywall template screenshot file names Jun 12, 2026
@JayShortway JayShortway requested review from a team June 12, 2026 09:41
@JayShortway JayShortway marked this pull request as ready for review June 12, 2026 09:41
@JayShortway JayShortway requested a review from a team as a code owner June 12, 2026 09:41
@JayShortway JayShortway enabled auto-merge June 12, 2026 10:33

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ok!

@JayShortway JayShortway added this pull request to the merge queue Jun 12, 2026
Merged via the queue into main with commit 935b029 Jun 12, 2026
38 checks passed
@JayShortway JayShortway deleted the cursor/encode-offering-id-in-paywall-screenshot-names-7727 branch June 12, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants