Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenDocument Has Long Timeout For Opening Files When Offline #14478

Open
4 tasks done
alexknop opened this issue Feb 1, 2025 · 1 comment · May be fixed by #14510
Open
4 tasks done

OpenDocument Has Long Timeout For Opening Files When Offline #14478

alexknop opened this issue Feb 1, 2025 · 1 comment · May be fixed by #14510

Comments

@alexknop
Copy link

alexknop commented Feb 1, 2025

⚠️ 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.

@alexknop
Copy link
Author

alexknop commented Feb 5, 2025

I have put temporary fixes in:
https://github.com/alexknop/android/tree/OpenDocumentTimeout under commit c5d615d

But doesn't seem to be a viable PR candidate because if ETAG_CHANGED was legitimate, it would trigger false for needsDownload.

Hoping we can take what I have and build a more rudimentary solution

@alexknop alexknop linked a pull request Feb 6, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant