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

If android intent is triggered more than once, a connecting loop is triggered and you can't disconnect #8013

Closed
brettjenkins opened this issue May 1, 2023 · 10 comments · Fixed by tailscale/tailscale-android#95
Labels

Comments

@brettjenkins
Copy link

What is the issue?

As mentioned on tailscale/tailscale-android#87

If a connect intent is triggered more than once, or while the VPN is already connected, on disconnect the VPN will reconnect.

Steps to reproduce

No response

Are there any recent changes that introduced the issue?

tailscale/tailscale-android#87

OS

Android

OS version

No response

Tailscale version

No response

Other software

No response

Bug report

No response

@brettjenkins
Copy link
Author

Can't assign myself, but I'm fixing this bug that I introduced

brettjenkins added a commit to brettjenkins/tailscale-android that referenced this issue May 1, 2023
if start intent called more than once

Fixes: tailscale/tailscale#8013

Signed-off-by: Brett Jenkins <brett@brettjenkins.co.uk>
brettjenkins added a commit to brettjenkins/tailscale-android that referenced this issue May 30, 2023
Turns out there were still some cases where the bug would occur, also it turns out checking the status of a VPN connection isn't foolproof in android, so this is a safer way to fix it, we just ensure that the autoConnect var is set to false when disconnecting.

Fixes: tailscale/tailscale#8013

Signed-off-by: Brett Jenkins <brett@brettjenkins.co.uk>
brettjenkins added a commit to brettjenkins/tailscale-android that referenced this issue May 30, 2023
Turns out there were still some cases where the bug would occur, also it turns out checking the status of a VPN connection isn't foolproof in android, so this is a safer way to fix it, we just ensure that the autoConnect var is set to false when disconnecting.

Fixes: tailscale/tailscale#8013

Signed-off-by: Brett Jenkins <brett@brettjenkins.co.uk>
@tailscale tailscale deleted a comment from plia7 Jun 17, 2023
@plia7
Copy link

plia7 commented Jun 20, 2023

@DentonGentry Hello, when could we expect the fix that @brettjenkins committed/checked in 3 weeks ago to be part of the build/new version? I'm using Android 11 Tailscale app version 1.42.0 and I'm having this issue still when trying to use the disconnect intent, it disconnects and then it reconnects unexpectedly.

Thank you.

UPDATE: I got it working without the fix, all you need to do is to send the disconnect intent twice, just give like a 5 seconds wait after each send intent... works like a charm.

@rsm86
Copy link

rsm86 commented Jul 2, 2023

@DentonGentry Hello, when could we expect the fix that @brettjenkins committed/checked in 3 weeks ago to be part of the build/new version? I'm using Android 11 Tailscale app version 1.42.0 and I'm having this issue still when trying to use the disconnect intent, it disconnects and then it reconnects unexpectedly.

Thank you.

UPDATE: I got it working without the fix, all you need to do is to send the disconnect intent twice, just give like a 5 seconds wait after each send intent... works like a charm.

Just tried this out, can confirm that it worked for me! Thanks!

Edit: might have spoken too soon. It's not working anymore for me. Even going into the main app and trying to deactivate the VPN on the main window is not working. It just reactivates itself immediately...

@mlschoeneman
Copy link

@plia7 @rsm86 I have tried the workaround, disconnect intent twice with a 5 second wait, but am still getting the same bug of the reconnecting loop. Could you provide a screenshot of your task?

@shlomki
Copy link

shlomki commented Jul 2, 2023

@plia7 @rsm86 I have tried the workaround, disconnect intent twice with a 5 second wait, but am still getting the same bug of the reconnecting loop. Could you provide a screenshot of your task?

Try 500ms.
5 seconds was too long for me too, I changed it to 500ms and it worked 👍

@mlschoeneman
Copy link

@plia7 @rsm86 I have tried the workaround, disconnect intent twice with a 5 second wait, but am still getting the same bug of the reconnecting loop. Could you provide a screenshot of your task?

Try 500ms. 5 seconds was too long for me too, I changed it to 500ms and it worked 👍

This didn't work either.

@plia7
Copy link

plia7 commented Jul 2, 2023

@plia7 @rsm86 I have tried the workaround, disconnect intent twice with a 5 second wait, but am still getting the same bug of the reconnecting loop. Could you provide a screenshot of your task?

Try 500ms. 5 seconds was too long for me too, I changed it to 500ms and it worked 👍

This didn't work either.

What tailscale app version are you using?
What's your phone/android version?
What tool do you use for the task?

@mlschoeneman
Copy link

@plia7 @rsm86 I have tried the workaround, disconnect intent twice with a 5 second wait, but am still getting the same bug of the reconnecting loop. Could you provide a screenshot of your task?

Try 500ms. 5 seconds was too long for me too, I changed it to 500ms and it worked 👍

This didn't work either.

What tailscale app version are you using? What's your phone/android version? What tool do you use for the task?

Tailscale App Version: 1.44.1
Phone: Google Pixel 6A
Android Version: 13 July 2023 Security & June 2023 Google Play
Use Tasker for task

@cy1der
Copy link

cy1der commented Jul 28, 2023

@plia7 @rsm86 I have tried the workaround, disconnect intent twice with a 5 second wait, but am still getting the same bug of the reconnecting loop. Could you provide a screenshot of your task?

Try 500ms. 5 seconds was too long for me too, I changed it to 500ms and it worked 👍

This didn't work either.

What tailscale app version are you using?
What's your phone/android version?
What tool do you use for the task?

I'm also experiencing the same thing, none of the aforementioned workarounds work for me.

Tailscale Version: 1.44.1-ta377e1363-g584245cc823
Phone: Google Pixel 6 Pro
Android Version: GrapheneOS Android 13 (TQ3A.230705.001)
Tool: Tasker

@plia7
Copy link

plia7 commented Jul 28, 2023

@plia7 @rsm86 I have tried the workaround, disconnect intent twice with a 5 second wait, but am still getting the same bug of the reconnecting loop. Could you provide a screenshot of your task?

Try 500ms. 5 seconds was too long for me too, I changed it to 500ms and it worked 👍

This didn't work either.

What tailscale app version are you using?
What's your phone/android version?
What tool do you use for the task?

I'm also experiencing the same thing, none of the aforementioned workarounds work for me.

Tailscale Version: 1.44.1-ta377e1363-g584245cc823
Phone: Google Pixel 6 Pro
Android Version: GrapheneOS Android 13 (TQ3A.230705.001)
Tool: Tasker

Well I have a different phone/os and I'm using Macrodroid. Maybe try Macrodroid too.

DentonGentry pushed a commit to tailscale/tailscale-android that referenced this issue Aug 5, 2023
* startvpnworker.java: prevent connecting loops

If start intent called more than once.

Turns out there were still some cases where the bug would occur, also it turns out checking the status of a VPN connection isn't foolproof in android, so this is a safer way to fix it, we just ensure that the autoConnect var is set to false when disconnecting.

Fixes: tailscale/tailscale#8013

Signed-off-by: Brett Jenkins <brett@brettjenkins.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants