Fix room joining over federation not specifying vias or using aliases (#30641)

* Fix room joining over federation not specifying vias or using aliases

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Be consistent with viaServers

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Simplify modules

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Only consider canAskToJoin on 403 as per spec

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Remove unused helper which I only just added =(

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Add tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Add test

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Add tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2025-09-02 12:10:10 +01:00
committed by GitHub
parent 1b4a979b6c
commit 8fa3d7e4b7
11 changed files with 133 additions and 77 deletions
+10
View File
@@ -41,6 +41,7 @@ import RoomListStore from "../../../src/stores/room-list/RoomListStore";
import { DefaultTagID } from "../../../src/stores/room-list/models";
import { RoomNotificationStateStore } from "../../../src/stores/notifications/RoomNotificationStateStore";
import { NotificationLevel } from "../../../src/stores/notifications/NotificationLevel";
import { storeRoomAliasInCache } from "../../../src/RoomAliasCache.ts";
jest.useFakeTimers();
@@ -1217,6 +1218,15 @@ describe("SpaceStore", () => {
viewRoom(room1);
expect(store.activeSpace).toBe(MetaSpace.Home);
});
it("should check alias cache if switching to a room by alias", async () => {
viewRoom(room2);
storeRoomAliasInCache("#alias:server", room3, []);
store.setActiveSpace(space2, false);
defaultDispatcher.dispatch({ action: Action.ViewRoom, room_alias: "#alias:server" }, true);
expect(store.activeSpace).toBe(space1);
});
});
describe("traverseSpace", () => {