mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-20 23:57:11 -04:00
[PR #323] [MERGED] fix(installer): propagate swallowed GatherUpdatesInfo errors #318
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vxcontrol/pentagi/pull/323
Author: @mrigankad
Created: 5/31/2026
Status: ✅ Merged
Merged: 5/31/2026
Merged by: @asdek
Base:
main← Head:fix/installer-swallowed-gather-error📝 Commits (1)
6bea158fix(installer): propagate swallowed GatherUpdatesInfo errors📊 Changes
1 file changed (+10 additions, -10 deletions)
View changed files
📝
backend/cmd/installer/processor/logic.go(+10 -10)📄 Description
Problem
In the installer processor (
cmd/installer/processor/logic.go), failures from the post-operation state refreshchecker.GatherUpdatesInfo(ctx)were silently discarded. As a resultapply/install/update/remove/purgecould report success to the UI even when the post-step refresh actually failed.Surfaced by
golangci-lint(ineffassign), which the project's CI runs with--issues-exit-code=0, so these never blocked anything.Root Cause
Two distinct patterns wrapped the error into a value that was then thrown away:
Deferred closures in
applyChanges,install,update,purge:The inner
if err := ...shadows the function's named returnerr, so the wrap never reaches the outerdefer sendCompletion(stack, err).ProductStackWorkerswitch cases inremoveandpurge:The block-local
erris wrapped but the case falls through without returning — even though every sibling check in the same switchreturns on error.Solution
gatherErrlocal and assign the named returnerr, so the failure propagates tosendCompletion.returnthe wrapped error, matching the sibling checks in the sameswitch.The two contexts need different fixes: a deferred closure cannot
returnthe operation's error, so it must assign the named return; the switch cases follow the established early-return-on-error contract.Testing
Risk Assessment
Low. Behavior changes only on the previously-swallowed error path:
GatherUpdatesInfofailure that was previously hidden (no early return added — semantics of the success path unchanged).GatherUpdatesInfoerror, consistent with every adjacent check in the same switch. The success path (err == nil) is unchanged.No public API, schema, or migration changes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.