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 <jb55@jb55.com>
This commit is contained in:
alltheseas
2026-01-03 13:56:04 -06:00
committed by Daniel D’Aquino
parent 81251ee88a
commit f506f9cfe8

View File

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