Skip to content

Fix: eliminate silently swallowed errors via .catch(() => {}) - #744

Merged
joryirving merged 1 commit into
mainfrom
recover/issue-681
Aug 7, 2026
Merged

joryirving merged 1 commit into
mainfrom
recover/issue-681

Conversation

@joryirving

Copy link
Copy Markdown
Contributor

Summary

  • Recovers completed coder work that was stranded on an unreviewable branch.

Refs #681

Provenance

The coder finished this successfully (verdict GO) on foreman/wl-misospace-dispatch-0/issue-0, commit 167065904. The review never ran: foreman's litellm key was not scoped to the reviewer alias, so every review request was rejected and the task ended INCOMPLETE, and no PR was opened.

That branch name is derived from issue number 0, which is a bug — it is shared by every third-attempt retry in this repo, so the commit was one retry away from being force-pushed over. Cherry-picked onto a non-foreman/* branch to preserve it.

Not using a closing keyword: foreman may still redo this issue, and it owns the issue lifecycle.

Verification

  • Cherry-pick applied cleanly onto main; no conflicts.
  • No manual edits — the diff is the original commit.

Replace all 6 instances of .catch(() => {}) with proper error logging
using console.error, ensuring errors are visible in logs for debugging.

Affected files:
- src/app/api/automation/sync/route.ts (lock release)
- src/app/api/sync/route.ts (lock release)
- src/app/api/sync/scheduled/route.ts (sync run update + lock release)
- src/lib/automation-sync.ts (automation repo error state update)
- src/app/automation/page.tsx (PR fix queue fetch)
- src/app/login/page.tsx (session check)

Fixes #0

Signed-off-by: Saffron <263493777+itsmiso-ai@users.noreply.github.com>
@joryirving joryirving self-assigned this Aug 7, 2026

@its-saffron its-saffron Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI Automated Review

Full PR review.

Analysis engine: MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic) — routed smart (risk match: public_route_changes)

Review

Recommendation: Approve.

This PR replaces .catch(() => {}) (which silently swallows errors) with .catch((error) => { console.error(...) }) across 6 files. The changes are consistent, targeted, and improve observability without altering behavior or access patterns.

Change-by-Change Findings

File Change Assessment
src/app/api/automation/sync/route.ts Added error logging for lock release failure in finally block ✅ Safe improvement
src/app/api/sync/route.ts Added error logging for lock release failure in finally block ✅ Safe improvement
src/app/api/sync/scheduled/route.ts Added error logging for 2 catch blocks (sync run error state + lock release) ✅ Safe improvement
src/app/automation/page.tsx Added error logging for PR fix queue fetch failure ✅ Safe improvement
src/app/login/page.tsx Added error logging for session check failure ✅ Safe improvement
src/lib/automation-sync.ts Added error logging for automation repo error state update ✅ Safe improvement

Must-Check Items

✅ verify route access controls are in place

This PR does not modify authentication or authorization logic. The affected API routes (/api/automation/sync, /api/sync, /api/sync/scheduled) retain whatever access controls they had before. No new routes are exposed. The frontend pages (/automation, /login) are standard UI routes and unchanged in terms of access.

✅ check for unintended public endpoints

No new endpoints are introduced. The changes are limited to error handling within existing handlers. No route paths, HTTP methods, or middleware were altered.

Standards Compliance

  • Error handling: The AGENTS.md convention requires "provide meaningful error messages" via error instanceof Error pattern. The PR uses console.error with descriptive messages and includes the error object, which aligns with improved observability. The existing console.error patterns in the codebase (e.g., in src/app/api/sync/route.ts line 72) confirm this is the project's convention for logging at the route level.
  • No auth changes: No authentication logic was modified.
  • CI: All checks passed (lint, typecheck, build, tests, docker, npm audit).

Tool Harness Findings

No tool calls were issued; reviewing the corpus directly.

Unknowns / Needs Verification

None — the diff is self-contained, CI passed, and the changes are trivially verifiable.

@joryirving
joryirving merged commit ebe1f91 into main Aug 7, 2026
7 checks passed
@joryirving
joryirving deleted the recover/issue-681 branch August 7, 2026 15:09
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.

2 participants