Fix soft crash around inviting invalid MXIDs in start DM on first message flow (#9281)
* Fix soft crash around inviting invalid MXIDs * Make ts --strict happier * Prevent suggesting invalid MXIDs * Add tests * Fix coverage * Fix coverage * Make tsc --strict happier * Fix test * Add tests
This commit is contained in:
parent
4fec436883
commit
4a23630e06
6 changed files with 194 additions and 57 deletions
|
@ -94,6 +94,15 @@ describe('Permalinks', function() {
|
|||
expect(creator.serverCandidates.length).toBe(0);
|
||||
});
|
||||
|
||||
it('should gracefully handle invalid MXIDs', () => {
|
||||
const roomId = "!fake:example.org";
|
||||
const alice50 = makeMemberWithPL(roomId, "@alice:pl_50:org", 50);
|
||||
const room = mockRoom(roomId, [alice50]);
|
||||
const creator = new RoomPermalinkCreator(room);
|
||||
creator.load();
|
||||
expect(creator.serverCandidates).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should pick a candidate server for the highest power level user in the room', function() {
|
||||
const roomId = "!fake:example.org";
|
||||
const alice50 = makeMemberWithPL(roomId, "@alice:pl_50", 50);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue