Skip to content

[BUG] Deeplinks without connection, not working #4251

Open

Description

@jesmrec

Comes from #4212 (comment)

Steps to reproduce

  1. Download a file
  2. Get the link of the file and create a deep link (adding owncloud:// as prefix)
  3. Remove device connection
  4. Click on the link to open

Actual behaviour

Sync failed

Expected behaviour

File is downloaded (therefore discovered), so it should be opened in the app, regardless the lack of connection.

  • If file is discovered and not downloaded, opening the link should show the Details view, no matter if the file is previewable or not (same as clicking directly the file)
  • If the file is downloaded, lack of connection does not have to avoid opening it.
  • If a folder is discovered, it should show the content
  • Error only if item is not discovered

Activity

  1. added
    p2-high
    on Dec 11, 2023
  2. added this to the 4.2 - Current milestone on Dec 11, 2023
  3. removed
    p2-high
    on Jan 19, 2024
  4. modified the milestones: 4.4 - Current, Backlog on Oct 4, 2024
  5. removed this from the Backlog milestone on Feb 14, 2025
  6. DeepDiver1975 commented on Jun 30, 2026

    @DeepDiver1975
    Contributor

    Still reproducible on current master. Located cause:

    ManageDeepLinkUseCase.run() → FileRepository.getFileFromRemoteId() is remote-only. OCFileRepository.getFileFromRemoteId() (owncloudData/.../OCFileRepository.kt:169) immediately does remoteFileDataSource.getMetaFile(fileId, accountName) to resolve fileId → path, then loops refreshFolder(...) over every path segment. All are network calls; offline they fail → Sync failed, even for an already-discovered/downloaded file.

    There is no local-DB fast path: the use case never consults the local store before going remote, so the "file already discovered/downloaded ⇒ open without connection" expectation can't be met as written.

    Fix direction: resolve the deep link against the local DB first (look up by remoteId/fileId locally), and only fall back to the remote getMetaFile/refreshFolder resolution when the item isn't discovered locally — surface the offline error only in that last case (matches the issue's bullet list). The remote-resolution path can stay for the not-discovered case.

    (Earlier attempt PR #3598 "Open deep links in app, items already discovered (1st round)" was closed unmerged; the shipped deep-link handling did not include offline/local-first resolution.)

    🤖 Generated with Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions