Skip to content

fix: refresh projects when ancestor folders are deleted#343

Merged
yejseo01 merged 9 commits into
mainfrom
project-refreshes
Jul 17, 2026
Merged

fix: refresh projects when ancestor folders are deleted#343
yejseo01 merged 9 commits into
mainfrom
project-refreshes

Conversation

@yejseo01

Copy link
Copy Markdown
Contributor

Changes

  • Refresh the Projects view when a folder containing a known compose project is deleted.
  • Add a delete-only workspace watcher, avoiding refreshes for file creation or modification.
  • Filter deletion events so unrelated folder deletions do not trigger project refreshes.
  • Dispose of the new watcher and listener with the controller.
  • Add regression tests for relevant deletion, unrelated deletion, and delete-only watcher configuration.

Screenshots

Screen.Recording.2026-07-16.at.16.27.57.mov

@yejseo01 yejseo01 changed the title Refresh projects when ancestor folders are deleted fix:refresh projects when ancestor folders are deleted Jul 16, 2026
@yejseo01
yejseo01 marked this pull request as ready for review July 16, 2026 15:51
@yejseo01
yejseo01 requested a review from a team as a code owner July 16, 2026 15:51
@yejseo01 yejseo01 changed the title fix:refresh projects when ancestor folders are deleted fix: refresh projects when ancestor folders are deleted Jul 16, 2026
@github-actions github-actions Bot added the fix Bug fix for release notes label Jul 16, 2026
expect(model.projects).toStrictEqual(loaded(projects));
});

it('refreshes projects when a project ancestor is deleted', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm skeptical of the utility of these tests - there's a lot of very fragile mock building, and the test ends up primarily checking whether or not the mocks and the code are in sync rather than whether or not the product actually behaves the way we want.

The interesting behaviour here is actually isProjectAncestorDeleted, which is a nice pure function for which we could build a relatively expressive set of tests. You'd have to move it to a different module as it doesn't belong on the public API here.

@federicobozzini federicobozzini left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Well done!

@yejseo01
yejseo01 merged commit 17b4153 into main Jul 17, 2026
4 checks passed
@yejseo01
yejseo01 deleted the project-refreshes branch July 17, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants