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:
-
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
-
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
Dependencies
Related Issues
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:
Pre-encoding limitation: Current scheduled casts are pre-encoded at draft time using
preEncodeCastMessage(). This works for single posts but not for threads because:parentCastIdpointing to post 1's hashDependency chain: Thread posts must be published sequentially, with each subsequent post referencing the first post's hash.
Potential Solutions
Option A: Runtime Encoding (Simplest)
Option B: Staged Publishing
Option C: Chained Scheduling
Acceptance Criteria
Dependencies
Related Issues