Skip to content

chore(example): scope setup caches and refresh each demo installation - #1985

Merged
fadi-george merged 4 commits into
OneSignal:mainfrom
OskarEichler:codex/onesignal-demo-setup-cache
Aug 31, 2026
Merged

chore(example): scope setup caches and refresh each demo installation#1985
fadi-george merged 4 commits into
OneSignal:mainfrom
OskarEichler:codex/onesignal-demo-setup-cache

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Description

One Line Summary

Hash actual package/build inputs without generated Android output, support spaces, track per-demo installs separately from the shared tarball, and use commands supported by the pinned local Vite+ CLI. Scope Metro caches and process restarts to the selected demo.

Compatibility and observable changes

Example tooling only. Setup must run from one of the two supported demo directories. Other projects’ Metro caches and processes are no longer removed/stopped. Native dependency versions are unchanged.

Details

Motivation

The source audit reproduced the failure paths described below. This PR contains only the associated fix; unrelated audit changes are in separate PRs.

Scope

  • examples/setup.sh
  • examples/demo/metro.config.js
  • examples/demo-no-location/metro.config.js
  • .gitignore

Testing

Five isolated shell-fixture reproductions fail on baseline and pass fixed: spaces, generated-output cache churn, stale second-demo installs, unrelated Metro cache deletion and omitted bundler configuration. Both real demo setup commands also succeed using the pinned toolchain.

Each code/tooling fix was also applied independently to upstream commit a70312207cf094ac361eaa9196c317acb175c2cd and passed its targeted external actual-source diagnostics. Documentation snippets were checked separately. Native diagnostic harnesses use bridge/SDK doubles and are not an end-to-end push test.

On the combined audit branch:

  • Existing SDK suite: 5 files, 262 tests pass; unchanged 95% coverage thresholds pass.
  • vp check: formatting, lint and type checks pass; native Spotless check passes.
  • Both example apps: Android Debug and unsigned iOS Simulator builds pass.
  • Both example apps: iOS and Android production Metro bundles pass.

No checked-in test files were added or modified; regression evidence comes from external diagnostic harnesses and the existing suite. No physical-device, live notification delivery, Appium/BrowserStack, or release-workflow execution is claimed. The no-location example's stale native lock was updated locally to resolve the current SDK for verification; generated locks are not part of this PR.

Checklist

  • Required description sections completed.
  • Scope and observable/API behavior explained.
  • Diff reviewed and targeted regression checks run.
  • Automated checks and device-testing limitations documented.

@OskarEichler
OskarEichler requested a review from a team as a code owner August 27, 2026 23:47
@fadi-george fadi-george changed the title fix(example): scope setup caches and refresh each demo installation chore(example): scope setup caches and refresh each demo installation Aug 28, 2026
Comment thread examples/setup.sh Outdated
echo "Registering tarball with vp (refreshes bun.lock integrity hash)..."
vp remove react-native-onesignal 2>/dev/null || true
vp add file:../../react-native-onesignal.tgz
vp exec bun remove react-native-onesignal

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't insert bun here. Use vp remove react-native-onesignal. vp exec for pack is fine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed in the current branch. The setup now uses Vite+ directly: vp remove react-native-onesignal for removal and vp add for the packed tarball. No Bun command remains in this path. Bash syntax checks and the complete Vite+ suite (262 tests) pass.

@OskarEichler

Copy link
Copy Markdown
Contributor Author

Updated the setup to use Vite+ directly for both removal and addition. I also corrected the follow-up regression where vp install was being given a package argument; the tarball is now registered with vp add. Bash syntax and diff checks pass, and the Vite+ suite passes all 262 tests.

…alidation

Co-authored-by: Cursor <cursoragent@cursor.com>
@fadi-george

Copy link
Copy Markdown
Collaborator

I did some slight clean up to not use metro filestores and improved caching slightly.

@fadi-george
fadi-george merged commit 24cbe60 into OneSignal:main Aug 31, 2026
2 checks passed
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