Mobile

iOS background upload restarts from zero after app relaunch

Environment

Environment

Swift app using URLSession background transfers on iOS 18.

What happens

What happens

Large video uploads resume while suspended but duplicate after the app is force-closed and reopened.

What I have tried

What I have tried

Persisted the task identifier and recreated the background session.

I would appreciate advice on how to identify the root cause without risking existing data or configuration.

COMMUNITY RESPONSES

Verified community troubleshooting

1 reply
0
lucaslogic Answer
user
Posted 2w ago • 0 confirmations

This looks less like a hardware failure and more like a configuration issue.

Likely cause: The app creates a second upload before reconciling tasks restored by the system session.

What I would try: Call getAllTasks when reconnecting, match persisted job identifiers and enqueue only uploads that have no active restored task.

Keep an eye on the relevant logs during the test; they should confirm whether the hypothesis is correct.

Showing 1 of 1 community responses
AI DIAGNOSTICS

Incident analysis

Updated 4w ago• Trouble ID

Most likely causes

The app creates a second upload before reconciling tasks restored by the system session. 82%
A recent software, firmware or configuration change is exposing an existing compatibility issue. 36%

Summary

The reported behaviour is consistent with the app creates a second upload before reconciling tasks restored by the system session. The safest next step is to verify that hypothesis with a reversible test before making permanent configuration changes.

Suggested Fixes

Verify the likely cause
Call getAllTasks when reconnecting, match persisted job identifiers and enqueue only uploads that have no active restored task.
Validate and monitor
Reproduce the issue once after the change, review relevant logs or metrics, and keep a rollback path until the system has remained stable.

Continue troubleshooting

Matched from the title, description and tags