Skip to content

v10 slice 5: example app on v10, test seam, CI, docs, version 10.0.0 - #45

Open
dmurphy5 wants to merge 1 commit into
dylan/v10-3-iosfrom
dylan/v10-5-hardening
Open

dmurphy5 wants to merge 1 commit into
dylan/v10-3-iosfrom
dylan/v10-5-hardening

Conversation

@dmurphy5

@dmurphy5 dmurphy5 commented Sep 24, 2026 •

Copy link
Copy Markdown

Summary

This PR prepares v10 for release. It has no new upload behavior. It adds the tools that the release needs: a test app for device runs, a way for an app to test its own upload code without a device, CI for the iOS tests, and the final docs and version number.

1. The example app is now the device test script

The example app in example/RNBGUExample uses the v10 API. Every step of the device test (send a JSON request, upload a photo, upload a large file in parts, pause, resume, cancel, refresh a token, kill the app and relaunch, turn on Wi-Fi only) has a button. A small local server answers each test case (401, 404, 409, slow, oversize) so a tester does not need a backend. The app README lists the steps for both platforms.

2. Apps can test their upload code without native code

flowchart LR
    subgraph App tests
        T[Test] --> D[Your definitions and handlers]
    end
    D --> L[Real library logic]
    L --> F[Fake native queue]
    F -- "settle(id, outcome)" --> L
    L --> D
Loading

createUploadClient({ native }) accepts a fake in place of the native module, and createFakeNative() supplies one. A test defines a request, calls mutate(), asks the fake to "settle" it with a success or error, and checks that the handler did the right thing. The real registry and delivery code run in between, so the test proves the same path that runs on a device. Diana's Jest suite will use this.

3. CI runs the iOS tests

A macOS job runs swift test. Until now only the Android unit tests ran in CI.

4. Docs and version

  1. CHANGELOG 10.0.0 covers every change across the v10 PRs, with each removed function and its replacement.
  2. README: an "Upgrading from v9" section, platform notes for both OSes, a "Testing your definitions" section, and a corrected iOS setup snippet.
  3. Version 10.0.0 in package.json.

What to look at

  1. example/RNBGUExample/README.md, "Device test script": is each step clear enough to run?
  2. README, "Upgrading from v9": does it answer what happens to uploads that were in flight at upgrade time?

Test Plan

yarn typecheck && yarn test && yarn lint:ci        # 171 tests
cd ios && swift test                               # 178 tests
cd example/RNBGUExample/android && ./gradlew :react-native-background-upload:testDebugUnitTest :app:assembleDebug
cd example/RNBGUExample/ios && pod install && xcodebuild ... build

The macOS CI job runs for the first time on this PR.

Compatibility

OS Implemented
iOS ✅
Android ✅

Checklist

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I updated the typed files (TS)
  • I've added Detox End-to-End Test(s)
  • I've created a snack to demonstrate the changes

🤖 Generated with Claude Code

@dmurphy5
dmurphy5 added this pull request to stack #44 September 24, 2026 21:41
@dmurphy5
dmurphy5 marked this pull request as ready for review September 25, 2026 15:57
The example app is the device test harness. It is rewritten on the v10
API: definitions at module scope (JSON POST, multipart, chunked with
chunkPlan, bodiless DELETE, no-vars GET), configure() with a headers
provider, a queue list from getRequests() and the state and progress
feeds, an attempt log, and controls for every step of the two device
scripts: cancel, pause, resume, wifiOnly, updateHeaders with a typed
value, same-id resume and replace, a short expiresAt, and a section of
outcomes journaled before this launch for the kill-and-relaunch check.
The local Express server answers by path segment (401, 404, 409, 503,
slow, oversize) and writes chunked parts at their offsets. The stale
Podfile.lock is regenerated for RN 0.84.1, the AppDelegate wires the
background completion handler, and the Android manifest declares and
requests POST_NOTIFICATIONS. The example README carries the device
script in UI terms.

Library: createUploadClient({ native }) accepts a fake TurboModule, and
react-native-background-upload/src/testing exports createFakeNative(),
an in-memory Spec with settle(), seeded rows, recorded calls, and ack
tracking, so a consumer tests definitions and handlers against the real
registry and delivery. CI gains a macOS job that runs swift test.

Docs: CHANGELOG 10.0.0 covers all slices; README gets an "Upgrading from
v9" section, iOS platform notes, a "Testing your definitions" section,
and a corrected AppDelegate snippet (@import for .m, header search path
for .mm). Version 10.0.0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@dmurphy5
dmurphy5 force-pushed the dylan/v10-5-hardening branch from a11bc39 to b678007 Compare September 28, 2026 17:11
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