Skip to content

Make /v1/sync-local-files asynchronous to remove offline sync bottleneck #3893

Closed

Description

@smian1

Description

The POST /v1/sync-local-files endpoint is currently fully synchronous and blocks until the entire backend pipeline completes (decode, VAD, transcription, merge, save).

This creates a major bottleneck for users who rely on offline sync.

When users have large offline backlogs (hundreds of files or a full day of data), sync time scales with transcription latency and can take hours, even though uploads themselves are fast.

This is causing poor UX and does not scale.

⸻

Current Behavior (Problem)
• Phone app uploads .bin files
• Backend processes synchronously:
• decode
• VAD
• Deepgram transcription
• merge
• DB save
• HTTP 200 is returned only after all processing completes
• Phone app cannot delete local files or upload the next batch until the response returns

Result:
• Each batch blocks for ~45–50 seconds
• Large offline backlogs take an unacceptably long time to clear

⸻

Proposed Change (Fix)

Change /v1/sync-local-files to be asynchronous:
• Persist uploaded files immediately
• Return HTTP 200 as soon as persistence succeeds
• Move decode, VAD, transcription, merge, and save to background processing
• Allow the phone app to immediately:
• delete local .bin files
• upload the next batch

This decouples upload throughput from transcription latency.

⸻

Benefits
• Offline sync time scales with network upload speed, not transcription latency
• Large backlogs clear quickly
• Better user experience for offline-first users
• Backend retains full control over processing concurrency and retries

⸻

Acceptance Criteria
• /v1/sync-local-files returns HTTP 200 after successful upload persistence
• Backend processing runs asynchronously
• No regression in data integrity or durability
• Idempotency and retry safety preserved

⸻

Priority

High

Many users depend on offline sync, and the current synchronous design is a scalability blocker.

Activity

  1. added
    backend
    on Dec 24, 2025
  2. added theissue type on Dec 24, 2025
  3. added
    capture
    p2
    maintainer
    on Jan 29, 2026
  4. beastoin commented on Jan 29, 2026

    @beastoin
    Collaborator

    @smian1 Well-documented performance improvement request. Making /v1/sync-local-files async would decouple upload throughput from transcription latency - significant improvement for users with large offline backlogs. I scored it as Layer capture / P2 / maintainer with score 21 (w=5, sev 3, trust 3, freq 3, lev 3, cost 3). See our triage guide.


    by AI for @beastoin

  5. undivisible commented on Jul 20, 2026

    @undivisible
    Collaborator

    Async sync — confirmed: POST /v2/sync-local-files endpoint exists and is async.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendcapturemaintainerp2

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions