Skip to content

OpenDocument Has Long Timeout For Opening Files When Offline #14478

Open
@alexknop

Description

@alexknop

⚠️ Before posting ⚠️

  • This is a bug, not a question or an enhancement.
  • I've searched for similar issues and didn't find a duplicate.
  • I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
  • I agree to follow Nextcloud's Code of Conduct.

Steps to reproduce

  1. Download a file offline
  2. Then go offline
  3. Attempt to open a file from an application which would call the OpenDocument function (In my case I used an offline .kdbx file and tried to open with KeepassDX)
  4. Expect to wait up to a minute for the toast message to finally say "File could not be synced. Showing latest available version."

Expected behaviour

After a short period of time (5 sec max), offline file should just load

Actual behaviour

In DocumentsStorageProvider.java, openDocument() calls hasServerChange() on line 210, which is returning true based on its result of ETAG_CHANGED even though the Etag could not be found. This is handled by CheckEtagRemoteOperation.class in the event of an IOException.
This then triggers needsDownload to kick off, which is unnecessary in this scenario.

Android version

15

Device brand and model

TCL 50 XE

Stock or custom OS?

Stock

Nextcloud android app version

3.32.0

Nextcloud server version

30.0.5

Using a reverse proxy?

No

Android logs

No response

Server error logs

Additional information

In my opinion, in hasServerChange(), a SessionTimeout object with Timeouts of 1000 should then be passed to CheckEtagRemoteOperation() to shorten the wait time from 1 minute to 1 second.

However, if the Etag is not found, we should not be trying to download it. Possibly another connection check needs to be factored into boolean needsDownload.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions