Skip to content

fix: set source to http in refreshSkillCatalog catch block to prevent…#2014

Merged
jolestar merged 1 commit into
mainfrom
fix/skill-catalog-error-loop
Jun 26, 2026
Merged

fix: set source to http in refreshSkillCatalog catch block to prevent…#2014
jolestar merged 1 commit into
mainfrom
fix/skill-catalog-error-loop

Conversation

@jolestar

Copy link
Copy Markdown
Collaborator

… infinite loop on persistent errors

@jolestar
jolestar merged commit e1eccc7 into main Jun 26, 2026
4 checks passed
@jolestar
jolestar deleted the fix/skill-catalog-error-loop branch June 26, 2026 00:58
@holonbot

holonbot Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review: fix infinite loop on persistent skill catalog errors

Conclusion: Approve. This is a correct, minimal fix for a real infinite-loop bug.

Why the loop happened

The useEffect in App.tsx:212 re-fires refreshSkillCatalog() whenever skillCatalog.source === "fixture" and the skills route is active. The initial state (emptySkillCatalog) has source: "fixture". Before this fix, the catch block spread ...state.skillCatalog without overriding source, so on a persistent HTTP error the catalog stayed at source: "fixture", and the effect re-triggered indefinitely.

Setting source: "http" in the catch block correctly breaks the loop — the effect guard (source !== "fixture") stops re-firing.

Verification

  • The useEffect dependency array includes skillCatalog.source, so the transition from "fixture" to "http" is observed and prevents re-execution.
  • This matches the existing convention in refreshSkillDetail's catch block (line 943), which already sets { source: "http", error: message }.

Non-blocking observation (nit)

The catch blocks for addSkillToCatalog, removeSkillFromCatalog, updateSkillCatalog, and checkSkillCatalog (~lines 961, 979, 997, 1015) also spread state.skillCatalog without overriding source. These are not affected by the same loop today because they are user-initiated actions (not guarded by the useEffect) and return false on error. For consistency and defense against future effect-driven refetch logic, consider applying the same source: "http" override there as a follow-up.

@holonbot

holonbot Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Holon Run Report

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.

1 participant