Skip to content

Feature: Support scheduled thread publishing #682

@hellno

Description

@hellno

Summary

Add support for scheduling threads (multi-post compositions) to be published at a future time.

Background

Thread scheduling was deferred from #668 (draft store thread support) because of complexity:

  1. Pre-encoding limitation: Current scheduled casts are pre-encoded at draft time using preEncodeCastMessage(). This works for single posts but not for threads because:

    • Posts 2-N in a thread need parentCastId pointing to post 1's hash
    • Post 1's hash doesn't exist until it's published
    • Therefore, posts 2-N cannot be pre-encoded at scheduling time
  2. Dependency chain: Thread posts must be published sequentially, with each subsequent post referencing the first post's hash.

Potential Solutions

Option A: Runtime Encoding (Simplest)

  • Schedule the thread metadata only (not pre-encoded bytes)
  • Edge function encodes all posts at publish time
  • Requires edge function to have access to account's private key (already does for fallback)
  • Con: Slightly less reliable than pre-encoded (but fallback already exists)

Option B: Staged Publishing

  • Pre-encode and publish post 1 at scheduled time
  • Edge function immediately publishes posts 2-N after post 1 succeeds
  • Pro: Post 1 is pre-encoded for reliability
  • Con: More complex edge function logic

Option C: Chained Scheduling

  • Schedule only post 1 initially
  • After post 1 publishes, automatically schedule posts 2-N
  • Pro: Each post is scheduled independently
  • Con: User experience unclear, timing may drift

Acceptance Criteria

  • User can schedule a thread for future publication
  • All posts in thread are published sequentially at scheduled time
  • Partial failures are handled gracefully (same as immediate publishing)
  • Thread scheduling state is persisted to Supabase

Dependencies

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions