Skip to content

CommentGateway

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/apps/api/src/comment/comment.gateway.ts

WebSocket Gateway for real-time comment updates Handles comment-specific WebSocket events and room management

Implements: OnGatewayConnection, OnGatewayDisconnect

Methods

MethodSignatureReturns
handleConnectionhandleConnection(client: Socket)void
handleDisconnecthandleDisconnect(client: Socket)void
handleJoinDocumenthandleJoinDocument(data: { documentId: string; userId: string; userName: string }, client: Socket)void
handleLeaveDocumenthandleLeaveDocument(data: { documentId: string }, client: Socket)void
emitCommentAddedemitCommentAdded(documentId: string, comment: CommentPayload)void
emitCommentUpdatedemitCommentUpdated(documentId: string, comment: CommentPayload)void
emitCommentDeletedemitCommentDeleted(documentId: string, commentId: string)void
emitCommentResolved`emitCommentResolved(documentId: string, data: {
  commentId: string;
  resolvedBy: { id: string; name: string; email: string };
  resolvedAt: Date;
})` | `void` |

| emitCommentUnresolved | emitCommentUnresolved(documentId: string, data: { commentId: string; unresolvedBy: { id: string; name: string; email: string }; }) | void | | emitReplyAdded | emitReplyAdded(documentId: string, data: { parentCommentId: string; reply: CommentPayload; }) | void | | getDocumentCommentUsers | getDocumentCommentUsers(documentId: string) | CommentUserPresence[] | | getDocumentCommentUserCount | getDocumentCommentUserCount(documentId: string) | number |

Properties

PropertyType
serverServer

Where it refuses work

  • CommentGateway stops the work with an early return when !presenceMap.

Referenced By

  • CommentModule (MODULE_PROVIDES)
  • CommentModule (MODULE_EXPORTS)
  • GatewayModule (MODULE_PROVIDES)
  • GatewayModule (MODULE_EXPORTS)

Was this page helpful?

Download as PDF