Skip to content

Revert "refactor(ffi): Remove unused Session::homeserver_url value"#5876

Merged
Hywan merged 2 commits into
mainfrom
revert-5874-refactor/safer-client-builder
Nov 18, 2025
Merged

Revert "refactor(ffi): Remove unused Session::homeserver_url value"#5876
Hywan merged 2 commits into
mainfrom
revert-5874-refactor/safer-client-builder

Conversation

@jmartinesp

Copy link
Copy Markdown
Contributor

This reverts commit 4eb3cc9.Reverts #5874

Turns out this didn't make the ClientBuilder safer but completely broke it when the server is not reachable and we try to restore a session. The complement crypto PR is: matrix-org/complement-crypto#217.

@jmartinesp jmartinesp requested a review from a team as a code owner November 18, 2025 13:06
@jmartinesp jmartinesp requested review from Hywan and removed request for a team November 18, 2025 13:06

@Hywan Hywan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see how this value is used. Where is it used/read?

@jmartinesp

jmartinesp commented Nov 18, 2025

Copy link
Copy Markdown
Contributor Author

We use it in the clients, to be able to save it locally to our own DB, which we will later read from and use this info to restore the client.

I thought we didn't need this anymore, but it seems like I completely misunderstood how this is used. The problem is now we need something that allows us to restore the server name and the HS url and not trigger a HS discovery request if we already had some server info.

However, I'm not sure how feasible this is at the moment since we don't have a way to check the StateStore before the parent Client is created if I'm not mistsaken. Maybe we could create an instance of it, use it just for this check, then drop it before creating the Client.


Well, that isn't possible because BaseStateStore is only present in the matrix-sdk-base crate...

@jmartinesp jmartinesp enabled auto-merge (rebase) November 18, 2025 13:20
@codspeed-hq

codspeed-hq Bot commented Nov 18, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #5876 will not alter performance

Comparing revert-5874-refactor/safer-client-builder (3341e80) with main (1c22d0b)

Summary

✅ 50 untouched

@jmartinesp jmartinesp disabled auto-merge November 18, 2025 14:16
@Hywan Hywan enabled auto-merge (rebase) November 18, 2025 14:58
@Hywan Hywan disabled auto-merge November 18, 2025 14:58
@Hywan Hywan merged commit d860749 into main Nov 18, 2025
74 of 80 checks passed
@Hywan Hywan deleted the revert-5874-refactor/safer-client-builder branch November 18, 2025 14:58
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.

2 participants