Skip to content

fix(replies): address PR #59 review — feed reply count, route-by-type, tests, docs#60

Merged
iduartgomez merged 1 commit into
mainfrom
fix/12-reply-followups
Jun 27, 2026
Merged

fix(replies): address PR #59 review — feed reply count, route-by-type, tests, docs#60
iduartgomez merged 1 commit into
mainfrom
fix/12-reply-followups

Conversation

@iduartgomez

Copy link
Copy Markdown
Contributor

What

Follow-up to #59 (merged). Addresses the should-fix findings from the multi-agent /pr-review posted on #59.

Fixes

Feed reply-count badge never updated (was the headline #12 surface — read blank)
contractPostToUiPost hardcoded replies: 0 and nothing updated it. onRepliesUpdated already carries the authoritative thread-shard reply list, so the store handler now also sets post.replies = replies.length on the feed post — same cadence as the like/quote aggregates (refreshes when that post's thread shard is read).

Route delegate responses by response type (web/src/stores/freenet.ts)
SignedReply → completeReply, Signed → completePublish. Replaces the try-completeReply-then-fall-back-to-completePublish probing, which logged a misleading "no matching pending draft" when a reply genuinely failed (the false return was overloaded: "not my nonce" vs "was my reply but the update threw"). The delegate already tags the response authoritatively.

Web vitest for the reply path (web/src/freenet-api.test.ts, 4 new tests, 44 pass)
dropPendingReply nonce matching · completeReply success (Replies delta + refresh) · completeReply foreign-nonce no-op · onRepliesUpdated emission sorted oldest-first. Mirrors the existing like/quote coverage that previously had no reply analog.

Cross-session E2E no longer silently reddens CI (web/tests/node-e2e/reply-thread.spec.ts)
The reload test exercises the #50 single-node reload-GET seam, which isn't guaranteed on a single node. Gated behind test.fixme(!process.env.E2E_RUN_CROSS_SESSION) — skipped in normal CI, runnable with E2E_RUN_CROSS_SESSION=1. The same-session test stays a hard gate. Title de-hedged; TODO(#50) left for marker-based post targeting.

Docs

  • README.md: replies checked off the roadmap; SignReply added to the delegate message list; stale "reply signing not yet wired" prose removed.
  • docs/adr/0001-implementation-notes.md Phase 4: document the SignReply variant + byte-identical SignPost.

Not in scope

Verification

Addresses review feedback on #12.

https://claude.ai/code/session_01Q6rfcR7TYVpMCTELqr6kWv

…, tests, docs

Follow-up to #59 (merged). Addresses the should-fix findings from the
multi-agent review.

Web (stores/freenet.ts):
- Feed reply-count badge now updates. onRepliesUpdated already carries the
  authoritative thread-shard reply list, so it also sets post.replies =
  replies.length on the feed post (same cadence as like/quote aggregates).
  Previously contractPostToUiPost hardcoded replies: 0 and nothing ever
  updated it — the headline #12 surface read blank.
- Route delegate responses by the authoritative response type:
  SignedReply -> completeReply, Signed -> completePublish. Replaces the
  try-completeReply-then-fall-back-to-completePublish probing, which logged a
  misleading "no matching pending draft" for a genuinely-failed reply.

Tests:
- web vitest (freenet-api.test.ts): cover the new reply path — dropPendingReply
  nonce matching, completeReply success (Replies delta + refresh), completeReply
  foreign-nonce no-op, and onRepliesUpdated emission sorted oldest-first.
  Mirrors the existing like/quote coverage. 44 pass.
- node-e2e (reply-thread.spec.ts): the cross-session reload test exercises the
  #50 single-node reload-GET seam, which is not guaranteed on a single node.
  Gated behind test.fixme(!E2E_RUN_CROSS_SESSION) so it no longer redden CI;
  set E2E_RUN_CROSS_SESSION=1 to enforce it. Same-session test stays a hard
  gate. Title de-hedged; TODO(#50) for marker-based post targeting.

Docs:
- README roadmap: replies checked off; SignReply added to the delegate message
  list; stale "reply signing not yet wired" prose removed.
- ADR-0001 Phase 4: document the SignReply variant + byte-identical SignPost.

Gate: clippy -D, fmt-check, tsc, vitest (44) all green; node-e2e same-session
reply passes (cross-session skipped by design).

Claude-Session: https://claude.ai/code/session_01Q6rfcR7TYVpMCTELqr6kWv
@iduartgomez iduartgomez merged commit 8450b5c into main Jun 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant