Skip to content

Conversation

@ouchadam
Copy link
Contributor

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

  • Includes the EditHomeserver flow when handling certificate trusting
  • Removes the mutable HomeserverConfig state in favour of recreating when needed (when trusting the certificate) which massively simplifies the unit testing setup
  • Supplies a retryAction when creating the CertificateError, avoids needing non persisted mutable state in the view model and reduces unit test setup

Motivation and context

Fixes #6864 - Certificate trusting during the edit homeserver flow doing nothing

Screenshots / GIFs

Before After
before-trust-server-ca after-allow-trusting-ca-during-edits

Tests

  • Set your device time to the past (to cause the certificate to become invalid)
  • Whilst signed out, enter the I already have an account flow
  • Tap EDIT
  • Tap next with matrix.org selected
  • Notice the certificate trust dialog, tap next and nothing happens

Tested devices

  • Physical
  • Emulator
  • OS version(s): 31

@ouchadam ouchadam added the Z-FTUE Issue is relevant to the first time use project or experience label Aug 18, 2022
@ouchadam ouchadam requested review from a team and fedrunov and removed request for a team August 18, 2022 10:35
?.let { startAuthenticationFlow(finalLastAction, it, serverTypeOverride = null) }
}
when (action.retryAction) {
is OnboardingAction.HomeServerChange -> handleHomeserverChange(action.retryAction, fingerprint = action.fingerprint)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

is OnboardingAction.HomeServerChange.SelectHomeServer to is OnboardingAction.HomeServerChange is the fix, the other changes are refactors to enable unit testing the change

.build()
action.retryAction,
// Will be replaced by the task
homeServerConnectionConfigFactory.create("https://dummy.org", action.fingerprint)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

reuses the factory to avoid directly interacting with android's Uri and making the change untestable without further refactors

- allows a retryAction to be provided to the event to avoid mutatble state within the view model along with providing a clear path of execution
- which in turn allows the android Uri to be bypassed and a unit test around the direct local certificate case added
…rtificate accept action

- adds unit tests around the edit/selection cases
@ouchadam ouchadam force-pushed the feature/adm/allow-trusting-certificates branch from 47f1e2e to e948fe0 Compare August 18, 2022 10:41
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

81.2% 81.2% Coverage
0.0% 0.0% Duplication

@ouchadam ouchadam added the Z-NextRelease For issues and PRs which should be included in the NextRelease. label Aug 22, 2022
Copy link
Contributor

@fedrunov fedrunov left a comment

Choose a reason for hiding this comment

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

LGTM

@ouchadam ouchadam merged commit 9b57630 into develop Aug 22, 2022
@ouchadam ouchadam deleted the feature/adm/allow-trusting-certificates branch August 22, 2022 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-FTUE Issue is relevant to the first time use project or experience Z-NextRelease For issues and PRs which should be included in the NextRelease.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Private CA issue

3 participants