Skip to content

feat(write): submit stories to blogs through publications (M14) - #25

Merged
vlidholt merged 2 commits into
serverpod:mainfrom
vlidholt:feat/publications
Oct 20, 2026
Merged

vlidholt merged 2 commits into
serverpod:mainfrom
vlidholt:feat/publications

Conversation

@vlidholt

Copy link
Copy Markdown
Contributor

Summary

Lets a blog take stories from Wonky Write. The blog registers a publication in Settings › Publications and links to https://wonky.work/write/new?publication=pub_…. Contributors write in their own Wonky document and press Submit. Wonky sends a signed webhook (Standard Webhooks) to the blog's review queue. The blog's moderators get comment access to the document, and the blog's status calls and messages come back into the document as a thread under the publication's name, with notifications.

Server (platform/publications/)

  • Models and migration (additive only): publication, publication_moderator, publication_consent, publication_block, submission, submission_revision, submission_asset, publication_delivery; plus DriveItemPermission.viaPublicationId, Comment.publicationId, NotificationKind.submission and ActivityType.submission.
  • Webhook outbox: each delivery is tried once while the contributor waits, then retried with the same webhook-id (1 min to 12 h). The retries run from wonky.publicationSweep, every minute. Delivery goes through the SSRF-safe UrlFetchProxy: https on port 443 only, no redirects.
  • /api/pub/v1/** for blogs, with API keys: list and get submissions, get submitted content, set status, send messages, download assets, block users. Rate-limited, with header-only checks before the body is read.
  • Site verification through /.well-known/wonky-publications.json; signing-secret rotation, where both secrets sign for 24 h.
  • Moderator access: moderators get Commenter grants. These are synced on submit, status change, withdraw, disconnect, trash and restore.
  • Hooks: trash and restore, replies in the feedback thread (sent to the blog as comment.created), pending moderators linked at sign-up, and a direct share turning a moderator grant into a regular one.

Client

  • wonky_app:
    • PublicationRepository and the Settings › Publications section.
    • The /new?publication= consent and continue-a-draft flow.
    • Rendering of the new notifications, activity entries, comment authors and the share dialog's "Moderator · …" label.
    • Undo of Disconnect.
  • Write (features/publish/):
    • The Submit button and status chip in the title row, with its popover.
    • The submit dialog, which asks for the publication's fields.
    • The write.submission.* commands and File menu items.

Test plan

  • dart analyze / flutter analyze clean (server, wonky_app, Write, Drive, Sheets, Slides); dart format applied
  • Server: new test/unit/publications/ and test/integration/platform/publications/, which cover the flow, the API over HTTP, owner endpoints and the guide's signature vector. The touched suites pass too: comments, sharing, trash, notifications, users, versions, server_test, source rules and the spec index.
  • The full server suite was not rerun: the machine's disk was full, and the run's temp kernels need about 15 GB.
  • wonky_app: full suite green, including the new test/publications/. Settings accessibility and pseudo-locale tests cover the new section.
  • Write: full suite green, including the new test/features/publish/. The Drive, Sheets and Slides settings tests pass.
  • Not checked in a browser against a running server yet. Light/dark goldens and the E2E journey J-P1 are open (TODO.md).
  • Specs updated

🤖 Generated with Claude Code

vlidholt and others added 2 commits October 20, 2026 11:36
Blogs register a publication in Settings › Publications and link to
/write/new?publication=pub_…. Contributors write in their own Wonky Write
document and press Submit; the server sends a signed webhook (Standard
Webhooks) to the blog's review queue. Moderators get comment access to
submitted documents, and the blog's status calls and messages appear in
the document as a thread under the publication's name, with notifications.

- Server: platform/publications (models, services, webhook outbox with
  retries and the wonky.publicationSweep job, SSRF-safe delivery, the
  /api/pub/v1 API with API keys, site verification), hooks in trash,
  comments, sign-up and sharing, migration.
- Client: publication repository, Settings › Publications, the
  /new?publication= consent flow, notification/activity/comment/share
  rendering, undo of disconnect; Write title-row Submit button and status
  chip, submit dialog, write.submission.* commands and File menu items.
- Spec 18 and cross-references; docs/blog-integration.md for blog owners.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vlidholt
vlidholt merged commit 8fa14e2 into serverpod:main Oct 20, 2026
41 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant