Skip to content

Conversation

@DanielRosenwasser
Copy link
Member

Fixes #2248.

@DanielRosenwasser DanielRosenwasser marked this pull request as ready for review December 6, 2025 17:57
Copilot AI review requested due to automatic review settings December 6, 2025 17:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a panic that occurred when WatchEnabled is false but TypingsLocation is set. In this scenario, the typingsWatch field (and other watch fields) remain nil, but ATA can still attempt to clone them, causing a nil pointer dereference when acquiring the mutex.

  • Added nil check to WatchedFiles[T].Clone() to propagate nil instead of panicking
  • Added unit test to verify nil propagation behavior
  • Added integration test to ensure ATA works correctly with WatchEnabled=false

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
internal/project/watch.go Added nil check in Clone method to prevent panic when called on nil receiver
internal/project/watch_test.go Added unit test verifying Clone returns nil when called on nil WatchedFiles
internal/project/ata/ata_test.go Added integration test ensuring ATA doesn't panic with WatchEnabled=false but TypingsLocation set

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.

Crash from ATA followed by request with no file-watching client capability

2 participants