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 public device keys to rageshakes #2893

Merged
merged 7 commits into from
May 24, 2024

Conversation

BillCarsonFr
Copy link
Member

Fixes #2857

The MatrixClientProvider is now injected into DefaultBugReporter, to allow to access to new properties exposed in the EncrytionService (deviceCurve25519(), deviceed25519())

I added a new test to assert the form data part added in the request by the BugReporter

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Motivation and context

Screenshots / GIFs

Tests

  • Step 1
  • Step 2
  • Step ...

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

@BillCarsonFr BillCarsonFr requested a review from a team as a code owner May 22, 2024 07:43
@BillCarsonFr BillCarsonFr requested review from bmarty and removed request for a team May 22, 2024 07:43
Copy link
Contributor

github-actions bot commented May 22, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/wkVRG5

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks for the new test!
I think EXPECTED_NUMBER_OF_PROGRESS_VALUE will have to be changed to 18

@@ -156,6 +160,19 @@ class DefaultBugReporter @Inject constructor(
.addFormDataPart("user_id", userId)
.addFormDataPart("can_contact", canContact.toString())
.addFormDataPart("device_id", deviceId)
.apply {
userId.takeIf { MatrixPatterns.isUserId(it) }?.let {
SessionId(it)
Copy link
Member

Choose a reason for hiding this comment

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

sessionData?.userId is guaranteed to be a valid userId, so to simplify, I would change line 148 from
val userId = sessionData?.userId ?: "undefined"
to
val userId = sessionData?.userId?.let { UserId(it) }

and use ?: "undefined" at line 148.

Please be aware that the value can still be null (user can send bug report before having a session.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

Copy link

codecov bot commented May 22, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 75.25%. Comparing base (3f46544) to head (141e835).
Report is 10 commits behind head on develop.

Files Patch % Lines
...ures/rageshake/impl/reporter/DefaultBugReporter.kt 60.00% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2893      +/-   ##
===========================================
+ Coverage    75.23%   75.25%   +0.01%     
===========================================
  Files         1550     1550              
  Lines        36954    36966      +12     
  Branches      7152     7156       +4     
===========================================
+ Hits         27803    27817      +14     
+ Misses        5415     5412       -3     
- Partials      3736     3737       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BillCarsonFr
Copy link
Member Author

Thanks for the new test! I think EXPECTED_NUMBER_OF_PROGRESS_VALUE will have to be changed to 18

The existing test was happy because we don't add that part if the keys are null. So I added the listener in the other test to ensure that we have one more thing reported

@BillCarsonFr BillCarsonFr requested a review from bmarty May 22, 2024 09:35
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks for the update!

@BillCarsonFr BillCarsonFr force-pushed the feature/valere/add_device_keys_to_rs branch from ab9affe to c45628f Compare May 23, 2024 11:31
@BillCarsonFr BillCarsonFr force-pushed the feature/valere/add_device_keys_to_rs branch from 49daf53 to 984575d Compare May 23, 2024 15:15
Copy link

sonarcloud bot commented May 23, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@bmarty bmarty added the Run-Maestro Starts a Maestro Cloud session to run integration tests label May 24, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label May 24, 2024
@BillCarsonFr BillCarsonFr merged commit 544d064 into develop May 24, 2024
24 of 25 checks passed
@BillCarsonFr BillCarsonFr deleted the feature/valere/add_device_keys_to_rs branch May 24, 2024 14:13
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.

Rageshakes lack device_keys metadata, making it hard to search for senders of UTD messages
2 participants