fix(channels): log json.Unmarshal errors in List and Webhook handlers #1120

Closed
infra-sre wants to merge 1 commits from sre/channels-unmarshal-errors into main
Member

Summary

Fixes issue #1108 — silent data loss when DB JSONB contains corrupt data.

Changes:

  • handler (lines 70, 89): check after on config and allowed_users. Log error and fall back to zero values (/) instead of returning to client.
  • handler (lines 499, 500): same fix. Falls back to empty map/slice so still runs (logging any decryption errors) rather than silently skipping webhook routing.

Root cause

returns an error when DB JSONB data is corrupt (e.g., partial write, encoding mismatch). The zero-value result was silently returned, causing / in the List response and validation silently failing in webhook handler.

Test plan

  • Build passes (Go compilation check)
  • CI: Platform (Go) passes
  • CI: Handlers Postgres Integration passes (local Postgres integration test)
  • Review: channels team review

🤖 Generated with Claude Code

## Summary Fixes **issue #1108** — silent data loss when DB JSONB contains corrupt data. **Changes:** - handler (lines 70, 89): check after on config and allowed_users. Log error and fall back to zero values (/) instead of returning to client. - handler (lines 499, 500): same fix. Falls back to empty map/slice so still runs (logging any decryption errors) rather than silently skipping webhook routing. ## Root cause returns an error when DB JSONB data is corrupt (e.g., partial write, encoding mismatch). The zero-value result was silently returned, causing / in the List response and validation silently failing in webhook handler. ## Test plan - [x] Build passes (Go compilation check) - [ ] CI: Platform (Go) passes - [ ] CI: Handlers Postgres Integration passes (local Postgres integration test) - [ ] Review: channels team review 🤖 Generated with [Claude Code](https://claude.com/claude-code)
infra-sre added 1 commit 2026-05-15 03:47:46 +00:00
fix(channels): log json.Unmarshal errors in List and Webhook handlers
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 31s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 24s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 41s
CI / Detect changes (pull_request) Successful in 1m20s
Harness Replays / detect-changes (pull_request) Successful in 26s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 33s
qa-review / approved (pull_request) Successful in 28s
security-review / approved (pull_request) Successful in 27s
E2E API Smoke Test / detect-changes (pull_request) Successful in 1m38s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 1m42s
gate-check-v3 / gate-check (pull_request) Successful in 1m4s
sop-checklist / all-items-acked (pull_request) Successful in 37s
sop-tier-check / tier-check (pull_request) Successful in 36s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 1m34s
audit-force-merge / audit (pull_request) Has been skipped
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m57s
Harness Replays / Harness Replays (pull_request) Successful in 14s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 20s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 27s
CI / Python Lint & Test (pull_request) Successful in 8m5s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 6m14s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 6m48s
CI / Canvas (Next.js) (pull_request) Successful in 17m27s
CI / Canvas Deploy Reminder (pull_request) Successful in 8s
CI / Platform (Go) (pull_request) Successful in 18m40s
CI / all-required (pull_request) Successful in 18m33s
d1651fd101
Fixes issue #1108 — silent data loss when DB JSONB contains corrupt data.

List handler: if json.Unmarshal fails on channel config or
allowed_users, log the error and fall back to zero values instead
of returning null to the client.

Webhook handler: same fix. Falls back to empty map/slice so the
DecryptSensitiveFields call still runs (logging any decryption
errors) rather than silently skipping webhook processing.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
infra-sre added the merge-queuetier:low labels 2026-05-15 03:49:19 +00:00
Author
Member

Closing in favor of PR #1109 which covers the same fix plus rows.Err() checks and unit tests (more complete).

Closing in favor of PR #1109 which covers the same fix plus `rows.Err()` checks and unit tests (more complete).
infra-sre closed this pull request 2026-05-15 03:51:22 +00:00
All checks were successful
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 31s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 24s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 41s
CI / Detect changes (pull_request) Successful in 1m20s
Harness Replays / detect-changes (pull_request) Successful in 26s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 33s
qa-review / approved (pull_request) Successful in 28s
security-review / approved (pull_request) Successful in 27s
E2E API Smoke Test / detect-changes (pull_request) Successful in 1m38s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 1m42s
gate-check-v3 / gate-check (pull_request) Successful in 1m4s
sop-checklist / all-items-acked (pull_request) Successful in 37s
sop-tier-check / tier-check (pull_request) Successful in 36s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 1m34s
audit-force-merge / audit (pull_request) Has been skipped
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m57s
Harness Replays / Harness Replays (pull_request) Successful in 14s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 20s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 27s
CI / Python Lint & Test (pull_request) Successful in 8m5s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 6m14s
Required
Details
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 6m48s
Required
Details
CI / Canvas (Next.js) (pull_request) Successful in 17m27s
CI / Canvas Deploy Reminder (pull_request) Successful in 8s
CI / Platform (Go) (pull_request) Successful in 18m40s
CI / all-required (pull_request) Successful in 18m33s
Required
Details

Pull request closed

Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#1120