Fix digest email showing "0 replies / 0 reactions" for every event #23
Loading…
Reference in a new issue
No description provided.
Delete branch "mailship-d08-digest-email-shows-0-replies-0-reactions-10f"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
mailship-d08
Digest email shows "0 replies / 0 reactions" for every event because the
contextused to compute reply/reaction counts was set to[...events]— a placeholder that included no reply or reaction events.Changes
In
sendFromStoredEvents, the temporarycontext = [...events](with the comment "no reply loading") is replaced by a real query against the repository for events that tag our matched event IDs with kindsNOTE,COMMENT, orREACTION. The resulting reply/reaction events are included incontext, sorepliesByParentIdinbuildParametersactually finds entries and produces correct counts.src/digest.ts— importrepositoryand query it for#e-tagged context events.test/digest-reply-stats.test.ts— new test that publishes reply and reaction events into a mock repository, callssendFromStoredEvents, and asserts that the rendered digest parameters showReplies >= 1andReactions >= 1.How to test
The test exercises the fix by publishing reply/reaction events to the repository before triggering a digest send. Without the fix, the mock repository query returns nothing and
Replies/Reactionsremain 0.