Skip to content

fix(desktop): harden workspace watcher fallback#352

Merged
hqhq1025 merged 1 commit into
OpenCoworkAI:mainfrom
mussonking:fix-workspace-watch-fallback
May 23, 2026
Merged

fix(desktop): harden workspace watcher fallback#352
hqhq1025 merged 1 commit into
OpenCoworkAI:mainfrom
mussonking:fix-workspace-watch-fallback

Conversation

@mussonking
Copy link
Copy Markdown
Contributor

Summary

Keep workspace file subscriptions non-fatal when native fs.watch fails with platform-specific system errors, while preserving explicit handling for unavailable workspaces.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions github-actions Bot added the area:desktop apps/desktop (Electron shell, renderer) label May 22, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Review mode: initial

Findings

  • [Minor] Missing changeset for a user-visible behavior change — the PR improves the workspace watcher's error handling for additional system error codes (EINVAL, ENOSPC, ERR_FEATURE_UNAVAILABLE_ON_PLATFORM, etc.) and clarifies the missing-workspace logic. This affects the Files panel reliability and should be listed in the changelog.
    Suggested fix: run pnpm changeset add --type minor (or patch if the fix is considered minor) and commit the generated markdown file.

  • [Nit] Comment cosmetic change (--) in workspace-watcher.ts:28 is inconsistent with the broader codebase style (most comments use -- or ). Not a blocker but consider reverting to match the original intent.

Summary

The PR refactors error code extraction in the workspace watcher, splits the “unavailable workspace” check into its own predicate, and expands the fallback-to-polling error codes to include EINVAL, ENOSPC, and ERR_FEATURE_UNAVAILABLE_ON_PLATFORM. The tests are updated accordingly with parameterized coverage. The change is correct, maintainable, and improves robustness without introducing regressions. The only gap is a missing changeset for a user-visible behavior fix.

Testing

All existing and new parameterized tests pass (pnpm test in apps/desktop). No new integration-level test is required, but adding a simple Vitest test that simulates a real fs.watch rejection with one of the new error codes would strengthen coverage of the fallback path.

Open-CoDesign Bot

@hqhq1025 hqhq1025 merged commit 152b244 into OpenCoworkAI:main May 23, 2026
6 checks passed
hqhq1025 added a commit that referenced this pull request May 23, 2026
Author's PR didn't include a changeset; addressing the bot reviewer's
Minor finding post-merge so the next release notes capture the
behavior change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:desktop apps/desktop (Electron shell, renderer)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants