Skip to content

Commit

Permalink
fix bundle controller race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
penalosa committed Oct 10, 2024
1 parent 8360415 commit 4f0abde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions fixtures/entrypoints-rpc-tests/tests/entrypoints.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -857,8 +857,6 @@ test("should throw if binding to version of wrangler without entrypoints support
// Intentionally omitting `entrypointAddresses`
})
);
expect(response.status).toBe(200);
expect(await response.text()).toBe("null");

// Wait for error to be thrown
await waitFor(() => {
Expand Down
6 changes: 4 additions & 2 deletions packages/wrangler/src/api/startDevWorker/BundlerController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,10 @@ export class BundlerController extends Controller<BundlerControllerEventMap> {
},
(cb) => {
const newBundle = cb(this.#currentBundle);
this.emitBundleCompleteEvent(config, newBundle);
this.#currentBundle = newBundle;
if (!buildAborter.signal.aborted) {
this.emitBundleCompleteEvent(config, newBundle);
this.#currentBundle = newBundle;
}
},
(err) => {
if (!buildAborter.signal.aborted) {
Expand Down

0 comments on commit 4f0abde

Please sign in to comment.