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

Link device in JSON-RPC mode #445

Merged
merged 2 commits into from
Nov 13, 2023
Merged

Conversation

kxait
Copy link

@kxait kxait commented Nov 11, 2023

This PR adds the link-device functionality previously available in native to json-rpc. As signal-cli requires there to be a second request finishLink sent to actually link the device, this runs in a goroutine after the qr code is sent. The goroutine either finishes successfully, or dies after 1 minute due to signal-cli sending a failure message. (the result is available through debug logs).

To accomplish this, the receivedMessages chan had to be modified to actually be a map from "message id" (generated by us) to chan, indexed by the message receiver goroutine when a message is received and deleted after the result is parsed.
This is because when there was an ongoing finishLink "job" running, the chan listener would eat all the other responses, so the service locked up while waiting for messages.

Closes #433

@bbernhard bbernhard merged commit e446c8f into bbernhard:master Nov 13, 2023
2 checks passed
@bbernhard
Copy link
Owner

Looks good - thanks a lot!

@jamesoncollins
Copy link

Could something like this work for v1/register as well?

@bbernhard
Copy link
Owner

Could something like this work for v1/register as well?

What do you mean exactly?

@jamesoncollins
Copy link

Sorry, I didn't do enough research on this. You can ignore me.

I was trying to get v1/register working. I assumed that it required normal mode. I'm seeing that there just appears to be some ongoing issue with registering numbers.

AsamK/signal-cli#1545
AsamK/signal-cli#1373

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 this pull request may close these issues.

Link device in JSON-RPC mode
3 participants