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

feat(android) Check server is reachable before starting background backup #8989

Merged

Conversation

devjn
Copy link
Contributor

@devjn devjn commented Apr 21, 2024

Add a check for android version that verifies that server is reachable before starting background backup and fail otherwise.

Why?

When server is behind VPN there is no reliable way to set constrains that would allow to start only for specific network.
This results in backup work tries that hang up in notifications.
One way to tackle this would be to start backup only when specific network is connected. Unfortunately it seems to be impossible when using VPN.
Another option is to check that server url can actually be reached before trying to run backup.

This PR tries to accomplish this by opening HttpURLConnection and checking for 200 code.

Test?
Tested and confirmed on Android device.
Tested on iOS simulator that it doesn't break background backup start.

@devjn
Copy link
Contributor Author

devjn commented Apr 21, 2024

@alextran1502 Fixed iOS issue.

@alextran1502
Copy link
Contributor

Thank you for the quick fix!

@alextran1502 alextran1502 enabled auto-merge (squash) April 23, 2024 17:46
@alextran1502 alextran1502 merged commit 0435de5 into immich-app:main Apr 23, 2024
22 checks passed
@devjn devjn deleted the feat/android-check-server-before-backup branch April 23, 2024 18:09
alextran1502 added a commit that referenced this pull request May 8, 2024
alextran1502 added a commit that referenced this pull request May 9, 2024
@sidamos sidamos mentioned this pull request May 14, 2024
3 tasks
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.

None yet

2 participants