more validation
This commit is contained in:
parent
94b0cfbd72
commit
17412bbb2f
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||||
|
|
Reference in a new issue