From f506f9cfe898a0c9f6eaa5ac0eb1e60245a340c8 Mon Sep 17 00:00:00 2001 From: alltheseas <64376233+alltheseas@users.noreply.github.com> Date: Sat, 3 Jan 2026 13:56:04 -0600 Subject: [PATCH] docs: update AGENTS.md - dont block main thread updated AGENTS.md with don't cause freezes, hangs requirement Closes: https://github.com/damus-io/damus/pull/3486 Signed-off-by: William Casarin --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index a9a7d1e8..e1418493 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -44,3 +44,4 @@ Damus is an iOS client built around a local relay model ([damus-io/damus#3204](h 7. Review and follow `pull_request_template.md` when creating PRs for iOS Damus. 8. Ensure nevernesting: favor early returns and guard clauses over deeply nested conditionals; simplify control flow by exiting early instead of wrapping logic in multiple layers of `if` statements. 9. Before proposing changes, please **review and analyze if a change or upgrade to nostrdb** is beneficial to the change at hand. +10. **Never block the main thread**: All network requests, database queries, and expensive computations must run on background threads/queues. Use `Task { }`, `DispatchQueue.global()`, or Swift concurrency (`async/await`) appropriately. UI updates must dispatch back to `@MainActor`. Test for hangs and freezes before submitting.