Release: develop → stage (stage DB pool fix #11093 + inbox / Ever Works integration fixes)

Merged
EV
7d ago
+9762-971

Promotes develop (113d773667) to stage. Stage only, no stage → master (owner rule 2026-10-18).

What it carries

  • #11093: PostgreSQL pool defaults back to DB_POOL_MIN 0 and DB_IDLE_TIMEOUT 10 s. This fixes the stage API stall seen after #11073.
    • Stage reaches PostgreSQL through a session-mode PgBouncer. With the warm-pool defaults from #10976, gauzy_stage sat at 12/12 server connections and new connections waited up to 98 s.
    • Stage already runs these values as env overrides (ever-co/k8s-gitops#219, live since 17:17Z). This makes them the code defaults, so they don't depend on the overrides.
  • Inbox: keyset pages, per-mailbox unread counts, a re-delivery's new recipients, and only an item of the caller's own Inbox anchors a page.
  • Ever Works integration and UI fixes: review lane I6b plus follow-ups (sync, docs, goals/ideas, teams, held records, disconnect, pause on 401).
  • Daily T-18 self-build maintenance (#11034), GraphQL schema snapshot refresh, docs plugin config.

Checks

  • No migrations in stage...develop (55 files, packages/{config,core,plugins/*}).
  • Merges clean (git merge-tree).
  • The new inbox keyset SQL is dialect-neutral: TypeORM-escaped columns, COALESCE over a subquery, and uuid < comparison, all valid on PostgreSQL.

🤖 Generated with Claude Code


Summary by cubic

Promotes develop to stage (stage only, no stage → master). Fixes the stage API stall from PostgreSQL pool defaults, plus email, inbox, inbox-UI, employee, docs, Ever Works integration and UI fixes, and adds performance and routine maintenance work.

PostgreSQL pool defaults and performance

  • DB_POOL_MIN defaults back to 0 and DB_IDLE_TIMEOUT to 10 s, so stage no longer needs its env overrides.
  • Behind session-mode PgBouncer, the warm-pool defaults from #10976 held all 12 server connections; new connections waited up to 98 s.
  • Activity statistics read the time slots first: one dashboard widget went from 16.8 s to 107 ms on production's 20M-row table, and an activity now counts once.
  • The health probe reads one row instead of a COUNT; the time-slot merge moves children in one statement per table; tracker console.logs become lazy Logger.debug; API_CALL_LOG_ENABLED (default on) lets a deployment skip call-log recording.
  • Tenant settings load once per tenant (one cache read); screenshot, image-asset and camshot thumbnails use sharp; /user/me and /role-permissions/me answers are reused per token.

Email, inbox, employee, docs and Ever Works

  • Email: SES transport stays in its bucket, a transport without keys is skipped, templated mail only through a transport with its own sender, and replies thread under SES's Message-ID.
  • Inbox: keyset pages don't repeat or skip items, per-mailbox unread counts, thread page shows the newest 200 readable messages, mark-all-read follows filters, answered decisions leave the Decisions tab, and a migration widens inbox-email JSON columns to longtext with inbound lists cut to fit first.
  • Employee: working-employee count matches pickers, and agent profiles return 404 outside the caller's organizations.
  • Docs: inbound email, OCR and AI pipeline on by default, each gated by provider credentials; the signed webhook still fails closed.
  • Ever Works: per-entity sync settings act as direction off, an admin pause survives a 401, outbound retries span two hours, held records release, resync re-applies skipped records, child events apply by child, goals/ideas/initiatives and tasks keep their edits and moves, a docs root change moves the synced tree, page edits the Markdown cannot show keep a version (canonical content hashing), kept-webhook warning stays until a reconnect confirms the deletion, a key of another integration is refused, and a migration keeps the connection (SET NULL) when its organization is deleted; the match review offers only allowed creates and the wizard recovers an inactive connection.
  • Also T-18 daily self-build maintenance and a GraphQL schema snapshot refresh.