···
268
-
1. ✅ **Phase 1 (Alpha Blocker):** Fix post creation endpoint
269
-
- Update handler validation in `internal/api/handlers/post/create.go`
270
-
- Update service validation in `internal/core/posts/service.go`
271
-
- Add integration tests for handle resolution in post creation
268
+
1. ✅ **Phase 1 (Alpha Blocker):** Fix post creation endpoint - COMPLETE (2025-10-18)
269
+
- Post creation already uses `ResolveCommunityIdentifier()` at [service.go:100](../internal/core/posts/service.go#L100)
270
+
- Supports handles, DIDs, and scoped formats
2. 📋 **Phase 2 (Beta):** Fix subscription endpoints
- Update subscribe/unsubscribe handlers
- Add tests for handle resolution in subscriptions
277
-
3. 📋 **Phase 3 (Beta):** Fix block endpoints
278
-
- Update lexicon from `"format": "did"` → `"format": "at-identifier"`
279
-
- Update block/unblock handlers
280
-
- Add tests for handle resolution in blocking
276
+
3. ✅ **Phase 3 (Beta):** Fix block endpoints - COMPLETE (2025-11-16)
277
+
- Updated block/unblock handlers to use `ResolveCommunityIdentifier()`
278
+
- Accepts handles (`@gaming.community.coves.social`), DIDs, and scoped format (`!gaming@coves.social`)
279
+
- Added comprehensive tests: [block_handle_resolution_test.go](../tests/integration/block_handle_resolution_test.go)
280
+
- All 7 test cases passing
282
-
**Files to Modify (Phase 1 - Post Creation):**
283
-
- `internal/api/handlers/post/create.go` - Remove DID validation, add handle resolution
284
-
- `internal/core/posts/service.go` - Remove DID validation, add handle resolution
285
-
- `internal/core/posts/interfaces.go` - Add `CommunityService` dependency
286
-
- `cmd/server/main.go` - Pass community service to post service constructor
287
-
- `tests/integration/post_creation_test.go` - Add handle resolution test cases
282
+
**Files Modified (Phase 3 - Block Endpoints):**
283
+
- `internal/api/handlers/community/block.go` - Added `ResolveCommunityIdentifier()` calls
284
+
- `tests/integration/block_handle_resolution_test.go` - Comprehensive test coverage
**Existing Infrastructure:**
290
-
✅ `ResolveCommunityIdentifier()` already implemented at [service.go:843](../internal/core/communities/service.go#L843)
287
+
✅ `ResolveCommunityIdentifier()` already implemented at [service.go:852](../internal/core/communities/service.go#L852)
✅ `identity.CachingResolver` handles bidirectional verification and caching
✅ Supports both handle (`!name.communities.instance.com`) and DID formats
295
-
- ⚠️ **BLOCKING POST CREATION PR**: Identified as P0 issue in code review
296
-
- 📋 Phase 1 (post creation) - To be implemented immediately
297
-
- 📋 Phase 2-3 (other endpoints) - Deferred to Beta
292
+
- ✅ Phase 1 (post creation) - Already implemented
293
+
- 📋 Phase 2 (subscriptions) - Deferred to Beta (lower priority)
294
+
- ✅ Phase 3 (block endpoints) - COMPLETE (2025-11-16)
···
421
-
### Post comment_count Reconciliation Missing
422
-
**Added:** 2025-11-04 | **Effort:** 2-3 hours | **Priority:** ALPHA BLOCKER
418
+
### ✅ Post comment_count Reconciliation - COMPLETE
419
+
**Added:** 2025-11-04 | **Completed:** 2025-11-16 | **Effort:** 2 hours | **Status:** ✅ DONE
425
-
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.
422
+
When comments arrive before their parent post is indexed (common with cross-repo Jetstream ordering), the post's `comment_count` was never reconciled, causing posts to show permanently stale "0 comments" counters.
427
-
**End-User Impact:**
428
-
- 🔴 Posts show "0 comments" when they actually have comments
429
-
- ❌ Broken engagement signals (users don't know there are discussions)
430
-
- ❌ UI inconsistency (thread page shows comments, but counter says "0")
431
-
- ⚠️ Users may not click into posts thinking they're empty
432
-
- 📉 Reduced engagement due to misleading counters
435
-
- Comment consumer updates post counts when processing comment events ([comment_consumer.go:323-343](../internal/atproto/jetstream/comment_consumer.go#L323-L343))
436
-
- If comment arrives BEFORE post is indexed, update query returns 0 rows (only logs warning)
437
-
- When post consumer later indexes the post, it sets `comment_count = 0` with NO reconciliation
438
-
- Comments already exist in DB, but post never "discovers" them
441
-
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)):
424
+
**Solution Implemented:**
425
+
- ✅ Post consumer reconciliation logic WAS already implemented at [post_consumer.go:210-226](../internal/atproto/jetstream/post_consumer.go#L210-L226)
426
+
- ✅ Reconciliation query counts pre-existing comments when indexing new posts
427
+
- ✅ Comprehensive test suite added: [post_consumer_test.go](../tests/integration/post_consumer_test.go)
428
+
- Single comment before post
429
+
- Multiple comments before post
430
+
- Mixed before/after ordering
431
+
- Idempotent indexing preserves counts
432
+
- ✅ Updated outdated FIXME comment at [comment_consumer.go:362](../internal/atproto/jetstream/comment_consumer.go#L362)
433
+
- ✅ All 4 test cases passing
435
+
**Implementation:**
444
-
// After inserting new post, reconcile comment_count for out-of-order comments
437
+
// Post consumer reconciliation (lines 210-226)
···
454
-
_, reconcileErr := tx.ExecContext(ctx, reconcileQuery, postURI, postID)
447
+
_, reconcileErr := tx.ExecContext(ctx, reconcileQuery, post.URI, postID)
457
-
**Affected Operations:**
458
-
- Post indexing from Jetstream ([post_consumer.go](../internal/atproto/jetstream/post_consumer.go))
459
-
- Any cross-repo event ordering (community DID ≠ author DID)
450
+
**Files Modified:**
451
+
- `internal/atproto/jetstream/comment_consumer.go` - Updated documentation
452
+
- `tests/integration/post_consumer_test.go` - Added comprehensive test coverage
461
-
**Current Status:**
462
-
- 🔴 Issue documented with FIXME(P1) comment at [comment_consumer.go:311-321](../internal/atproto/jetstream/comment_consumer.go#L311-L321)
463
-
- ⚠️ Test demonstrating limitation exists: `TestCommentConsumer_PostCountReconciliation_Limitation`
464
-
- 📋 Fix required in post consumer (out of scope for comment system PR)
466
-
**Files to Modify:**
467
-
- `internal/atproto/jetstream/post_consumer.go` - Add reconciliation after post creation
468
-
- `tests/integration/post_consumer_test.go` - Add test for out-of-order comment reconciliation
470
-
**Similar Issue Fixed:**
471
-
- ✅ Comment reply_count reconciliation - Fixed in comment system implementation (2025-11-04)
454
+
**Impact:** ✅ Post comment counters are now accurate regardless of Jetstream event ordering