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

AsyncAction confirming with param #3667

Merged
merged 4 commits into from
Oct 15, 2024

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Oct 14, 2024

Content

  • Let AsyncAction.Confirming be an interface, with a AsyncAction.ConfirmingNoParams data object.
    This will allow inheritance of AsyncAction.Confirming with parameter(s).
  • AcceptDeclineInviteState: create ConfirmingDeclineInvite to host InviteData when confirming decline of invite.

Replacement for #3645 (other change from #3645 will be in separate PRs.)
Can be reviewed commit per commit

Motivation and context

Improve code when confirmation need data to be rendered.

Screenshots / GIFs

Tests

  • No behavior change.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

bmarty and others added 4 commits October 14, 2024 10:49
@bmarty bmarty requested a review from a team as a code owner October 14, 2024 09:39
@bmarty bmarty requested review from ganfra and removed request for a team October 14, 2024 09:39
@bmarty bmarty mentioned this pull request Oct 14, 2024
10 tasks
Copy link
Contributor

📱 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/FwrZ7D

Copy link

sonarcloud bot commented Oct 14, 2024

@bmarty bmarty added the PR-Misc For other changes label Oct 14, 2024
Copy link

codecov bot commented Oct 14, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 5 lines in your changes missing coverage. Please review.

Project coverage is 82.81%. Comparing base (792fdb3) to head (ca4f906).
Report is 29 commits behind head on develop.

Files with missing lines Patch % Lines
...es/invite/impl/response/AcceptDeclineInviteView.kt 50.00% 1 Missing and 1 partial ⚠️
...d/features/lockscreen/impl/unlock/PinUnlockView.kt 0.00% 0 Missing and 1 partial ⚠️
...mbers/moderation/RoomMembersModerationPresenter.kt 50.00% 1 Missing ⚠️
...atures/verifysession/impl/VerifySelfSessionView.kt 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3667      +/-   ##
===========================================
- Coverage    82.81%   82.81%   -0.01%     
===========================================
  Files         1747     1748       +1     
  Lines        41779    41771       -8     
  Branches      5107     5106       -1     
===========================================
- Hits         34599    34592       -7     
  Misses        5365     5365              
+ Partials      1815     1814       -1     

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

@bmarty bmarty changed the title Feature/bma/async action confirming with param AsyncAction confirming with param Oct 14, 2024
Copy link
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

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

LGTM, just a comment.

Comment on lines +49 to +50
// Note: confirming will always be of type ConfirmingDeclineInvite.
if (confirming is ConfirmingDeclineInvite) {
Copy link
Member

Choose a reason for hiding this comment

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

Can't we just force cast it then?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could but why take the risk of a crash?
Previous code was not val invite = state.invite!!, so I prefer to keep the code safe.

Copy link
Member

Choose a reason for hiding this comment

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

We could but why take the risk of a crash?

Can we then log an error or upload some error report to sentry? I'm worried this might just silently fail, although the tests should cover it.

Copy link
Member Author

Choose a reason for hiding this comment

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

My previous attempt to fix this would have avoid this drawback. But it was too invasive, so we go with this approach. This is not a new issue, so I guess this is fine.

@bmarty bmarty added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Oct 15, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Oct 15, 2024
@bmarty bmarty enabled auto-merge October 15, 2024 08:52
@bmarty bmarty disabled auto-merge October 15, 2024 10:27
@bmarty bmarty merged commit a4966ef into develop Oct 15, 2024
32 of 34 checks passed
@bmarty bmarty deleted the feature/bma/asyncActionConfirmingWithParam branch October 15, 2024 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Misc For other changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants