mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
more validation
This commit is contained in:
parent
94b0cfbd72
commit
17412bbb2f
@ -140,7 +140,7 @@ export class SyncWriter {
|
|||||||
|
|
||||||
async _writeTimeline(entries, timeline, currentKey, trackNewlyJoined, txn) {
|
async _writeTimeline(entries, timeline, currentKey, trackNewlyJoined, txn) {
|
||||||
const memberChanges = new Map();
|
const memberChanges = new Map();
|
||||||
if (timeline.events) {
|
if (Array.isArray(timeline.events)) {
|
||||||
const events = deduplicateEvents(timeline.events);
|
const events = deduplicateEvents(timeline.events);
|
||||||
for(const event of events) {
|
for(const event of events) {
|
||||||
// store event in timeline
|
// store event in timeline
|
||||||
@ -220,6 +220,7 @@ export class SyncWriter {
|
|||||||
// important this happens before _writeTimeline so
|
// important this happens before _writeTimeline so
|
||||||
// members are available in the transaction
|
// members are available in the transaction
|
||||||
const memberChanges = await this._writeStateEvents(roomResponse, trackNewlyJoined, txn);
|
const memberChanges = await this._writeStateEvents(roomResponse, trackNewlyJoined, txn);
|
||||||
|
// TODO: remove trackNewlyJoined and pass in memberChanges
|
||||||
const timelineResult = await this._writeTimeline(entries, timeline, currentKey, trackNewlyJoined, txn);
|
const timelineResult = await this._writeTimeline(entries, timeline, currentKey, trackNewlyJoined, txn);
|
||||||
currentKey = timelineResult.currentKey;
|
currentKey = timelineResult.currentKey;
|
||||||
// merge member changes from state and timeline, giving precedence to the latter
|
// merge member changes from state and timeline, giving precedence to the latter
|
||||||
|
Loading…
Reference in New Issue
Block a user