Skip to content

Conversation

@BillCarsonFr
Copy link
Member

@BillCarsonFr BillCarsonFr commented Oct 25, 2021

Fixes #4263

Adds a new lab option to enable auto reporting of fail to decrypt errors. When detected the device will send a rageshake and then send a toDevice message to the other participant to request him to also upload a RS.

image

The AutoRageShake and UISIs detection part has been put in the app side, and in order to do that I added to new services in the SDK:

  • SendToDeviceService: A service that allows to send to device messages (needed by AutoRageshaker in order to ask for the matching rageshake)
  • EventStreamService: Provides entry points needed by the UISI detector (could not be done by listening at the db events..)

@ganfra / @bmarty If you could have a quick look on the SDK part and give some feedbaks

Sample report
https://github.com/matrix-org/element-android-rageshakes/issues/27579

@github-actions
Copy link

github-actions bot commented Oct 25, 2021

Unit Test Results

  66 files  ±0    66 suites  ±0   52s ⏱️ -1s
135 tests ±0  135 ✔️ ±0  0 💤 ±0  0 ±0 
418 runs  ±0  418 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit a047bcb. ± Comparison against base commit 32f2e7d.

♻️ This comment has been updated with latest results.

@bmarty
Copy link
Member

bmarty commented Nov 19, 2021

@ganfra / @bmarty If you could have a quick look on the SDK part and give some feedbaks

Will do, I was waiting for the PR to not be draft to just read the description :/

@BillCarsonFr BillCarsonFr force-pushed the feature/bca/auto_uisi branch 2 times, most recently from 73b143d to f6dc2af Compare December 6, 2021 08:37
@BillCarsonFr BillCarsonFr marked this pull request as ready for review December 6, 2021 10:43
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.

Some small first remarks.
Weird to expose a ToDeviceService, but why not...

import javax.inject.Inject

internal class DefaultToDeviceService @Inject constructor(
private val sendToDeviceTask: DefaultSendToDeviceTask,
Copy link
Member

Choose a reason for hiding this comment

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

The type must be SendToDeviceTask

Copy link
Member Author

Choose a reason for hiding this comment

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

done

abstract fun bindToDeviceService(deviceService: DefaultToDeviceService): ToDeviceService

@Binds
abstract fun bindEventStreamService(deviceService: DefaultEventStreamService): EventStreamService
Copy link
Member

Choose a reason for hiding this comment

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

Could be grouped with the other services. Also rename param to service (at 2 places)

Copy link
Member Author

Choose a reason for hiding this comment

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

done

private val listeners = mutableListOf<LiveEventListener>()

fun addLiveEventListener(listener: LiveEventListener) {
Timber.v("## VALR: addLiveEventListener")
Copy link
Member

Choose a reason for hiding this comment

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

use logger tag instead of VALR :)

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, just a temporary log that I forgot to remove

@BillCarsonFr BillCarsonFr force-pushed the feature/bca/auto_uisi branch 3 times, most recently from e9cf9e8 to e56bb1a Compare January 4, 2022 08:57
"device_id" to target.senderDeviceId,
"user_id" to target.senderUserId,
"sender_key" to target.senderKey,
"matching_issue" to reportUrl
Copy link

Choose a reason for hiding this comment

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

matching_issue is a confusing name for this field, I'd expect that to be a link to a github issue or something; how would you feel about something more like recipient_rageshake?

Copy link

Choose a reason for hiding this comment

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

Sorry, didn't realize the rageshake server actually does create a github issue and responds with that; I'd had that disabled in my tests, and assumed we were looking at the URL of the submitted rageshake.

Copy link
Member Author

Choose a reason for hiding this comment

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

I renamed matching_issue to recipient_rageshake.
Also align with the Z-UISI name for the issue label

@BillCarsonFr BillCarsonFr force-pushed the feature/bca/auto_uisi branch from 793ac6b to bbc7e4c Compare January 6, 2022 15:37
android:defaultValue="false"
android:key="SETTINGS_LABS_USE_RESTRICTED_JOIN_RULE"
android:summary="@string/labs_use_restricted_join_rule_desc"
android:title="@string/labs_use_restricted_join_rule" />
Copy link
Member

Choose a reason for hiding this comment

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

This removal will need more cleanup in the code, and not really related to this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed will restore and creating separate PR

Copy link
Member Author

Choose a reason for hiding this comment

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

PR up here #4889

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.

LGTM

@bmarty bmarty requested a review from ganfra January 7, 2022 13:40
Copy link
Member

@ganfra ganfra left a comment

Choose a reason for hiding this comment

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

Nice work! I don't see any issue like that. Performance wise, it should be ok I guess as long as there is not too many listeners on EventStreamService.
Other way of doing that is exposing Flows of event.
Maybe we should at least make them suspend methods? (LiveEventListener)

@BillCarsonFr BillCarsonFr force-pushed the feature/bca/auto_uisi branch from bbc7e4c to a047bcb Compare January 10, 2022 08:46
@github-actions
Copy link

Ktlint Results

👍 ✅ 👍

@BillCarsonFr BillCarsonFr merged commit 30aae3f into develop Jan 10, 2022
@BillCarsonFr BillCarsonFr deleted the feature/bca/auto_uisi branch January 10, 2022 13: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.

[EA] Implement opt-in lab auto rageshake UISIs

5 participants