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

Open Document Timeout #14510

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

alexknop
Copy link
Collaborator

@alexknop alexknop commented Feb 6, 2025

Problem:

When offline and attempting to open a document via the Document Provider, the wait time is excessive.

CheckEtagRemoteOperation is reporting ETAG_CHANGED when the connection times out to the server, thus triggering needsDownload.

Instead, if the file is saved offline and the etag cannot be read from the server, there is no need for download.

Solution:

Implemented shorter timeouts than the default, which would take longer than is necessary.

If the etag has changed and we have a connection to the server, then result's data will be populated.
We now check whether this data exists.
If data returns null (which results from a timeout), then we return false. This skips the unnecessary download attempt.

Fixes #14478

@alexknop alexknop force-pushed the OpenDocumentTimeout branch 3 times, most recently from 4c559c3 to 2b56779 Compare February 11, 2025 14:58
Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@tobiasKaminsky
Copy link
Member

Hi,

I'd like to ask to apologize for being late at this PR.
I will check it now.

@tobiasKaminsky
Copy link
Member

Timeout of 1s might lead to false positive errors?

On Files app we know if the app is offline, so maybe we can re-use this?
E.g. we have NetworkChangeReceiver

What do you think?

@alexknop
Copy link
Collaborator Author

I do not see why not, but in terms of implementing I do not have enough knowledge of this app's architecture.
It seems like a good check to run and act on accordingly prior to determining whether to run hasServerChange.

I was simply bug fixing in noticing offline files take an egregious amount of time to load, and noticing the return value for the eTAG played a role in it. I do think timeouts can be reduced, in this age 1 second is a long time to reach your server, but I understand wanting a bit of a safeguard. I thought this function also retried a few times prior to returning a value, which is a safeguard in itself.

Hope this helps, but apologies for not being able to carry this idea out.

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

Successfully merging this pull request may close these issues.

OpenDocument Has Long Timeout For Opening Files When Offline
2 participants