matrix-js-sdk
Process `m.room.encryption` events before emitting `RoomMember` events
#2910
Merged

Process `m.room.encryption` events before emitting `RoomMember` events #2910

richvdh merged 3 commits into develop from rav/fix_e2e_fail_in_new_room
richvdh
richvdh2 years ago (edited 2 years ago)

Fixes element-hq/element-web#23819.


Here's what your changelog entry will look like:

🐛 Bug Fixes

richvdh richvdh requested a review 2 years ago
richvdh richvdh requested a review from justjanne justjanne 2 years ago
richvdh richvdh requested a review from robintown robintown 2 years ago
richvdh richvdh added T-Defect
richvdh Update tests
1f387ba6
richvdh Call `Store.storeRoom` earlier
9fddae69
richvdh richvdh force pushed from 368b30d6 to 4ebcb43c 2 years ago
richvdh Call onCryptoEvent before processing state events
6ec8461b
richvdh richvdh force pushed from 4ebcb43c to 6ec8461b 2 years ago
justjanne
justjanne approved these changes on 2022-11-25
Conversation is marked as resolved
Show resolved
src/sync.ts
13891399
13901400 this.processEventsForNotifs(room, events);
13911401
1392 const processRoomEvent = async (e): Promise<void> => {
1393 client.emit(ClientEvent.Event, e);
1394 if (e.isState() && e.getType() == "m.room.encryption" && this.opts.crypto) {
1395 await this.opts.crypto.onCryptoEvent(e);
1396 }
1397 };
1398
1399 await utils.promiseMapSeries(stateEvents, processRoomEvent);
1400 await utils.promiseMapSeries(events, processRoomEvent);
1401 ephemeralEvents.forEach(function(e) {
1402 client.emit(ClientEvent.Event, e);
1403 });
1404 accountDataEvents.forEach(function(e) {
1405 client.emit(ClientEvent.Event, e);
1406 });
1402
const emitEvent = (e: MatrixEvent): boolean => client.emit(ClientEvent.Event, e);
justjanne2 years ago

This should make ESLint happy:

Suggested change
const emitEvent = (e: MatrixEvent): boolean => client.emit(ClientEvent.Event, e);
const emitEvent = (e: MatrixEvent): void => client.emit(ClientEvent.Event, e);
richvdh2 years ago

it seemed unhappy with void, but happy with boolean 🤷‍♂️

richvdh richvdh merged aaf3702c into develop 2 years ago
richvdh richvdh deleted the rav/fix_e2e_fail_in_new_room branch 2 years ago
richvdh richvdh restored the head branch 2 years ago

Login to write a write a comment.

Login via GitHub

Reviewers
Assignees
No one assigned
Labels
Milestone