···
-
1. โ
**Phase 1 (Alpha Blocker):** Fix post creation endpoint
-
- Update handler validation in `internal/api/handlers/post/create.go`
-
- Update service validation in `internal/core/posts/service.go`
-
- Add integration tests for handle resolution in post creation
2. ๐ **Phase 2 (Beta):** Fix subscription endpoints
- Update subscribe/unsubscribe handlers
- Add tests for handle resolution in subscriptions
-
3. ๐ **Phase 3 (Beta):** Fix block endpoints
-
- Update lexicon from `"format": "did"` โ `"format": "at-identifier"`
-
- Update block/unblock handlers
-
- Add tests for handle resolution in blocking
-
**Files to Modify (Phase 1 - Post Creation):**
-
- `internal/api/handlers/post/create.go` - Remove DID validation, add handle resolution
-
- `internal/core/posts/service.go` - Remove DID validation, add handle resolution
-
- `internal/core/posts/interfaces.go` - Add `CommunityService` dependency
-
- `cmd/server/main.go` - Pass community service to post service constructor
-
- `tests/integration/post_creation_test.go` - Add handle resolution test cases
**Existing Infrastructure:**
-
โ
`ResolveCommunityIdentifier()` already implemented at [service.go:843](../internal/core/communities/service.go#L843)
โ
`identity.CachingResolver` handles bidirectional verification and caching
โ
Supports both handle (`!name.communities.instance.com`) and DID formats
-
- โ ๏ธ **BLOCKING POST CREATION PR**: Identified as P0 issue in code review
-
- ๐ Phase 1 (post creation) - To be implemented immediately
-
- ๐ Phase 2-3 (other endpoints) - Deferred to Beta
···
-
### Post comment_count Reconciliation Missing
-
**Added:** 2025-11-04 | **Effort:** 2-3 hours | **Priority:** ALPHA BLOCKER
-
When comments arrive before their parent post is indexed (common with cross-repo Jetstream ordering), the post's `comment_count` is never reconciled. Later, when the post consumer indexes the post, there's no logic to count pre-existing comments. This causes posts to have permanently stale `comment_count` values.
-
- ๐ด Posts show "0 comments" when they actually have comments
-
- โ Broken engagement signals (users don't know there are discussions)
-
- โ UI inconsistency (thread page shows comments, but counter says "0")
-
- โ ๏ธ Users may not click into posts thinking they're empty
-
- ๐ Reduced engagement due to misleading counters
-
- Comment consumer updates post counts when processing comment events ([comment_consumer.go:323-343](../internal/atproto/jetstream/comment_consumer.go#L323-L343))
-
- If comment arrives BEFORE post is indexed, update query returns 0 rows (only logs warning)
-
- When post consumer later indexes the post, it sets `comment_count = 0` with NO reconciliation
-
- Comments already exist in DB, but post never "discovers" them
-
Post consumer MUST implement the same reconciliation pattern as comment consumer (see [comment_consumer.go:292-305](../internal/atproto/jetstream/comment_consumer.go#L292-L305)):
-
// After inserting new post, reconcile comment_count for out-of-order comments
···
-
_, reconcileErr := tx.ExecContext(ctx, reconcileQuery, postURI, postID)
-
**Affected Operations:**
-
- Post indexing from Jetstream ([post_consumer.go](../internal/atproto/jetstream/post_consumer.go))
-
- Any cross-repo event ordering (community DID โ author DID)
-
- ๐ด Issue documented with FIXME(P1) comment at [comment_consumer.go:311-321](../internal/atproto/jetstream/comment_consumer.go#L311-L321)
-
- โ ๏ธ Test demonstrating limitation exists: `TestCommentConsumer_PostCountReconciliation_Limitation`
-
- ๐ Fix required in post consumer (out of scope for comment system PR)
-
- `internal/atproto/jetstream/post_consumer.go` - Add reconciliation after post creation
-
- `tests/integration/post_consumer_test.go` - Add test for out-of-order comment reconciliation
-
**Similar Issue Fixed:**
-
- โ
Comment reply_count reconciliation - Fixed in comment system implementation (2025-11-04)