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

Diana/fix auxin registration #69

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

cxloe
Copy link
Contributor

@cxloe cxloe commented May 4, 2022

No description provided.

@DianaNites DianaNites force-pushed the diana/fix-auxin-registration branch from 719550b to c76dde9 Compare May 4, 2022 21:21
@DianaNites DianaNites removed their request for review May 4, 2022 21:22
@DianaNites DianaNites marked this pull request as ready for review May 5, 2022 17:17
@cxloe
Copy link
Contributor Author

cxloe commented May 5, 2022

might not be quite ready yet.. @technillogue can you test this when you get a chance?

@cxloe
Copy link
Contributor Author

cxloe commented May 5, 2022

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.

@cxloe cxloe requested review from NotGyro and itdaniher and removed request for NotGyro May 11, 2022 22:59
@DianaNites DianaNites removed their assignment Jul 18, 2022
Copy link
Contributor

@iamalwaysuncomfortable iamalwaysuncomfortable left a 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));
Copy link
Contributor

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?

Comment on lines +570 to +573
serde_json::error::Category::Data
| serde_json::error::Category::Syntax
| serde_json::error::Category::Eof => RecipientsStore::new(self),
_ => Err(e)?,
Copy link
Contributor

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?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let _profile: auxin::profile::ProfileResponse = res.json().await?;
let _: auxin::profile::ProfileResponse = res.json().await?;

Copy link
Contributor

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")
Copy link
Contributor

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.

Copy link
Contributor

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?
Copy link
Contributor

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?

Copy link
Contributor

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.

@cxloe
Copy link
Contributor Author

cxloe commented Jul 25, 2022

getting this fixed and merged would be great on account of mobilecoinofficial/forest#220

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.

4 participants