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

Add labs flag to automatically rageshake on decryption errors #7307

Merged
merged 14 commits into from Jan 13, 2022

Conversation

duxovni
Copy link
Contributor

@duxovni duxovni commented Dec 8, 2021

Also sends a to-device message to the sender, prompting them to auto-rageshake too if they have this lab enabled as well.

Fixes element-hq/element-web#19430.

This should interoperate with element-hq/element-android#4325, although we don't currently provide the recipient's rageshake URL when asking the sender to rageshake, and we don't use any of the information provided in the to-device message yet.


This PR currently has no changelog labels, so will not be included in changelogs.

A reviewer can add one of: T-Deprecation, T-Enhancement, T-Defect, T-Task to indicate what type of change this is, or add Type: [enhancement/defect/task] to the description and I'll add them for you.

Preview: https://61e03a7db9323f64587c6f37--matrix-react-sdk.netlify.app
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.

Also sends a to-device message to the sender, prompting them to auto-rageshake too if they have this lab enabled as well.
@duxovni duxovni requested a review from a team as a code owner December 8, 2021 05:34
Copy link
Contributor

@SimonBrandner SimonBrandner left a comment

Choose a reason for hiding this comment

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

Just a question about styling, otherwise I am looking forward to seeing UISIs disappear! Thanks!

src/stores/AutoRageshakeStore.ts Outdated Show resolved Hide resolved
src/stores/AutoRageshakeStore.ts Outdated Show resolved Hide resolved
src/stores/AutoRageshakeStore.ts Outdated Show resolved Hide resolved
Co-authored-by: Šimon Brandner <simon.bra.ag@gmail.com>
@duxovni
Copy link
Contributor Author

duxovni commented Dec 8, 2021

Good catch, thank you!

src/Lifecycle.ts Outdated Show resolved Hide resolved
src/stores/AutoRageshakeStore.ts Outdated Show resolved Hide resolved
@duxovni
Copy link
Contributor Author

duxovni commented Dec 9, 2021

Thanks for the feedback; I haven't worked with AsyncStoreWithClient before, but I think I'm using it correctly based on the other examples in the codebase?

One other thing to note: In my local tests, when the recipient rageshakes and then asks the sender to rageshake as well, the sender's rageshake can fail with a 500, because the rageshake server assigns URIs based on timestamps with 1-second precision and the two rageshakes happen within the same second. I'm not sure if there's some option I should be setting in my local rageshake server instance to avoid these collisions, or if this is just a bug in the rageshake server, but it doesn't seem like it's within the scope of this PR in any case.

@t3chguy
Copy link
Member

t3chguy commented Dec 9, 2021

One other thing to note: In my local tests, when the recipient rageshakes and then asks the sender to rageshake as well, the sender's rageshake can fail with a 500, because the rageshake server assigns URIs based on timestamps with 1-second precision and the two rageshakes happen within the same second. I'm not sure if there's some option I should be setting in my local rageshake server instance to avoid these collisions, or if this is just a bug in the rageshake server, but it doesn't seem like it's within the scope of this PR in any case.

This seems like a major thing, yes outside of the scope of this PR but would potentially block this PR until fixed.

@duxovni duxovni requested a review from t3chguy December 16, 2021 17:56
src/settings/Settings.tsx Outdated Show resolved Hide resolved
src/stores/AutoRageshakeStore.ts Outdated Show resolved Hide resolved
@duxovni
Copy link
Contributor Author

duxovni commented Jan 6, 2022

Remaining todos after discussion with @BillCarsonFr:

  • Include link to matching issue in title so github will make it an actual link
  • Include information about the specific message that triggered the rageshake
  • Change matching_issue to recipient_rageshake to match Android

src/rageshake/submit-rageshake.ts Outdated Show resolved Hide resolved
src/stores/AutoRageshakeStore.ts Outdated Show resolved Hide resolved
src/stores/AutoRageshakeStore.ts Outdated Show resolved Hide resolved
src/stores/AutoRageshakeStore.ts Outdated Show resolved Hide resolved
@duxovni duxovni requested a review from t3chguy January 12, 2022 22:03
Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

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

Looks sane to me! Thanks :shipit:

Copy link
Member

@BillCarsonFr BillCarsonFr left a comment

Choose a reason for hiding this comment

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

LGTM

@duxovni duxovni merged commit 3eb5130 into develop Jan 13, 2022
@duxovni duxovni deleted the fayed/autorageshake branch January 13, 2022 15:55
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.

Implement opt-in lab auto rageshake UISIs
4 participants