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

Linking device appears to silently fail #250

Closed
OrderlyUnicode opened this issue Oct 28, 2023 · 12 comments · Fixed by #255
Closed

Linking device appears to silently fail #250

OrderlyUnicode opened this issue Oct 28, 2023 · 12 comments · Fixed by #255

Comments

@OrderlyUnicode
Copy link

Upon running gurk for a second time (and subsequent times after) the app simply creates a new QR code to use for linking the device. My guess is that it is failing the first time and afterwards, because under "linked devices" on Signal on my phone, the only link shown is the one I established with the official app. No error is being shown, even when using the --verbose argument, so I assume it's silently failing and trying again when I try to run it again.

On the off chance it's relevant, I'm using the gurk-bin package from the AUR, version 0.4.0-1. The device I'm using to link it via QR code is running version 6.37.2 of the official Signal app on Android.

@devnibo
Copy link

devnibo commented Oct 30, 2023

Same error on my side. I also use the AUR package gurk-bin.

@devnibo
Copy link

devnibo commented Oct 30, 2023

I tried to fix it myself but didn't succeed yet. What I tried so far is adding anyhow::Error in two places. That didn't work.

diff --git a/src/main.rs b/src/main.rs
index b9aae90..c5f5a3c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -91,7 +91,7 @@ pub enum Event {
     AppEvent(gurk::event::Event),
 }
 
-async fn run_single_threaded(relink: bool) -> anyhow::Result<()> {
+async fn run_single_threaded(relink: bool) -> anyhow::Result<(), anyhow::Error> {
     let (mut signal_manager, config) = signal::ensure_linked_device(relink).await?;
 
     let mut storage: Box<dyn Storage> = if config.sqlite.enabled {
diff --git a/src/signal/mod.rs b/src/signal/mod.rs
index 4490ec1..bb9e510 100644
--- a/src/signal/mod.rs
+++ b/src/signal/mod.rs
@@ -30,7 +30,7 @@ pub type GroupIdentifierBytes = [u8; GROUP_IDENTIFIER_LEN];
 ///    path.
 pub async fn ensure_linked_device(
     relink: bool,
-) -> anyhow::Result<(Box<dyn SignalManager>, Config)> {
+) -> anyhow::Result<(Box<dyn SignalManager>, Config), anyhow::Error> {
     let config = Config::load_installed()?;
     let db_path = config
         .as_ref()

Maybe someone could point me in the right direction?

@boxdot
Copy link
Owner

boxdot commented Nov 6, 2023

Thank you for reporting. I will try to improve the error reporting and come back.

@SloppyPuppy
Copy link

Bump, same issue running gurk-bin 0.4.0-1, signal offical 6.39.1, also to note in signal app it says link successful, but it never shows up with a newly linked device, and if I spam trying to link it shows network error instead of link successful.

@boxdot
Copy link
Owner

boxdot commented Nov 10, 2023

Bump, same issue running gurk-bin 0.4.0-1, signal offical 6.39.1, also to note in signal app it says link successful, but it never shows up with a newly linked device, and if I spam trying to link it shows network error instead of link successful.

If you link to often, they definitely rate limit you. JFYI: I am still looking into this issue.

@dvn0
Copy link

dvn0 commented Nov 11, 2023

I'm also experiencing something similar. Using the latest release of gurk (0.4.1) and I can get the initial link to show up on my official signal client but when I close and open gurk then it tries to link again.

@boxdot
Copy link
Owner

boxdot commented Nov 15, 2023

I just tried to link with fresh installation. Basically, the application hangs on

2023-11-15T14:46:08.758967Z  INFO presage::manager: waiting for contacts sync for up to 60 seconds

Stopping it with CTRL-C and restarting, start an empty application which works though.

@chmanie
Copy link

chmanie commented Nov 15, 2023

Seems to work with the newest build! Although my sent messages are not synced from desktop to phone. Don't know if this has been an issue before.

@boxdot
Copy link
Owner

boxdot commented Nov 15, 2023

Seems to work with the newest build! Although my sent messages are not synced from desktop to phone. Don't know if this has been an issue before.

There was a bug which did not handle sync messages from other devices in groups. It was recently fixed here: #251. But there is another one, which is more subtle. My guess is that something is wrong with syncing prekeys. This is also what I am debugging right now.

@jacksongoode
Copy link

Currently failing to link with the latest build.

@boxdot
Copy link
Owner

boxdot commented Dec 12, 2023

Digging deeper. The provisioning stage succeeds in presage, but what fails is the confirmation stage confirm_device.

[2023-12-12T21:40:01Z DEBUG libsignal_service_hyper::push_service] HTTP request PUT https://chat.staging.signal.org/v1/devices/37e7dd74-4c95-4b8a-adff-26b6a3043a50.1702417201329:Eh2fKUYZX6U0mH7c3WelCrbpajw0Wl_LILpnrpHR7vg=
[2023-12-12T21:40:02Z TRACE libsignal_service_hyper::push_service] Unhandled response 405 with body: {"code":405,"message":"HTTP 405 Method Not Allowed"}
ProvisioningError(ServiceError(UnhandledResponseCode { http_code: 405 }))

boxdot added a commit that referenced this issue Dec 18, 2023
This commit upgrades presage to the latest available version. In
particular, It includes the fix for the linking of secondary devices.

For reference, the fix was done in:

<whisperfish/presage#220>
<whisperfish/presage#221>
<whisperfish/libsignal-service-rs#271>

Closes #250
boxdot added a commit that referenced this issue Dec 18, 2023
This commit upgrades presage to the latest available version. In
particular, It includes the fix for the linking of secondary devices.

For reference, the fix was done in:

<whisperfish/presage#220>
<whisperfish/presage#221>
<whisperfish/libsignal-service-rs#271>

Closes #250
@pawamoy
Copy link

pawamoy commented Feb 24, 2024

Hmmm, gurk-bin from AUR is still in v0.4.0, while thix fix was released in v0.4.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants