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

Ensure sessionPath is not reused for different homeserver. Fixes not loading media issue. #3299

Merged
merged 2 commits into from
Aug 12, 2024

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Aug 12, 2024

Content

Ensure the folder sessionPath is not reused for different homeserver, else some cached data may be wrong.
Rotate the folder and delete the previous one. One side effect is described in #3296 because API to get authentication media may or may not be available and this capability is stored in cache.

Motivation and context

Closes #3296

Screenshots / GIFs

NA

Tests

  • No session
  • Continue with matrix.org but do not enter credentials.
  • Go back
  • Change the homeserver with one which does not support authenticated media (for instance element.io)
  • Login to this homeserver

Before: media cannot be loaded
After: media can be loaded.

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 bmarty requested a review from a team as a code owner August 12, 2024 12:22
@bmarty bmarty requested review from jmartinesp and removed request for a team August 12, 2024 12:22
@bmarty bmarty mentioned this pull request Aug 12, 2024
@bmarty bmarty added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Aug 12, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Aug 12, 2024
Copy link
Contributor

github-actions bot commented Aug 12, 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/V3jwKP

@bmarty bmarty added the PR-Bugfix For bug fix label Aug 12, 2024
Copy link

codecov bot commented Aug 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.56%. Comparing base (498f843) to head (01ece74).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3299   +/-   ##
========================================
  Coverage    82.56%   82.56%           
========================================
  Files         1662     1662           
  Lines        38992    38992           
  Branches      4724     4724           
========================================
  Hits         32193    32193           
  Misses        5133     5133           
  Partials      1666     1666           

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

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, thanks!

@@ -117,8 +126,9 @@ class RustMatrixAuthenticationService @Inject constructor(

override suspend fun setHomeserver(homeserver: String): Result<Unit> =
withContext(coroutineDispatchers.io) {
val emptySessionPath = rotateSessionPath()
Copy link
Member

Choose a reason for hiding this comment

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

Maybe newSessionPath?

Copy link

sonarcloud bot commented Aug 12, 2024

@bmarty bmarty merged commit 45775d7 into develop Aug 12, 2024
25 checks passed
@bmarty bmarty deleted the feature/bma/rotateSessionPath branch August 12, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Bugfix For bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Media failing to load
2 participants