Fix a weird edge case with persisted empty event ids
No idea, how that happened and where it came from
This commit is contained in:
parent
795b8fb7dd
commit
c8a547630b
@ -2867,6 +2867,8 @@ Cache::clearTimeline(const std::string &room_id)
|
|||||||
if (passed_pagination_token) {
|
if (passed_pagination_token) {
|
||||||
if (obj.count("event_id") != 0) {
|
if (obj.count("event_id") != 0) {
|
||||||
std::string event_id = obj["event_id"].get<std::string>();
|
std::string event_id = obj["event_id"].get<std::string>();
|
||||||
|
|
||||||
|
if (!event_id.empty()) {
|
||||||
evToOrderDb.del(txn, event_id);
|
evToOrderDb.del(txn, event_id);
|
||||||
eventsDb.del(txn, event_id);
|
eventsDb.del(txn, event_id);
|
||||||
relationsDb.del(txn, event_id);
|
relationsDb.del(txn, event_id);
|
||||||
@ -2878,6 +2880,7 @@ Cache::clearTimeline(const std::string &room_id)
|
|||||||
msg2orderDb.del(txn, event_id);
|
msg2orderDb.del(txn, event_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
lmdb::cursor_del(cursor);
|
lmdb::cursor_del(cursor);
|
||||||
} else {
|
} else {
|
||||||
if (obj.count("prev_batch") != 0)
|
if (obj.count("prev_batch") != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user