Skip to content

2. Offline & Sync

Doh edited this page Jan 23, 2026 · 2 revisions

User Flow 1: Offline Creation & Local Drafts

Step 1: User opens the diVine camera while offline.

Step 2: User records multiple segments (totaling < 6.3s).

Step 3: User reorders/edits segments and adds a caption.

Step 4: User hits "Save to Drafts" or "Post" (queued).

Step 5: The app saves the raw video segments and the unsigned/pending Nostr event to local storage.

Corresponding User Stories:

US-606.1: As a creator, I want to record and edit video segments without an internet connection so that I never lose a creative moment.

US-606.2: As a creator, I want my unfinished videos to be saved as local drafts so that I can resume editing them later.

User Flow 2: Background Synchronization (The "Post & Walk Away")

Step 1: User hits "Post" on a completed video.

Step 2: App detects "Offline" status and moves the event into a "Pending Sync" queue.

Step 3: User closes the app or locks their phone.

Step 4: System detects a stable connection (WiFi/Cellular).

_Step 5: App signs the Nostr event and uploads the media in the background, then broadcasts to relays.

Corresponding User Stories:

US-606.3: As a user, I want my pending posts to automatically upload in the background when my connection is restored so that I don't have to keep the app open.

US-606.4: As a user, I want to see a "Syncing" status indicator so I know which of my videos are live on the network vs. stored locally.

User Flow 3: Optimistic Social Interactions

Step 1: User views a cached video in their feed.

Step 2: User "Likes" or "Reposts" the video.

Step 3: The UI updates immediately (icon turns red) as if the action was successful.

Step 4: The app queues the Nostr event locally.

Step 5: Once online, the app broadcasts the signed interaction to the relays.

Corresponding User Stories:

US-606.5: As a user, I want my likes and reposts to register immediately in the UI (optimistic update) so the app feels fast and responsive even on poor connections.

US-606.6: As a developer, I want a robust local event queue to manage the chronological broadcasting of offline interactions to Nostr relays.

User Flow 4: Offline Content Consumption (Feed Caching)

Step 1: User opens the app while online; the app silently caches the top 10 videos in the Home Feed.

Step 2: User enters Airplane Mode.

Step 3: User scrolls the feed.

Step 4: Cached videos play seamlessly; an "Offline" indicator informs the user they are seeing cached content.

Corresponding User Stories:

US-606.7: As a user, I want the app to cache recent videos from my feed so that I can continue watching content when I lose my connection.

US-606.8: As a user, I want to be notified when I am viewing cached content so that I understand why the feed isn't updating with new videos.

Welcome to the divine-mobile wiki

Product Foundations (click to expand)

Clone this wiki locally