Files
task-stream/libs/api/tracker/application/src/lib/sagas/commenters-follow.saga.spec.ts
Josep Piguillem ea4ef82239 feat: replies to comments
A comment can answer another one (replyTo), one level deep: answering a
reply joins the same thread, and it must be on the same ticket. Whoever
wrote the comment gets a new REPLIED notification, and the activity says
"respondió a un comentario".

A comment deleted while it has replies stays, without its text
(deleted: true), so the thread still reads; it goes with its last reply
and does not count in commentCount.

The ticket page shows threads with their replies indented and a
"Responder" box; REST, GraphQL and the MCP (add_comment, get_issue) take
and show replyTo. Existing comments are unchanged. Docs, Word and PDF
updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:14:37 +02:00

27 lines
843 B
TypeScript

import { CommentAddedEvent } from '@task-stream/api/tracker/domain';
import { lastValueFrom, of, toArray } from 'rxjs';
import { WatchIssueCommand } from '../commands/watch-issue.command';
import { CommentersFollowSaga } from './commenters-follow.saga';
describe('CommentersFollowSaga', () => {
it('makes whoever comments follow the ticket', async () => {
const event = new CommentAddedEvent('ana', {
id: 'c-1',
issueId: 'i-1',
projectId: 'p-1',
authorId: 'ana',
body: 'Lo miro',
replyTo: null,
deleted: false,
createdAt: '2026-10-08T10:00:00.000Z',
editedAt: null,
});
const commands = await lastValueFrom(
new CommentersFollowSaga().commented(of(event)).pipe(toArray()),
);
expect(commands).toEqual([new WatchIssueCommand('ana', 'i-1', 'ana')]);
});
});