fix+refactor(vcs): fix HEAD filter bug and effectify VcsService#17634
Closed
kitlangton wants to merge 2 commits intoeffectify-file-watcher-servicefrom
Closed
fix+refactor(vcs): fix HEAD filter bug and effectify VcsService#17634kitlangton wants to merge 2 commits intoeffectify-file-watcher-servicefrom
kitlangton wants to merge 2 commits intoeffectify-file-watcher-servicefrom
Conversation
ab633a4 to
99147a7
Compare
Two tests pass (branch() reads current branch correctly). Two tests fail: BranchUpdated never fires because the FileWatcher event filter in vcs.ts has an inverted condition — it skips HEAD changes instead of filtering for them.
Convert Vcs from Instance.state namespace to an Effect ServiceMap.Service on the Instances LayerMap. Uses Instance.bind for the Bus.subscribe callback (same ALS pattern as FileWatcherService). Branch state is managed in the layer closure with scope-based cleanup.
de8e82c to
b6b4125
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
endsWith("HEAD")filter in Vcs branch detection — was skipping HEAD events instead of filtering for them, soBranchUpdatednever fired from the native watcherInstance.statenamespace to an EffectServiceMap.Serviceon the InstancesLayerMapInstanceContextto its own file (instance-context.ts) to break circular imports as more services join the LayerMapwithServicestest fixture andwatcherConfigLayerfor instance-scoped Effect service testsStacked on #17601.
Testing
bun run test test/project/vcs.test.ts test/file/watcher.test.tsbunx tsgo --noEmit