-
Notifications
You must be signed in to change notification settings - Fork 8
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
Diana/fix auxin registration #69
base: main
Are you sure you want to change the base?
Conversation
719550b
to
c76dde9
Compare
might not be quite ready yet.. @technillogue can you test this when you get a chance? |
Something with the recipients store is borked still, bots will need to message a user first in order to have a working session. Probably need to look into how signal-cli handles this. But registration seems to be working well. |
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.
Some small nits, but overall looks pretty good
} | ||
None => { | ||
store.last_id += 1; | ||
store.recipients.push(Recipient::new(store.last_id, self)); |
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.
Are there any consequences to transferring ownership here?
serde_json::error::Category::Data | ||
| serde_json::error::Category::Syntax | ||
| serde_json::error::Category::Eof => RecipientsStore::new(self), | ||
_ => Err(e)?, |
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.
Maybe import the errors directly @ the top of the file to cleanup the code?
.send() | ||
.await?; | ||
// TODO(Diana): We don't currently care about the response | ||
let _profile: auxin::profile::ProfileResponse = res.json().await?; |
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.
let _profile: auxin::profile::ProfileResponse = res.json().await?; | |
let _: auxin::profile::ProfileResponse = res.json().await?; |
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.
Does the result need to be driven by an await even? If it is, maybe it can be launched as a task instead of awaiting immediately and the handle can be awaited later when it's absolutely necessary to do so.
&mut rand::thread_rng(), | ||
)?; | ||
client | ||
.put("https://chat.signal.org/v1/profile") |
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.
These signal endpoint uris are moving targets - so Maybe we can have some sort of config enum that contains the endpoints data instead of hardcoding it.
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.
Yes, that was to-do list item #1 when I was planning to refactor Auxin. It really needs to be defined declarative somewhere rather than just having this string literal all over the place. Otherwise we can't use Signal testnet.
That might be out of the scope of this PR though.
.await?; | ||
|
||
// TODO(Diana): This endpoint seems to be hit, | ||
// but I don't think signal-cli saves its result? |
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.
What does this endpoint achieve for Auxin?
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.
Appears to be session magic within Signal's server. There's a good bit of that and none of it is documented. Try removing it and see what breaks.
getting this fixed and merged would be great on account of mobilecoinofficial/forest#220 |
No description provided.