mirror of
https://github.com/chatmail/core.git
synced 2026-09-22 13:01:21 +03:00
fix: Apply reactions that arrived before the message at later time (#8415)
A new table `pending_reactions` is now used, to store reactions that arrived before the referenced message. When receiving a new message, pending_reactions is checked and any reactions that arrived earlier are applied. Fixes: #8367 Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
This commit is contained in:
committed by
GitHub
parent
23c216c84b
commit
85db29bdfb
@@ -2505,6 +2505,23 @@ UPDATE msgs SET state=24 WHERE state=18; -- Change OutPreparing to OutFailed.
|
||||
.await?;
|
||||
}
|
||||
|
||||
inc_and_check(&mut migration_version, 158)?;
|
||||
if dbversion < migration_version {
|
||||
// Stores reactions to not-yet-received messages.
|
||||
sql.execute_migration(
|
||||
"CREATE TABLE pending_reactions (
|
||||
rfc724_mid TEXT NOT NULL,
|
||||
contact_id INTEGER NOT NULL,
|
||||
reaction TEXT NOT NULL,
|
||||
timestamp INTEGER NOT NULL,
|
||||
PRIMARY KEY(rfc724_mid, contact_id),
|
||||
FOREIGN KEY(contact_id) REFERENCES contacts(id) ON DELETE CASCADE
|
||||
) STRICT",
|
||||
migration_version,
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
|
||||
let new_version = sql
|
||||
.get_raw_config_int(VERSION_CFG)
|
||||
.await?
|
||||
|
||||
Reference in New Issue
Block a user