gitdataai/libs/api
ZhenYi c89f01b718 feat(room): improve robustness — optimistic send, atomic seq, jitter reconnect
Backend:
- Atomic seq assignment via Redis Lua script: INCR + GET run atomically
  inside a Lua script, preventing duplicate seqs under concurrent requests.
  DB reconciliation only triggers on cross-server handoff (rare path).
- Broadcast channel capacity: 10,000 → 100,000 to prevent message drops
  under high-throughput rooms.

Frontend:
- Optimistic sendMessage: adds message to UI immediately (marked
  isOptimistic=true) so user sees it instantly. Replaces with
  server-confirmed message on success, marks as isOptimisticError on
  failure. Fire-and-forget to IndexedDB for persistence.
- Seq-based dedup in onRoomMessage: replaces optimistic message by
  matching seq, preventing duplicates when WS arrives before REST confirm.
- Reconnect jitter: replaced deterministic backoff with full jitter
  (random within backoff window), preventing thundering herd on server
  restart.
- Visual WS status dot in room header: green=connected, amber
  (pulsing)=connecting, red=error/disconnected.
- isPending check extended to cover both old 'temp-' prefix and new
  isOptimistic flag, showing 'Sending...' / 'Failed' badges.
2026-04-16 19:23:06 +08:00
..
agent init 2026-04-15 09:08:09 +08:00
auth init 2026-04-15 09:08:09 +08:00
git init 2026-04-15 09:08:09 +08:00
issue init 2026-04-15 09:08:09 +08:00
project init 2026-04-15 09:08:09 +08:00
pull_request init 2026-04-15 09:08:09 +08:00
room feat(room): improve robustness — optimistic send, atomic seq, jitter reconnect 2026-04-16 19:23:06 +08:00
search init 2026-04-15 09:08:09 +08:00
user init 2026-04-15 09:08:09 +08:00
workspace init 2026-04-15 09:08:09 +08:00
Cargo.toml init 2026-04-15 09:08:09 +08:00
error.rs init 2026-04-15 09:08:09 +08:00
gen_api.rs init 2026-04-15 09:08:09 +08:00
lib.rs init 2026-04-15 09:08:09 +08:00
openapi.rs init 2026-04-15 09:08:09 +08:00
route.rs init 2026-04-15 09:08:09 +08:00
skill.rs init 2026-04-15 09:08:09 +08:00