Skip to content

fix: restart watch service when project configuration changes#176

Closed
phernandez wants to merge 1 commit intomainfrom
fix/156-watch-service-restart-on-project-changes
Closed

fix: restart watch service when project configuration changes#176
phernandez wants to merge 1 commit intomainfrom
fix/156-watch-service-restart-on-project-changes

Conversation

@phernandez
Copy link
Copy Markdown
Member

Resolves issue where new projects created via MCP tools weren't being watched by the file synchronization service. The watch service now automatically restarts when projects are added, removed, or when the project configuration changes.

Implementation:

  • Add file-based signaling mechanism for watch service restarts
  • ProjectService signals restart when projects are added/removed
  • WatchService checks for restart signal on each file change batch
  • Watch loop recreates service instances to pick up new projects
  • Add comprehensive tests for the restart signal mechanism

Note: New projects will only be picked up for watching after the next file change occurs in any existing project, as the restart signal is checked during file change processing.

Fixes #156

🤖 Generated with Claude Code

Resolves issue where new projects created via MCP tools weren't being
watched by the file synchronization service. The watch service now
automatically restarts when projects are added, removed, or when the
project configuration changes.

Implementation:
- Add file-based signaling mechanism for watch service restarts
- ProjectService signals restart when projects are added/removed
- WatchService checks for restart signal on each file change batch
- Watch loop recreates service instances to pick up new projects
- Add comprehensive tests for the restart signal mechanism

Note: New projects will only be picked up for watching after the next
file change occurs in any existing project, as the restart signal is
checked during file change processing.

Fixes #156

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@phernandez
Copy link
Copy Markdown
Member Author

I'm going to close this PR and reimplement it.

@phernandez phernandez closed this Aug 29, 2025
phernandez added a commit that referenced this pull request Oct 15, 2025
Refines the idempotent project creation behavior and adds validation for
project deletion to prevent user errors.

Changes:
- Project creation now properly validates path matching for true idempotency
  - Same name + same path: Returns 200 OK (idempotent)
  - Same name + different path: Returns 400 with clear error message
- Project deletion now prevents removing the default project
  - Returns 400 with helpful error listing alternative projects
  - Prevents accidental deletion of the only/default project

This fixes issues encountered by tenant user_01K7GCGSPZ4A63H3QA5M9AMT23
who experienced 32 errors (15 delete failures, 12 create failures) due to
inadequate validation.

Tests:
- Added 6 new comprehensive tests for validation logic
- All 24 tests pass with 97% coverage on project_router
- No regressions detected

Fixes #173 (tenant errors)
Related: #175 (delete validation), #176 (set default validation)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
phernandez added a commit that referenced this pull request Oct 15, 2025
Refines the idempotent project creation behavior and adds validation for
project deletion to prevent user errors.

Changes:
- Project creation now properly validates path matching for true idempotency
  - Same name + same path: Returns 200 OK (idempotent)
  - Same name + different path: Returns 400 with clear error message
- Project deletion now prevents removing the default project
  - Returns 400 with helpful error listing alternative projects
  - Prevents accidental deletion of the only/default project

This fixes issues encountered by tenant user_01K7GCGSPZ4A63H3QA5M9AMT23
who experienced 32 errors (15 delete failures, 12 create failures) due to
inadequate validation.

Tests:
- Added 6 new comprehensive tests for validation logic
- All 24 tests pass with 97% coverage on project_router
- No regressions detected

Fixes #173 (tenant errors)
Related: #175 (delete validation), #176 (set default validation)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review A human needs to look at this issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] New project is not synced when config changes (new project added)

1 participant