fix: Bug - Sending files and attachment issues

Hydrate playable media after disk receive, relay file-announce to sibling
devices via account_sync, bind DM attachments to pre-allocated message ids,
and improve gallery retry/cancel UX with bounded parallel auto-downloads.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-14 13:05:23 +02:00
co-authored by Cursor
parent bb0ac930ad
commit fa45052432
30 changed files with 785 additions and 71 deletions
@@ -0,0 +1,29 @@
import { runTasksWithBoundedConcurrency } from './attachment-autodownload-concurrency.rules';
describe('attachment-autodownload-concurrency.rules', () => {
it('runs tasks with bounded concurrency', async () => {
let active = 0;
let maxActive = 0;
const tasks = Array.from({ length: 6 }, (_, index) => async () => {
active += 1;
maxActive = Math.max(maxActive, active);
await new Promise((resolve) => setTimeout(resolve, 5));
active -= 1;
return index;
});
const results = await runTasksWithBoundedConcurrency(tasks, 2);
expect(results).toEqual([
0,
1,
2,
3,
4,
5
]);
expect(maxActive).toBeLessThanOrEqual(2);
});
});