|
|
|
|
@ -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; |
|
|
|
|
|