Skip to content

Cut unused API surface, make iOS startUpload idempotent - #30

Merged
dmurphy5 merged 1 commit into
masterfrom
dylan/v9-2-cleanup
Sep 1, 2026
Merged

Cut unused API surface, make iOS startUpload idempotent#30
dmurphy5 merged 1 commit into
masterfrom
dylan/v9-2-cleanup

Conversation

@dmurphy5

@dmurphy5 dmurphy5 commented Aug 24, 2026

Copy link
Copy Markdown

Diana is the only consumer of this library. This PR removes the API that Diana does not use:

  • Scoped listeners. Diana's test mock does not permit them.
  • The android.maxRetries option. Diana never set it. The library owns the retry policy.
  • The iOS getUploadStatus function. Its one use was a consumer workaround.
  • A dead TODO in the types.

The PR keeps android.addNotificationListener. Diana uses it to route notification taps (uploadNotificationEpics.ts:35). An earlier usage check had missed the JS wrapper name.

The PR renames the customUploadId option to id. There is no reason for the custom prefix.

The PR also makes iOS startUpload idempotent for a consumer-supplied id. A second call with the same id resolves with that id. It does not start a second upload. Android already has this behavior through ExistingWorkPolicy.KEEP. This change made getUploadStatus unnecessary.

🤖 Generated with Claude Code

@dmurphy5
dmurphy5 marked this pull request as ready for review August 25, 2026 17:15
@dmurphy5
dmurphy5 changed the base branch from dylan/v9-1-design to master August 25, 2026 17:35
@dmurphy5 dmurphy5 changed the title v9 2/7: cut unused API surface, make iOS startUpload idempotent Cut unused API surface, make iOS startUpload idempotent Aug 25, 2026
@dmurphy5
dmurphy5 force-pushed the dylan/v9-2-cleanup branch from e848e57 to a175c42 Compare August 25, 2026 17:35
@dmurphy5
dmurphy5 marked this pull request as draft August 25, 2026 17:38
@dmurphy5
dmurphy5 marked this pull request as ready for review August 27, 2026 18:32
@dmurphy5
dmurphy5 requested a review from elliottkember August 27, 2026 18:33
Listeners are global-only: addListener loses its uploadId parameter and
the JS-side id filter. android.maxRetries is removed (the retry budget
becomes a library constant), along with ios.getUploadStatus. The
notification tap listener (android.addNotificationListener) is kept
because Diana's tap-routing uses it (uploadNotificationEpics.ts). iOS
startUpload now resolves with the existing id when a task for the same
customUploadId is already pending or running, mirroring Android's
ExistingWorkPolicy.KEEP.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dmurphy5
dmurphy5 force-pushed the dylan/v9-2-cleanup branch from a175c42 to b6d6d27 Compare August 28, 2026 16:49

@elliottkember elliottkember 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.

I think this is fine. We may have some external users but I doubt they're using all aspects of the API. Happy to ship this and take pull requests about it

@dmurphy5
dmurphy5 merged commit f3ea1e8 into master Sep 1, 2026
2 checks passed
@dmurphy5
dmurphy5 deleted the dylan/v9-2-cleanup branch September 3, 2026 15:25
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