Skip to content

Android: classify Files mutation failures that were never sent #504

Open

Description

@veryCrunchy

Problem

When a Files mutation fails, the delete flow verifies the result against the server unless the failure is typed as definitely not sent (FileMutationNotSentException, added in #498). Desktop can tell the two apart: DesktopHttpMutationExecutor records when a network exchange starts, so DNS, connect and TLS failures before that point are classified as not sent.

Android's Files mutation path (AndroidNextcloudServices.request()) does not track exchanges. A DNS, connect or TLS failure that happened before anything was sent is therefore treated as ambiguous. The delete flow then runs a verification read and may leave a refresh-required block, so the user has to refresh the folder before retrying something that never reached the server.

This is the safe direction (no blind retry), so the cost is UX and an extra request, not data loss. It was raised in review of #498 and is left open there because closing it needs a transport change outside that PR's scope.

Proposed direction

  • Add typed delivery evidence to the Android Files mutation transport, matching desktop's rule: mark when the network exchange starts, after connect and TLS. Any failure before that point becomes FileMutationNotSentException with a typed cause; any failure after it stays ambiguous.
  • Prefer moving the classification into shared JVM transport code that both platforms use, rather than duplicating it in each platform's services.
  • Do not classify by exception message text.

Acceptance criteria

  • On Android, a refused connection, unresolvable host, or failed TLS handshake during a Files mutation is classified not sent: no verification read, no refresh block, retryable with the typed reason.
  • A failure after the request may have been sent (for example a read timeout) stays ambiguous and is verified.
  • Classification is shared with desktop where the behavior is identical.
  • Android unit tests for each not-sent class and for an ambiguous case execute in :androidApp:testDebugUnitTest.
  • The Android gap note in ADAPTER_ARCHITECTURE.md ("Files delete write fence") is removed.
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

    area:files-syncFiles, offline storage, transfer, and synchronizationplatform:androidAndroid-specific implementation or validationpriority:P3Longer-term expansiontype:reliabilityCorrectness, crash prevention, recovery, and data safety

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions