File tree Expand file tree Collapse file tree 2 files changed +19
-14
lines changed
crates/turborepo-lib/src/run
turborepo-tests/integration/tests/watch Expand file tree Collapse file tree 2 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -182,8 +182,24 @@ impl WatchClient {
182182 let notify_event = notify_run. clone ( ) ;
183183
184184 let event_fut = async {
185+ let mut first_rediscover = true ;
185186 while let Some ( event) = events. next ( ) . await {
186187 let event = event?;
188+
189+ // Skip the first RediscoverPackages event which is sent immediately by the
190+ // daemon when we connect. The file watcher will send the real
191+ // one.
192+ if first_rediscover {
193+ if matches ! (
194+ event. event,
195+ Some ( proto:: package_change_event:: Event :: RediscoverPackages ( _) )
196+ ) {
197+ first_rediscover = false ;
198+ continue ;
199+ }
200+ first_rediscover = false ;
201+ }
202+
187203 Self :: handle_change_event ( & changed_packages, event. event . unwrap ( ) ) ?;
188204 notify_event. notify_one ( ) ;
189205 }
@@ -200,10 +216,11 @@ impl WatchClient {
200216 // if notify exits, then continue per usual
201217 // if persist exits, then we break out of loop with a
202218 select ! {
203- _ = notify_run . notified ( ) => { } ,
219+ biased ;
204220 _ = persistent => {
205221 break ;
206222 }
223+ _ = notify_run. notified( ) => { } ,
207224 }
208225 } else {
209226 notify_run. notified ( ) . await ;
Original file line number Diff line number Diff line change @@ -19,19 +19,7 @@ Disabling daemon so this matches behavior when running test on CI
1919 web: dev: npm ERR! in workspace: web
2020 web: dev: npm ERR! at location: .* (re )
2121 web: dev: ERROR: command finished with error: command .* npm(?: \. cmd)? run dev exited \(1 \) (re )
22- web# dev: command .*npm(?:\.cmd)? run dev exited \(1\) (re)
23- web: dev: cache bypass, force executing bfb830bdb7d49cb8
24- web: dev:
25- web: dev: > dev
26- web: dev: > echo server crashed && exit 1
27- web: dev:
28- web: dev: server crashed
29- web: dev: npm ERR! Lifecycle script `dev` failed with error:
30- web: dev: npm ERR! Error: command failed
31- web: dev: npm ERR! in workspace: web
32- web: dev: npm ERR! at location: .* (re )
33- web: dev: ERROR: command finished with error: command .* npm(?: \. cmd)? run dev exited \(1 \) (re )
3422 web# dev: command .*npm(?:\.cmd)? run dev exited \(1\) (re)
3523 x persistent tasks exited unexpectedly
3624
37- [1 ]
25+ [1 ]
You can’t perform that action at this time.
0 commit comments