Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
deleted_item_poller
What it is
Shared infrastructure: EventBridge-scheduled Lambda that sweeps users' deleted items (chats, documents, projects) older than 30 days and queues them for permanent deletion.
Start here
src/handler.rs: runshandle_chats,handle_documents,handle_projectsconcurrently viatokio::try_join!; each publishes purge events throughMacroEventBroker(chats/documents) or queues deletion directly (projects).src/context.rs: DB pool + event broker + queue clients.
Scope
- Owns: finding items past the retention window and triggering their deletion across chats, documents, and projects.
- Not here: the actual permanent deletion of a chat →
services/delete_chat_handler(consumes the event this lambda publishes).
Recipes
- Add a new deletable entity type:
src/handler.rs(newhandle_<entity>joined into thetry_join!) → its domain crate's purge event type → a consumer lambda/worker. - Change the retention window: the domain crate's query
(
documents/chat/projects), not this lambda.
Checks
cargo test -p deleted_item_poller(SQLX_OFFLINEunset).
Related
- Rules:
.agents/rules/rust/db.md