Skip to content

End dates for folder shares - #25

Merged
ssenerg merged 2 commits into
mainfrom
share-end-dates
Oct 25, 2026
Merged

ssenerg merged 2 commits into
mainfrom
share-end-dates

Conversation

@ssenerg

@ssenerg ssenerg commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Folder shares can now end on their own.

What it does

  • The People popover has a For choice: Until I stop it (the default), 1 day, 1 week, 1 month or 3 months.
  • Sharing the folder with someone again changes the end date, and can also remove it.
  • The popover, the "Shared with …" confirmation and both folder tables on Shared show until . Shares without one say no end date.
  • An expired share stops working immediately, because the rules are recomputed on every request. It no longer appears in any list, no longer counts toward the 200-share limit, and can't be stopped twice. The existing purge loop deletes it along with expired links.
  • Scripts send expires=1d|7d|30d|90d with action=grant. The answer includes expires_at (RFC 3339, or null). Any other value gets a 400.

How

  • Migration 011 adds folder_shares.expires_at, with NULL meaning never.
  • Every store query filters out expired shares: listing, rules, counting toward the limit, and deleting.
  • ShareFolder takes a ttl, and its upsert also updates expires_at.

Tests

  • Auth, on both stores: the end date is set, cleared by sharing again, and the share stops working after it.
  • Server:
    • a bad expires value gets a 400;
    • the JSON answer includes expires_at;
    • the popover and the Shared page show the end date;
    • access stops after the end date.
  • Full suite: passes with -race and Postgres on macOS, except the known macOS-only TestLongNonASCIIPath. CI runs it on Linux.

🤖 Generated with Claude Code

ssenerg and others added 2 commits October 25, 2026 18:48
Sharing a folder with someone can now be for a day, a week, a month or
three months instead of until it is stopped, from the People popover or
with expires= for scripts. Sharing it again changes the end date. The
popover and the Shared page say until when; expired shares stop at once
and are purged with expired links.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 25, 2026
@ssenerg
ssenerg merged commit 4eb03ce into main Oct 25, 2026
4 checks passed
@ssenerg
ssenerg deleted the share-end-dates branch October 25, 2026 19:08
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