Files
annotations/_docs/02_document/components/02_annotations-realtime-sync/description.md
T
Oleksandr Bezdieniezhnykh d7d1c0ed6a [AZ-PENDING-1] [AZ-PENDING-2] Step 4 close-out: verification + docs
Phase 6 smoke (Docker, _docs/04_refactoring/01-testability-refactoring/
smoke-compose.yml):
  - Annotations app boots clean under ASPNETCORE_ENVIRONMENT=E2ETest.
  - /health 200 OK; /annotations with bearer returns 401 with the
    JWT library's own malformed-token rejection.
  - 0 IDX20108 occurrences in logs (C01 verified).
  - 0 IPAddress.Parse FormatException occurrences; FailsafeProducer
    reaches the broker via Docker DNS (C02 verified).
  - Full smoke report in verification.md.

Phase 7 docs:
  - architecture.md: retire Open Risks §6 (testability blocker
    resolved). Update the constraints block to describe the
    ASPNETCORE_ENVIRONMENT-gated RequireHttps behavior.
  - components/06_platform/description.md: one-liner on JwtExtensions
    JWKS gating.
  - components/02_annotations-realtime-sync/description.md: one-liner
    on FailsafeProducer host resolution accepting literal IP or DNS.
  - tests/test-data.md: refresh the JWKS URL configuration section to
    point at the resolved implementation instead of the open risk.

Task housekeeping:
  - _docs/02_tasks/todo/01_*.md -> done/
  - _docs/02_tasks/todo/02_*.md -> done/
  - _docs/_autodev_state.md: advance to Step 5 (Refactor Backlog Triage).

Tracker IDs remain placeholders pending Atlassian MCP availability —
real IDs to be assigned per
_docs/_process_leftovers/2026-05-14_testability-tracker.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 20:38:14 +03:00

1.8 KiB

Annotations (realtime & stream sync)

1. High-Level Overview

Purpose: SSE push for annotation changes and RabbitMQ Stream failsafe export — 01_annotations.md sections SSE Communication and Annotation Sync / Failsafe / RabbitMQ Stream.

Architectural pattern: Event channel + background outbox producer.

Upstream dependencies: Platform (DB, config, paths), Annotations REST (domain mutations enqueue/publish).

Downstream consumers: Browser UI (SSE); Admin sync worker; AI Training consumer (external).

2. Internal interfaces

  • AnnotationEventService — in-process Channel<AnnotationEventDto>; PublishAsync / Reader.
  • FailsafeProducer + RabbitMqConfig — stream client, MessagePack payloads, drains annotations_queue_records. RABBITMQ_HOST accepts both literal IPv4/IPv6 (used as-is via IPAddress.TryParse) and DNS hostnames (resolved through Dns.GetHostAddressesAsync — required for Docker/Kubernetes service-name connectivity).
  • HTTP: AnnotationsController.Eventstext/event-stream subscription (same controller file as REST component; doc ownership here for SSE).

3. External API / integration

Surface Notes
GET /annotations/events SSE; see suite SSE section
RabbitMQ stream azaion-annotations Env RABBITMQ_* from Program

4. Data access patterns

Queue table buffering; stream send on connectivity; image bytes in create messages per suite.

5. Caveats

MessagePack key stability; stream consumer offsets independent per consumer type.

6. Dependency graph

Imports from: Platform, annotations domain (via service calls / shared types). Consumed by: External infrastructure.

7. Modules included

sse-realtime, rabbitmq-stream-sync.