Verify cache restoration and channel cleanup for encrypted attachments
This commit is contained in:
1 parent
8cb32768da
commit
367e282f28
2 files changed
+14
-1
No files matched your search
@@ -261,11 +261,23 @@ static void tick(void* arg) {
|
||||
inject(t, A, B, ROUTER_FLAG_ENCRYPTED | ROUTER_FLAG_SIGNED, 0);
|
||||
if (!readable(t, B) || value(b, "SELECT count(*) FROM attachment_key_requests") != 1 ||
|
||||
value(a, "SELECT count(*) FROM attachment_key_requests") != 2) { failure(t, "duplicate grant changed persisted access"); return; }
|
||||
sqlite3_stmt* cached = NULL;
|
||||
if (sqlite3_prepare_v2(b->topo_sqlite_db, "SELECT plain_path FROM attachment_keys", -1, &cached, NULL) ||
|
||||
sqlite3_step(cached) != SQLITE_ROW || remove((const char*)sqlite3_column_text(cached, 0))) {
|
||||
sqlite3_finalize(cached); failure(t, "cache eviction fixture"); return;
|
||||
}
|
||||
sqlite3_finalize(cached); download(t, B);
|
||||
t->phase++;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (++t->hold >= 20) { t->phase++; uasync_stop(t->ua); return; }
|
||||
if (readable(t, B) && ++t->hold >= 20) {
|
||||
if (value(a, "SELECT count(*) FROM attachment_key_requests") != 2) { failure(t, "cache restore requested another consent"); return; }
|
||||
chat_core_delete_channel(c, CHANNEL);
|
||||
if (value(c, "SELECT count(*) FROM attachment_keys") || value(c, "SELECT count(*) FROM attachment_key_requests") ||
|
||||
value(c, "SELECT count(*) FROM attachment_key_outbox")) { failure(t, "deleted channel retained grants/requests"); return; }
|
||||
t->phase++; uasync_stop(t->ua); return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (t->failed) return;
|
||||
|
||||
@@ -471,6 +471,7 @@ void InputBar::setRecordingContext(const QString& mediaDirBase, const QString& c
|
||||
if (m_channelIdForRecord != channelId || m_mediaDirBase != mediaDirBase) {
|
||||
clearReply();
|
||||
++m_attachmentContext;
|
||||
m_encryptBtn->setChecked(false);
|
||||
clearPendingAttachment();
|
||||
if (m_dropHint) m_dropHint->hide();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user