Skip to content

test: ATT manual test harness with dev URL overrides#131

Merged
ethanpschoen merged 6 commits into
mainfrom
local/att-test
Jun 30, 2026
Merged

test: ATT manual test harness with dev URL overrides#131
ethanpschoen merged 6 commits into
mainfrom
local/att-test

Conversation

@ethanpschoen

@ethanpschoen ethanpschoen commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Description of this change

  • Adds ATT manual test harness for iOS simulator (local/att-test baseline)
  • Adds dev URL override support: monkey-patches HTMLScriptElement.src, Element.setAttribute, and window.fetch inside the WebView to remap Ketch SDK tag script URLs to a local dev server; injected via <head> script and injectedJavaScriptBeforeContentLoaded for earliest-possible execution
Screenshot 2026-06-29 at 7 00 05 PM

Why is this change being made?

  • Chore (non-functional changes)
  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How was this tested? How can the reviewer verify your testing?

  • cd package && npm run typecheck && npm test
  • bash .cursor/skills/ketch-react-native-run-sample/scripts/run-sample-app.sh ios local (optional manual QA)
  • Set DEV_URL_OVERRIDES_ENABLED = true in example/devUrlOverrides.ts to test local tag redirect

Related issues

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have evaluated the security impact of this change, and OWASP Secure Coding Practices have been observed.
  • I have informed stakeholders of my changes.

Note

Medium Risk
SDK WebView bootstrap and global fetch/script patching affect all consumers when overrides are set; default-off example flag limits production impact, but the init param change applies whenever the new package ships.

Overview
Adds an SDK Health Dashboard and iOS ATT manual test flow to the React Native example: shared dashboard state, provider callbacks wired into on-screen rows and an event log, explicit Load with autoLoad={false}, and optional dev URL remaps behind DEV_URL_OVERRIDES_ENABLED (default off). Example defaults shift to UAT org/property; iOS gets NSUserTrackingUsageDescription and updated CocoaPods lockfile.

The package gains optional webResourceUrlOverrides: WebView HTML and injectedJavaScriptBeforeContentLoaded install hooks on script src, setAttribute, and fetch to remap tag URLs. initKetchTag now builds query params from the init object (skipping non-scalars) and reads boot URL/org/property from parameters instead of the URL bar—fixing [object Object] in query strings when overrides are present.

A Cursor skill plus run-sample-app.sh / configure-sample-package.py automate switching the example between npm and file:../package, Metro, pods, launch, and filtered logs.

Reviewed by Cursor Bugbot for commit a67b7f2. Configure here.

Adds a throwaway local testing harness for ketch-react-native that mirrors the ketch-ios ATT test approach:
- SDK Health Dashboard UI with ATT status, ketch_att/ketch_att_prev rows, privacy/consent state, and event log
- App Tracking Transparency section with Request ATT and Reload WebView buttons
- NSUserTrackingUsageDescription added to Info.plist
- ketch-react-native-run-sample Cursor skill for one-command iOS simulator launch

Example app defaults to ethansch061226/website_smart_tag/UAT config.
Headless API and dev-URL override features are excluded (not on main).

Branch: local/att-test (throwaway — do not merge)
@ethanpschoen ethanpschoen requested review from a team as code owners June 28, 2026 23:37

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit a67b7f2. Configure here.

Comment thread example/devUrlOverrides.ts Outdated
Comment thread example/Main.tsx Outdated
Comment thread example/Main.tsx Outdated
@ethanpschoen ethanpschoen requested a review from jboileau99 June 30, 2026 18:37
@ethanpschoen ethanpschoen merged commit fc1c712 into main Jun 30, 2026
10 checks passed
@ethanpschoen ethanpschoen deleted the local/att-test branch June 30, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants