> ## Documentation Index
> Fetch the complete documentation index at: https://developer.suki.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Offline Upload Failures on Mobile SDK

> Fix Mobile SDK offline mode, local storage, and automatic upload after reconnect

Mobile SDK can keep recording when the network drops. It stores encrypted audio and session data on device, then uploads automatically when connectivity returns. Upload problems show up as offline transitions, failed upload events, or content that is not ready because the offline buffer has not synced yet.

## How offline mode works

From [Offline and networking FAQs](/mobile-sdk/faqs/offline-networking) and [Offline mode](/mobile-sdk/ambient-guides/offline-mode):

1. **15-second buffer:** The SDK waits 15 seconds before entering offline mode, so brief drops can recover.
2. **Local storage:** Audio and session data are encrypted and stored on the device.
3. **Automatic sync:** When the connection returns, offline data uploads automatically. There is no manual sync API.
4. **Session continuity:** Recording continues during network outages.

The SDK notifies your app through session delegate events, including `.convertedToOfflineSession` and upload-related cases.

## What triggers offline mode

* Poor or lost Wi-Fi or cellular
* Network switching (Wi-Fi to cellular, or the reverse)
* Temporary backend unavailability
* Authentication token expiration
* Dropped connections during audio streaming

<Note>
  Not every `createSession` failure creates an offline session. If the backend returns `FAILED_PRECONDITION` or `INVALID_ARGUMENT` as a `SukiStatus` (typically codes `9` and `3`), the SDK returns the error and does **not** fall back to offline. Fix the request, then retry online.
</Note>

## Upload and storage signals

| Event | Meaning |
| :- | :- |
| `convertedToOfflineSession` | Session converted to offline mode |
| `pendingOfflineUpload` | Offline audio is pending upload |
| `preparingOfflineUpload` | Preparing offline audio for upload |
| `uploadingAudio` | Audio upload in progress |
| `audioUploaded` | Audio uploaded successfully |
| `audioUploadFailed` | Audio upload failed |
| `audioUploadAllRetryFailed` | All audio upload retry attempts failed |
| `processingUpload` | Uploaded audio is being processed |
| `processingUploadFailed` | Upload processing failed |

Also check device storage when offline mode misbehaves. The SDK alerts through delegate events if storage is low. Data is removed from the device after a successful upload.

Content for offline sessions is available only after upload completes and generation finishes. Watch upload and generation events, then retrieve content the same way as online sessions.

## Fix

<Steps>
  <Step title="Confirm Offline Transition Events">
    Listen for `.convertedToOfflineSession` and related upload events on `SukiAmbientSessionDelegate`. Show connection status during the 15-second buffer when useful.
  </Step>

  <Step title="Check Storage and Network State">
    Confirm free device storage and that the device detects online/offline correctly. Low storage can block offline recording or sync.
  </Step>

  <Step title="Wait for Automatic Upload">
    When connectivity returns, let the SDK upload queued sessions (oldest first for the same encounter key). Do not expect content APIs to succeed before `audioUploaded` and generation complete.
  </Step>

  <Step title="Handle Upload Failure Events">
    On `audioUploadFailed` or `audioUploadAllRetryFailed`, show the failure in your UI and retry when the network is stable. Manual sync is not available.
  </Step>
</Steps>

## Next steps

<Icon icon="file-lines" iconType="solid" /> **[Offline mode](/mobile-sdk/ambient-guides/offline-mode)** - Buffer, local storage, and auto-upload behavior

<Icon icon="file-lines" iconType="solid" /> **[Offline and networking FAQs](/mobile-sdk/faqs/offline-networking)** - Offline triggers, queueing, and upload status

<Icon icon="file-lines" iconType="solid" /> **[Session events and delegates](/mobile-sdk/ambient-guides/events-and-delegates)** - Upload and offline event cases

<Icon icon="file-lines" iconType="solid" /> **[NetworkOffline or OfflineSaveFailed on Headless Web SDK](/documentation/troubleshooting/network-offline-headless)** - Headless browser offline errors (not Mobile)

<Icon icon="file-lines" iconType="solid" /> **[Content generation is taking too long](/documentation/troubleshooting/content-generation-slow)** - Wait for generation after upload
