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

Fix Image Loading When Offline #14502

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

Conversation

alexknop
Copy link

@alexknop alexknop commented Feb 5, 2025

Problem:

Although Videos were loading immediately when offline, Images were not

Solution:
Found that checking for whether file is offline was passing, but the ! in the code was making it false, forcing a sync which would timeout (taking extra time) and preventing immediate access to images

Fixes #14470

@alexknop
Copy link
Author

alexknop commented Feb 6, 2025

It still takes a long time to load images when on cellular.

My server address is 192.168.1.2 and as I test this on a guest Wi-fi network with 192.168.1.0/24 as well, it seems Nextcloud is quicker to detect my server unreachable on here versus on Cellular. However, load times are much better when on the guest Wi-Fi and loading images due to this code change.

Videos always load immediately regardless of WiFi or Cellular

@alexknop
Copy link
Author

alexknop commented Feb 6, 2025

I dug more into it and found the timeouts for ReadFileRemoteOperation were extensive by default but you can customize the timeouts. By lowering them, the connection error happens sooner and the app responds quicker.

Images are now loading fine when on cellular and I cannot reach my server.
Please consider these changes and lets discuss.

@alexknop
Copy link
Author

alexknop commented Feb 6, 2025

Found another area to reduce timeouts and speed up the app, that is the timeouts for OCVersionCheck.

Changed them to 1000 and app is responding better when offline.

@alperozturk96
Copy link
Collaborator

alperozturk96 commented Feb 7, 2025

Thank you for the PR.

RefreshFolderOperation/ReadFileRemoteOperation may need more time. If we lower the default session time out value, the user may not get the latest result.

Default = SessionTimeOut(60000, 15000)
PR = SessionTimeOut(1000, 1000)

@tobiasKaminsky Most likely it will fail, and 1 second is very low. What do you think?

@alexknop alexknop force-pushed the ImageTimeout branch 2 times, most recently from e69afe3 to 89643a1 Compare February 10, 2025 18:45
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.

Cannot Open Offline Photos After Video
3 participants