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
Registration fixes for 2023 #238
Conversation
66f1604
to
30a1ec7
Compare
|
FWIW, Whisperfish diff: https://gitlab.com/whisperfish/whisperfish/-/merge_requests/481 |
|
Don't know if this is related to this specific PR, but it seems that https://github.com/whisperfish/libsignal-service-rs/blob/main/libsignal-service/src/provisioning/manager.rs#L173 is now a raw string Ex |
|
That would indeed be related, thanks for reporting. I have not been able to test this yet, because I don't have access to my second SIM. |
Yeah it's not easy with only one number, threw up my local fix as a separate PR here #240, it's nice in that it's just skipping some validation and shouldn't mess with any compatibility if someone were to unexpectedly have some old signal-compatible server they were testing against. |
|
Thanks! I've cherry-picked your commit into this PR. Were you able to confirm a device with the other patches in here? |
Nice, I can't test the registration flow at the moment because I also need another SIM, also, I'm using https://github.com/whisperfish/presage/ which breaks from the api-change here, would need to figure out how to rewire it first, do you know where the current sources for the java sdk is? All I can find are archived repos. But the link-device flow works after that change on this branch! I am getting this in the logs though: It seems that the socket is closed from Signal's side https://github.com/whisperfish/libsignal-service-rs/blob/main/libsignal-service/src/websocket.rs#L231, then the stream starts returning |
Everything is in Signal-Android these days. @gferon usually patches presage within a few days after I push things in here.
I think there's an issue about this. Because it doesn't necessarily harm the procedure, we didn't really bother at that point... |
Ah nice, thanks!
Makes sense, it doesn't really seem problematic |
FWIW, did you think of trying with your main SIM on staging servers? You could re-register infinitely (don't quote me on that) on the test servers. |
|
Mea culpa, the confirm code was not part of the registration procedure at all. Any way useful to get it in here, it's part of registration anyway. |
|
@direc85 confirms this works for Whisperfish. |
|
The registration session thingy would be really cool in a nice RegistrationSession state machine structure, but I'm a bit too lazy to actually implement that now... Updating the examples. |
|
@gferon this should be it. If you can throw some secondary eyes on it, feel free to hit merge! |
Codecov Report
@@ Coverage Diff @@
## main #238 +/- ##
========================================
- Coverage 4.16% 3.82% -0.34%
========================================
Files 36 36
Lines 2523 2746 +223
========================================
Hits 105 105
- Misses 2418 2641 +223
|
47d179f
to
43b2d4f
Compare
| @@ -227,6 +232,85 @@ pub struct WhoAmIResponse { | |||
| pub number: PhoneNumber, | |||
| } | |||
|
|
|||
| #[derive(Debug, Clone, Deserialize)] | |||
| #[serde(rename_all = "camelCase")] | |||
| pub struct RegistrationSessionMetadataResponse { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Java :')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I'll adapt presage immediately and check that it works as expected (although I read on the chat that somebody tried already.)
The registration procedure has changed a few months ago, and the old API has been terminated. This is an attempt to expose the new registration API surface for Whisperfish. All the other clients I know are secondary-only, so this shouldn't affect anyone but Whisperfish.