Skip to content

Fix silent error suppression across workflow engine#114

Merged
intel352 merged 4 commits intomainfrom
copilot/audit-error-suppression
Feb 23, 2026
Merged

Fix silent error suppression across workflow engine#114
intel352 merged 4 commits intomainfrom
copilot/audit-error-suppression

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

Errors captured but never logged or returned, making failures invisible in production. Affects persistence operations, distributed locking, seed loading, and HTTP response writes.

Changes

module/jwt_auth.go

  • Added logger modular.Logger field to JWTAuthModule, initialized via app.Logger() in Init()
  • Seed file load failure now logs at Warn instead of _ = err (comment already said "log but don't prevent startup")

module/api_crud_handler.go / module/api_workflow_handler.go

  • Persistence SaveResource / DeleteResource errors now logged via h.logger.Warn() on POST, PUT, DELETE, and state sync

module/api_v1_handler.go

  • StopWorkflow failure now logged via log.Printf (comment said "Log but don't fail" but didn't)

scale/distributed_lock.go

  • Redis lock release failure in buildRelease now logged via log.Printf

module/integration.go

  • resp.Body.Close(), r.Body.Close(), and w.Write() errors in HTTP/webhook connectors now logged via log.Printf

module/http_trigger.go / module/http_handlers.go

  • Response write and JSON encode errors now logged via log.Printf

Example (before/after)

// Before — seed users silently fail to load
if err := j.loadSeedUsers(j.seedFile); err != nil {
    _ = err // Non-fatal: log but don't prevent startup
}

// After
if err := j.loadSeedUsers(j.seedFile); err != nil {
    j.logger.Warn("failed to load seed users", "file", j.seedFile, "error", err)
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Ecosystem: Audit and fix silent error suppression across repositories</issue_title>
<issue_description>## Problem

A systemic pattern across multiple repos: errors are captured but silently discarded, making failures invisible in production.

Instances

workflow-plugin-bento

  • stream.go:58-60: stream.Run() error silently dropped — stream crashes are invisible
  • trigger.go:149-151: Same pattern — Bento input crashes don't propagate to trigger callback

workflow-cloud

  • tenant_provision.go:96: DB insert errors silently ignored
  • step_tenant_deploy.go:80: ON CONFLICT DO NOTHING swallows deployment conflicts

workflow-ui

  • SSE utility silently ignores malformed JSON messages

workflow (engine)

  • Some error paths in middleware chains suppress errors

Fix Pattern

Each instance should either:

  1. Log the error at appropriate level (warn/error)
  2. Return the error to the caller for handling
  3. Emit a metric (error counter) for observability
  4. At minimum, never use _ = err without a comment explaining why it's safe</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…, distributed lock, integration, http handlers

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot AI changed the title [WIP] Audit and fix silent error suppression across repositories Fix silent error suppression across workflow engine Feb 23, 2026
Copilot AI requested a review from intel352 February 23, 2026 07:55
@intel352 intel352 marked this pull request as ready for review February 23, 2026 07:59
Copilot AI review requested due to automatic review settings February 23, 2026 07:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR systematically fixes silent error suppression across the workflow engine by adding logging for previously ignored errors in persistence operations, distributed locking, HTTP response writes, and seed data loading. The changes make production failures visible without altering the non-fatal error handling semantics that allow operations to continue.

Changes:

  • Added structured logger field to JWTAuthModule and logged seed file load failures
  • Logged persistence save/delete errors in REST API handlers using existing logger
  • Logged Redis lock release failures, HTTP body close errors, and response write failures using log.Printf

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scale/distributed_lock.go Added logging for Redis lock release failures in buildRelease function
module/jwt_auth.go Added logger field initialization and logged seed user load failures
module/integration.go Logged HTTP response body close, request body close, and webhook response write errors
module/http_trigger.go Logged HTTP response write errors in workflow trigger handler
module/http_handlers.go Logged JSON encode errors in simple HTTP handler
module/api_workflow_handler.go Logged persistence save errors during workflow state sync
module/api_v1_handler.go Logged workflow stop errors in admin API
module/api_crud_handler.go Logged persistence save and delete errors in POST, PUT, DELETE operations

@intel352 intel352 merged commit 06ecdab into main Feb 23, 2026
14 checks passed
@intel352 intel352 deleted the copilot/audit-error-suppression branch February 23, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ecosystem: Audit and fix silent error suppression across repositories

3 participants