Repository navigation
batch(2026-07-05): Slack multi-org, region filtering, mail-checker hang fixes, live-status dot - #100
Merged
Merged
Conversation
…d installs and connections
…rg-scoped installs and connections
…org/channelUid from public Install
Co-Authored-By: Claude Fable 5 <[email protected]>
Placement changed from the main page header to the sidebar footer utility row (next to LanguageSwitcher/ThemeToggle) to avoid overloading the header. Co-Authored-By: Claude Fable 5 <[email protected]>
…coped installs and connections
…: org-scoped installs and connections
…oped installs and connections
…outing and uninstall fan-out
…nbound routing and uninstall fan-out
Returns every non-deleted connection matching a settings property across all orgs, ordered created_at ASC. Backs the Slack inbound-routing deterministic fallback and app_uninstalled fan-out (spec 2026-07-05-02).
GetConnectionByTeamID is the single choke point every inbound handler (mentions, slash commands, events, interactions, GetClient) goes through. Reworked to: (1) prefer the org recorded in organization_providers for the team (home org, first-install-wins — same org Marketplace/Sign-in-with-Slack already land in), (2) fall back to the oldest connection (created_at ASC) when there's no home org or its own connection was deleted, logging a warning when more than one connection exists so ambiguity is observable. Fixes the random-org bug where a workspace connected to two orgs would have commands land in whichever row an unordered Scan happened to return.
Uninstalling the Slack app revokes the bot token for the whole workspace, so every org's connection for that team_id shares the same now-dead credentials. HandleAppUninstalled now loops ListChannelsByProperty and soft-deletes each one, instead of deleting only the first row an unordered lookup happened to return — the other orgs no longer keep rendering a stale "connected" integration after uninstall.
Root cause: ListChannels unconditionally filtered
Where("organization_uid = ?", filter.OrganizationUID); CountInstalledTeams
called it with no OrganizationUID set, so the empty string matched zero
rows on both engines and the Socket Mode status snapshot silently always
reported 0 installed teams. Made the org filter conditional on a non-empty
OrganizationUID (every other ListChannels caller already passes a real org
UID, so this is a no-op for them) so an org-less filter genuinely lists
across all orgs.
CountInstalledTeams now lists globally and dedupes by settings.team_id,
so a workspace connected to two orgs counts once, matching what a single
Slack Socket Mode connection actually represents.
golangci-lint's typecheck failed because mockDBService (used only by
notifications tests) no longer satisfied db.Service after adding
ListChannelsByProperty to the interface. Stubs with the same
panic("not implemented") pattern as its neighboring methods, since no
test in this file exercises it.
…nd routing and uninstall fan-out
Add a dedicated, minimal test for the spec's exact wording ("Socket Mode
status reports 1 installed team for a two-org workspace") rather than
relying only on the broader three-connection dedup test's arithmetic.
…s (2/2): inbound routing and uninstall fan-out Reworks GetConnectionByTeamID (the single choke point every inbound Slack handler goes through) to resolve to the workspace's home org first, with a deterministic oldest-connection fallback, so commands/mentions/interactions no longer land in a random org for a multi-org workspace. Fans out app_uninstalled cleanup across every connected org's connection, and fixes CountInstalledTeams to count distinct workspaces instead of connection rows (which also fixes a latent bug where it silently always returned 0).
…d routing and uninstall fan-out
…r panicking checker must never take down the fleet
…flag The plain bool captured by the child goroutine's closure was written by the select's abandon branch (parent goroutine) and read by the child's deferred cleanup with no synchronization between them — go test -race didn't reliably catch it because the child's defer runs long after the write in the tests, but it is a genuine race under different scheduling. Switched to atomic.Bool.
…— a hung or panicking checker must never take down the fleet
… panicking checker must never take down the fleet
…ll-known port (and mirror it in the check form)
…m the well-known port (and mirror it in the check form)
Mirrors checksmtp's useImplicitTLS := port == implicitTLSPort && !StartTLS precedent: when neither tls nor starttls is set on a stored check, port 993 (IMAP) / 995 (POP3) now dials with implicit TLS at execution time instead of speaking plaintext to a TLS-only endpoint and hanging/timing out. An explicit tls:true is preserved at any port; an explicit starttls:true still wins over the port-derived default. Execution-time derivation only — PATCH semantics and Validate()'s tls+starttls rejection are unchanged, so existing stored checks start working on deploy with no edit required.
checkimap/samples.go already sets TLS: true alongside port 993 (verified, no change needed). The docs site's IMAP/POP3 sections only showed URL forms (imaps://, pop3s://); add TLS/STARTTLS option rows plus a tip calling out that a JSON check config should set "tls": true explicitly with port 993/995, so a reader translating the URL form into JSON doesn't drop the flag (D3) — independent of the execution-time derivation, which is a safety net rather than the documented contract.
…o-toggle The IMAP/POP3 check config forms had no TLS/STARTTLS UI at all (only host/port/username/password) despite the backend config fully supporting tls/starttls — so there was no way to express the settings the new server-side derivation (checkimap/checkpop3) reasons about. Split "ssh" out of the shared "ssh"/"pop3"/"imap" case (ssh has no TLS concept) and add, for pop3/imap only: - A "Use implicit TLS" checkbox and a "Use STARTTLS" checkbox, reusing the tls/startTLS state already shared globally across the form (same hooks SMTP/gRPC/Kafka/MQTT/RabbitMQ already use). - D2's port<->TLS auto-toggle affordance: typing the well-known implicit- TLS port (993 IMAP / 995 POP3) auto-checks the TLS checkbox and shows a "Port NNN uses implicit TLS." hint; the port input's placeholder reflects the current TLS state (993/995 when TLS is on, 143/110 otherwise) rather than being static. Purely client-side guidance — the server derives independently regardless of what the client sends. - Wire tls/starttls into both existing config-building switches (preview useMemo and submit handler). Add the hint-under-checkbox pattern to the design reference (previously undocumented) since this fix introduces the first real usage of it. Extend e2e/checks.spec.ts with two new tests covering the auto-toggle behavior and the tls:true round-trip through create -> edit.
…e well-known port (and mirror it in the check form)
… TLS from the well-known port Derives implicit TLS from the well-known port (993 IMAP / 995 POP3) at execution time when neither tls nor starttls is explicitly set, mirroring the checksmtp precedent. Existing stored checks (e.g. the o365 webingenia ones) start working on deploy with no edit needed. Adds symmetric unit tests for both checkers (derivation logic + a real TLS-listener dial), adds the previously-missing TLS/STARTTLS UI to the dash0 IMAP/POP3 forms with a client-side port<->TLS auto-toggle affordance, and spells out tls:true explicitly in samples/docs so copy-pasted configs stay unambiguous.
… well-known port (and mirror it in the check form)
Previously gated on authenticated=true (set only after hello), so a failed connect attempt (server unreachable, close before hello) emitted no callback at all. A connection-status consumer derived from these callbacks would show "connecting" forever while attempts fail in a loop.
Replaces the private globalLive boolean with connecting/live/ reconnecting/disabled, derived getGlobalLive() so useLiveStatus/ useScopeLive and poll stretching stay unchanged, and a new useLiveConnectionStatus() hook for the upcoming sidebar status dot. disabled is terminal and sticky at the registry level.
New LiveStatusDot component reads useLiveConnectionStatus() and maps it to the existing ok/warning/error dot conventions (green/red/gray), wrapped in the shared Tooltip primitive with data-testid/data-status for tests. Mounted in the AppSidebar footer utility row alongside LanguageSwitcher/ThemeToggle; nothing added to the main page header. Added to the design reference page per the catalog convention.
live/connecting/reconnecting/unavailable labels for the sidebar live- connection status dot, in common.json alongside the other sidebar- footer utility strings (switchToDarkMode etc.).
Two new cases in live-updates.spec.ts: the dot shows data-status="live" once the dashboard is streaming, and it flips to "reconnecting" on a forced server-initiated close (routeWebSocket pass-through proxy, same pattern as the existing reconnect-replay test) before the automatic reconnect brings it back to "live". The reconnecting-state watch is armed via waitForFunction before navigating, in parallel with the initial connect/close/reconnect cycle — on localhost that whole cycle can complete in under a second, faster than a sequential wait-for-live-then-poll-for-red assertion could ever observe.
…n status dot (green/gray/red) - live-socket.ts: onDisconnected now fires on every non-permanent close, regardless of authentication state, so a status consumer never gets stuck showing "connecting" during a run of failed attempts. - LiveEventsContext.tsx: four-state LiveConnectionStatus (connecting/live/reconnecting/disabled) replaces the private boolean; getGlobalLive() is now derived so useLiveStatus/useScopeLive and poll stretching are unchanged; new useLiveConnectionStatus() hook. - New LiveStatusDot component in the AppSidebar footer utility row (green/red/gray), added to the design reference page. - i18n liveStatus.* strings in en/fr/de/es. - Unit tests for the registry state machine and live-socket signaling; Playwright coverage for the green and red states via routeWebSocket.
Merged
fclairamb
added a commit
that referenced
this pull request
Jul 5, 2026
PR #100's squash commit bundled 8 independently-audited specs behind one flattened bullet, and PR #104's squash commit used a non-standard "Batch:" type prefix that release-please's conventional-commit parser doesn't recognize at all, so its 7 specs were silently absent from this release entirely. Expand both into their actual constituent features, sourced from each PR's own itemized description. Co-Authored-By: Claude Sonnet 5 <[email protected]>
fclairamb
added a commit
that referenced
this pull request
Jul 8, 2026
🤖 I have created a release *beep* *boop* --- ## [0.2.1](v0.2.0...v0.2.1) (2026-07-08) ### Features * **dash0:** one-click MCP connector setup — AI assistants page with a URL-only OAuth flow, per-client icons, shared copy/collapsible code primitives ([#111](#111)) ([d105be4](d105be4)) * **dash0:** Recent activity links directly to the originating incident/check and shows the channel name; incident lifecycle events enriched with check UID/name ([#111](#111)) ([d105be4](d105be4)) * **entitlements:** SaaS Free-plan defaults now match the billing Free plan (10 checks, 6/min, no SSO), with a backend-driven "Free"/"Team"/"Self-hosted" plan display identity ([#111](#111)) ([d105be4](d105be4)) * **devloop:** `make dev`/`make dev-test` supervise dash0 and status0 with size-rotated per-process logs instead of unbounded raw output ([#111](#111)) ([d105be4](d105be4)) ### Bug Fixes * **checks:** list endpoint no longer overfetches O(retention) raw rows per check for `lastResult` — one row per check via `DISTINCT ON` ([#111](#111)) ([d105be4](d105be4)) * **e2e:** dashboard E2E suite flaked on per-test login contention; authenticate once per Playwright worker instead of once per test ([#111](#111)) ([d105be4](d105be4)) * **db:** embedded-Postgres orphan sweep + watchdog reclaims leaked dev/test instances left behind by crashed processes ([#111](#111)) ([d105be4](d105be4)) * **realtime:** check-detail live subscription used the URL slug instead of the canonical uid, silently breaking live updates on slug-based check URLs ([#111](#111)) ([d105be4](d105be4)) * **e2e:** hardcoded `localhost:4000` in several spec files ignored `E2E_BASE_URL`, breaking test runs against non-default servers ([#111](#111)) ([d105be4](d105be4)) * **checkworker:** check results fell back to a null region for default-region checks instead of the executing worker's own region ([#111](#111)) ([d105be4](d105be4)) * **notifications:** a malformed notification UID errored on the Postgres `uuid` column cast instead of rendering the friendly not-found state ([#111](#111)) ([d105be4](d105be4)) * **dash0:** live-socket CONNECTING crash + route-level error boundaries ([#108](#108)) ([008c015](008c015)) * **deps:** update go dependencies (non-major) ([#109](#109)) ([ec616d4](ec616d4)) * **deps:** update module github.com/oapi-codegen/oapi-codegen/v2 to v2.7.2 ([#110](#110)) ([09d6ad0](09d6ad0)) * **deps:** update module github.com/ohler55/ojg to v1.28.2 ([#107](#107)) ([335615c](335615c)) * **deps:** update module github.com/wneessen/go-mail to v0.8.0 ([#103](#103)) ([aa533c1](aa533c1)) * Slack multi-org, region filtering, mail-checker hang fixes, live-status dot ([#100](#100)) ([35f3aa2](35f3aa2)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This was referenced Sep 8, 2026
Closed
Closed
3 tasks done
fclairamb
added a commit
that referenced
this pull request
Sep 22, 2026
…s thread (#420) ## Summary Pressing **Acknowledge** on a Discord alert rewrote the alert card in the channel ("✅ #100 … acknowledged by @you") and posted a follow-up — but into the alerts channel, never into the incident's thread, while every later follow-up ("Incident resolved", …) lands in that thread. The comment is a lie in `postAcknowledgmentNotice` (it says "into the incident's thread" and posts to `interaction.ChannelID`), and the ack-notice fan-out deliberately skips the origin guild on the promise that the thread notice already happened (see the doc comment on `AcknowledgeIncidentFromDiscord`). Net result: nothing about the ack ever reached the thread. - `postAcknowledgmentNotice` now resolves the incident's thread from the forward `incidents/<uid>/discord/thread` state entry the notification sender wrote at post time, un-archives it first (same dance `postThreadReply` does for late follow-ups), and posts there. - Falls back to the channel when no thread is on record (thread creation denied, DM destination) — same as before. - The state-entry key constants move to the discord integration package so the sender and the interaction path share one definition. ## Test plan - [x] New e2e-style unit test: with a seeded thread state entry, the ack notice posts into `T-INC-1` (the thread), not `C-ALERTS` - [x] New test pinning the no-thread fallback to the channel - [x] `go test ./internal/integrations/discord/... ./internal/notifications/... ./internal/handlers/incidents/...` green; golangci-lint (v2.13.2) clean on both touched packages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This batch fixes a live production incident (mail checkers hanging the check-worker fleet) and adds several related features, implemented via
/implement-todoswith an independent completeness audit per spec before archiving.Independently audited clean and archived:
org/channelUidparams, plus a connection collision when one Slack workspace is installed into multiple orgs.checkimap/checkpop3/checksmtpnow set a socket deadline after dial, so a silent TLS-only endpoint times out cleanly instead of hanging the check forever.timeoutresult.tls/starttlsnow default to implicit TLS (matching the existingchecksmtpprecedent), fixing the exact misconfiguration that triggered the incident; dashboard forms gained TLS/STARTTLS controls they didn't previously have, with a port↔TLS auto-toggle affordance.specs/todos/rather thanspecs/done/. Worth a follow-up look before considering it fully closed out, though the interrupted audit had already verified nearly everything as ✅ (state machine, component, i18n, edge cases, unit tests) — the only open item was an E2E fixture issue that looked environmental rather than a real defect.Test plan
specs/done/2026/07/for what was verified.make build-backend lint-back testgreen throughout.make build-dash0+ dash0eslintgreen with no new errors introduced (pre-existing ~45-error baseline unchanged).make build-docsgreen.git worktreeat the pre-batch commit) and pass post-fix.🤖 Generated with Claude Code