Skip to content

feat(relay): let channels filed in a project auto-archive - #9565

Draft
morgmart wants to merge 10 commits into
morganm/project-accessfrom
morganm/filed-auto-archive
Draft

morgmart wants to merge 10 commits into
morganm/project-accessfrom
morganm/filed-auto-archive

Conversation

@morgmart

@morgmart morgmart commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What this does

Stacked on #9564. Chats and channels filed in a project can now auto-archive (have a TTL). Projects stay permanent for now.

  • A channel with a parent may have a TTL. It auto-archives as any channel does. An archived channel still reads and grants as before, so the project's readers can still find and read it.
  • A project can't. A project is a channel with live children and no parent of its own. The relay refuses three things:
    • a TTL on a project;
    • filing a channel under an auto-archiving channel that has no parent, which would make it a project;
    • clearing the parent of an auto-archiving channel that has children, which would leave it a project.
  • One check. All three go through refuse_auto_archiving_project, which is governed by the constant PROJECTS_MAY_AUTO_ARCHIVE (false). Allowing projects later means flipping that constant.
  • An auto-archiving chat in a project may still hold task conversations.
  • Races. Setting a TTL holds the channel's row lock. Filing under it locks that same row, and clearing a parent holds the child's lock, so neither change can slip past the other.
  • NOSTR.md documents the rule.

Testing

  • New Postgres tests in parent_access_postgres_tests.rs:
    • a_filed_chat_auto_archives_and_stays_readable_through_its_project: a project reader posts in the chat while it has a TTL. The reaper then archives the chat. Afterwards the reader still reads both messages by name, gets them in an implicit REQ, counts 2 and reads its metadata, which still names the parent. An outsider gets nothing, and the reader gets no member row.
    • a_project_never_auto_archives: covers each of the three refusals, a task conversation under an auto-archiving chat, and a childless auto-archiving channel leaving its project.
  • metadata_names_the_parent_and_a_tree_has_no_ttl lost its TTL half and is now metadata_names_the_parent.
  • Mutation checks, each of which turned a test red:
    • flipping PROJECTS_MAY_AUTO_ARCHIVE
    • refusing a TTL on any channel with a parent
    • restoring the old "no TTL in a tree" rule when filing
    • dropping the check when a parent is cleared
  • At 310ae91d8: buzz-db and buzz-relay Postgres lane 1438/1438, unit tests for buzz-db, buzz-relay, buzz-test-client and buzz-core 2470/2470, clippy with -D warnings clean.

Known limit

Incremental task sync (NIP-AR sync) leaves out every channel with a TTL, and has since #8523. So tasks filed directly in an auto-archiving chat are readable through task queries but don't appear in a sync. Task conversations under such a chat are not affected. Whether sync should include auto-archiving channels is a separate decision.

Also noted for later: "has a parent" counts a deleted parent. If a project is deleted, a middle channel with a TTL and children of its own becomes the top of what remains and can keep auto-archiving. Access is unchanged. This belongs with the #9551 follow-up on what a deleted parent leaves behind.

🤖 Generated with Claude Code

A channel with a parent may now have a TTL. A project, a channel with
children and no parent, still may not: a TTL on it, filing under an
auto-archiving channel with no parent, and clearing the parent of an
auto-archiving channel with children are refused. One constant,
PROJECTS_MAY_AUTO_ARCHIVE, governs all three.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
* morganm/project-access:
  feat(auth): tolerate client clocks up to 120 s off (#9485)
  docs: name the required stop as a relay build, not a release (#9577)
  buzz-db: drop the created_at floor, community write-fence and migration-only NIP-RS triggers (contract) (#8326)
  Keep community deletion working across a new tenant table's migration (#9304)
  docs: design Android push notifications (#9555)
  feat(push-gateway): accept deliveries on a platform-neutral route (#9557)
  fix(mobile): read a Solo chat through its newest message on open (#9515)
  fix(mobile): keep the Solo header's agent portrait while its roster reloads (#9512)
  perf(mobile): pulse the Solo working dots at 12 fps on a shared clock (#9554)
  test(mobile): match the resumeSince override in the search journey (#9546)
  mobile: show account communities in the switcher and sync saved destinations (#9262)
  perf(mobile): stop replaying stored read state on every resume (#9090)
  perf(mobile): save the open-channel directory and catch it up (#9513)
  fix(mobile): sign out from Settings in every build, keeping keys on the device (#9421)
  fix(mobile): wrap inline Markdown links with their sentence (#9462)
  feat(mobile): message the Bestie from Siri and Shortcuts (#9517)
  fix(mobile): slide a closing chat away instead of cutting to the list (#9511)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
* morganm/project-access:
  Refuse opening a private channel that has other members (#9307)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
* morganm/project-access:
  feat(deletion): clean up media for users and owned agents (#9365)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
* morganm/project-access:
  update feedback community invite link (#9588)
  fix(mobile): name the failing step in sign-in errors (#9263)
  fix(mobile): order same-second messages by millisecond offsets (#9541)
  fix(acp): saturate observer frame size estimates (#9494)
  feat(mobile): accept mentions with Tab and send with Enter on hardware keyboards (#8733)
  Fix remote Huddle ending cleanup (#9376)
  fix(mobile): host Duo long-press menus in native sheets (#9536)
  fix(mobile): keep the relay session across auth reloads (#9543)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
* morganm/project-access:
  [buzz] Classify HTTP event request metrics by event type (#9561)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
* morganm/project-access:
  feat(workflow): implement send_dm action (#9402)
  perf(mobile): stop following presence for people no longer shown (#9480)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
* morganm/project-access:
  feat(relay): grow DMs in place, identified by their people (#9125)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
* morganm/project-access:
  buzz-db: check workflow references in app code before FK retirement (#9399)
  fix(relay): enforce channel owner precedence (#9592)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
* morganm/project-access:
  buzz-db: check membership, agent-owner and channel references in app code (#9404)
  buzz-db: enforce five single-table guards in app writers (phase 1) (#8320)
  docs(mobile): add REVIEWING.md with mobile review principles (#9298)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant