immich icon indicating copy to clipboard operation
immich copied to clipboard

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

Open devjn opened this issue 1 year ago • 2 comments

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 avatar Apr 21 '24 08:04 devjn

@alextran1502 Fixed iOS issue.

devjn avatar Apr 21 '24 08:04 devjn

Thank you for the quick fix!

alextran1502 avatar Apr 21 '24 12:04 alextran1502