snapdrop-android icon indicating copy to clipboard operation
snapdrop-android copied to clipboard

Automatic server switching if snapdrop.net is down

Open fm-sys opened this issue 2 years ago • 7 comments

Describe the feature

From time to time snapdrop.net is down, which is inconvenient for users and leads to many bad Google Play reviews.

If the app is unable to reach https://snapdrop.net it could automatically redirect to a fallback server.

@Bellisario has created a node.js version of snapdrop, which can be found here:

https://node-snapdrop.herokuapp.com/

May we use this instance and is the server capable to handle larger traffic?

Describe alternatives you've considered

It needs to be decided if we want to inform the user or not.

Either this happens without user interaction, with the downside that sending files between two android apps will work but users will not know which webpage to open on Windows/Mac/IOS.

Or we show a dialog: "Snapdrop.net is currently unavailable. Do you want to use the fallback server https://node-snapdrop.herokuapp.com/ in the meantime?"

Additional context

Related to #183

fm-sys avatar Apr 24 '22 11:04 fm-sys

great idea! i like the dialog, its telling the user whats up, another dialog sould then intruct the user to also type the new adress in the browser, maybe there could be a shortened url to make it easier :)

ueen avatar Jun 25 '22 08:06 ueen

I would like to +1 this idea. snapdrop is down right now and has been for a few days now.

I have spinned up a mirror which I plan to maintain and improve on. Can be added as a fallback option / mirror: https://airdope.io

asadm avatar Aug 16 '22 22:08 asadm

@asadm thanks for the mirror @fm-sys i cant enter it in the app, says it doesnt seem to be an snapdrop instance (works in normal browser), any ideas?

ueen avatar Aug 20 '22 08:08 ueen

I had implemented a very basic check whether the entered website can be accessed and is a fork of snapdrop. Currently, the only thing I do is to search whether the word snapdrop is contained anywhere inside the html. For sure, this can be replaced by a better algorithm.

@asadm if you add a comment like <-- snapdrop fork --> to your HTML it should get possible to activate this website inside the Snapdrop for Android app. For sure, we need to check whether it correctly runs inside the app, cause website adoptions might break some app-specific js code.

fm-sys avatar Aug 20 '22 18:08 fm-sys

@fm-sys I'm not a Java developer so I don't know if this can be made, but I can suggest to check if the Snapdrop class is present in the window object, because it is exposed. In this way, I was able to detect Snapdrop in the original, mine and @asadm one.

DevTools example below

image

Bellisario avatar Aug 21 '22 09:08 Bellisario

I have added a <!-- snapdrop fork --> to the HTML. Can you check now?

asadm avatar Aug 21 '22 16:08 asadm

I have added a <!-- snapdrop fork --> to the HTML. Can you check now?

I'm now able to set your website inside the app and sending files does work as expected. However, receiving files does not work. Some change seems to cause an incompatibility here...

fm-sys avatar Aug 27 '22 11:08 fm-sys

Switching the server automatically isn't a good idea IMHO (although I had initially suggested it)

Still it would be nice to make switching the server more easy which is discussed in #183

Furthermore we show an info dialog if the server is down. We could directly link to the server switching page in these cases.

fm-sys avatar Mar 28 '23 16:03 fm-sys