Skip to content

Fix: remove duplicate IPC channel and extract error code sets#780

Merged
hazeone merged 1 commit intoValueCell-ai:mainfrom
phpoh:fix/preload-duplicate-and-skills-sets
Apr 8, 2026
Merged

Fix: remove duplicate IPC channel and extract error code sets#780
hazeone merged 1 commit intoValueCell-ai:mainfrom
phpoh:fix/preload-duplicate-and-skills-sets

Conversation

@phpoh
Copy link
Copy Markdown
Contributor

@phpoh phpoh commented Apr 7, 2026

Summary

Two small code quality improvements:

  • electron/preload/index.ts: Remove duplicate 'channel:validate' entry in the IPC invoke whitelist (copy-paste oversight)
  • src/pages/Skills/index.tsx: Extract inline error code arrays into module-level Set constants for O(1) lookup and better readability

Changes

File Change
electron/preload/index.ts Remove duplicate 'channel:validate' entry
src/pages/Skills/index.tsx Extract INSTALL_ERROR_CODES, FETCH_ERROR_CODES, SEARCH_ERROR_CODES as Set

Test plan

  • Verify preload IPC whitelist still contains 'channel:validate' (once, not twice)
  • Verify error handling behavior unchanged (Set.has is equivalent to Array.includes for these cases)

- Remove duplicate 'channel:validate' entry in preload IPC whitelist
- Extract inline error code arrays in Skills page to module-level Sets
  for O(1) lookup and better readability
@hazeone
Copy link
Copy Markdown
Contributor

hazeone commented Apr 8, 2026

LGTM

@hazeone hazeone merged commit 3b629e8 into ValueCell-ai:main Apr 8, 2026
5 checks passed
zjfjiayou pushed a commit to zjfjiayou/JitClaw that referenced this pull request Apr 10, 2026
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