Skip to content

Use the right base URL for the ESS config/well known endpoints - #7469

Open
jmartinesp wants to merge 4 commits into
developfrom
fix/use-the-right-base-url-for-ess-config-endpoint
Open

Use the right base URL for the ESS config/well known endpoints#7469
jmartinesp wants to merge 4 commits into
developfrom
fix/use-the-right-base-url-for-ess-config-endpoint

Conversation

@jmartinesp

@jmartinesp jmartinesp commented Aug 17, 2026

Copy link
Copy Markdown
Member

Content

  • Rename UrlContentFetcher to ClientUrlContentFetcher and add a couple server and homeserverUrl properties to it, so anything using the fetcher can use any of those as base URLs. This is needed for a Pro feature.
  • When we try to load a remote config from an endpoint and we don't find a valid value, store it as NotFound(needsRefresh = false) so we know we've already checked and there was nothing there. This should still trigger a request to fetch the value, but on background, not blocking. This was causing the session restoration to be slower than needed, since ContentScannerUrlProvider was trying to fetch the remote config.

FOSS part of https://github.com/element-hq/element-android-enterprise/pull/45

Motivation and context

  • Fix an issue where the incorrect ESS config URL was being created.
  • Fix the delay when restoring a client.

Tests

With Element Pro, check the right ESS config endpoint and alternatively the right well-known endpoints are checked.

Tested devices

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

Checklist

  • I am aware of the etiquette.
  • This PR was made with the help of AI:
    • Yes. In this case, please request a review by Copilot.
    • No.
  • Changes have been tested on an Android device or Android emulator with API 24
  • 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 defines what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

…ng base URL data (server name, homeserver URL)
Calculate the URL in `DefaultRemoteEnterpriseConfigRetriever` using the newly added `homserver` and `server` values as the possible base URLs, depending on the remote config source
@jmartinesp jmartinesp added the PR-Element-Pro for Element Pro specific changes label Aug 17, 2026
@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown
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/B3iLv3

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.63636% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.64%. Comparing base (8b2c207) to head (dfaae02).
⚠️ Report is 21 commits behind head on develop.

Files with missing lines Patch % Lines
...e/api/remoteconfig/RemoteEnterpriseConfigResult.kt 33.33% 2 Missing ⚠️
...atures/enterprise/impl/DefaultEnterpriseService.kt 0.00% 2 Missing ⚠️
.../features/enterprise/test/FakeEnterpriseService.kt 60.00% 2 Missing ⚠️
...braries/matrix/test/FakeClientUrlContentFetcher.kt 75.00% 1 Missing ⚠️
...es/matrix/test/FakeTemporaryMatrixClientFactory.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #7469   +/-   ##
========================================
  Coverage    80.64%   80.64%           
========================================
  Files         2758     2759    +1     
  Lines        80588    80594    +6     
  Branches     11029    11028    -1     
========================================
+ Hits         64989    64998    +9     
+ Misses       11342    11340    -2     
+ Partials      4257     4256    -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…ig when restoring a session

Add a `needsRefresh` parameter to `RemoteEnterpriseConfigResult.NotFound` to handle this, and store a `no-config` value in the store to indicate an endpoint has been checked and no config was found
@sonarqubecloud

Copy link
Copy Markdown

@jmartinesp
jmartinesp marked this pull request as ready for review August 18, 2026 15:33
@jmartinesp
jmartinesp requested a review from a team as a code owner August 18, 2026 15:33
@jmartinesp
jmartinesp requested review from bmarty and removed request for a team August 18, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-Element-Pro for Element Pro specific changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant