Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Filter out upgraded rooms from autocomplete results #2830

Merged
merged 2 commits into from
Mar 27, 2019

Conversation

turt2live
Copy link
Member

Fixes element-hq/element-web#9289

Theory is that this shouldn't happen in the first place (aliases should be transferred), but there's evidently some cases where this doesn't work, or gets state reset.

Fixes element-hq/element-web#9289

Theory is that this shouldn't happen in the first place (aliases should be transferred), but there's evidently some cases where this doesn't work, or gets state reset.
@turt2live turt2live requested a review from a team March 26, 2019 21:13
src/autocomplete/RoomProvider.js Outdated Show resolved Hide resolved
const tombstone = r.room.currentState.getStateEvents("m.room.tombstone", "");
if (tombstone && tombstone.getContent() && tombstone.getContent()['replacement_room']) {
console.log(r.displayedAlias);
const hasReplacementRoom = matcherObjects.some(
Copy link
Contributor

Choose a reason for hiding this comment

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

This inner loop could slow down with big accounts I suppose? Wouldn't it be enough to exclude any rooms that have a tombstone event?

Copy link
Member Author

Choose a reason for hiding this comment

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

There's the possibility that, for some reason, the user hasn't joined the upgraded room and the alias is still pointing at the old room. Out of abundance of caution, we might as well verify the room. On my massive account of ~2000 rooms, there's no noticeable performance impact of adding this check (in fact, it feels faster...)

@turt2live turt2live merged commit 1c6f0b6 into develop Mar 27, 2019
@turt2live turt2live deleted the travis/autocomplete-ancient-history branch March 27, 2019 19:23
su-ex added a commit to SchildiChat/matrix-react-sdk that referenced this pull request Nov 4, 2022
* Fix default behavior of Room.getBlacklistUnverifiedDevices ([\matrix-org#2830](matrix-org/matrix-js-sdk#2830)). Contributed by @duxovni.
* Catch server versions API call exception when starting the client ([\matrix-org#2828](matrix-org/matrix-js-sdk#2828)). Fixes element-hq/element-web#23634.
* Fix authedRequest including `Authorization: Bearer undefined` for password resets ([\matrix-org#2822](matrix-org/matrix-js-sdk#2822)). Fixes element-hq/element-web#23655.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants