-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix duplicate warning messages in wrangler dev #10913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix duplicate warning messages in wrangler dev #10913
Conversation
Changed all logger.warn() calls to logger.once.warn() in ConfigController.ts to prevent duplicate warnings during config updates or state transitions. Fixes #6855 Co-Authored-By: [email protected] <[email protected]>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
🦋 Changeset detectedLatest commit: e498685 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add this?
}); | ||
}); | ||
|
||
it("should only log warnings once even with multiple config updates", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use a remote dev test here—they're flaky. Instead, test Analytics engine bindings with a service worker format worker
The When This ensures each test starts with a clean slate and can independently verify that warnings are shown. |
Good point! I'll update the test to use Analytics Engine bindings with service worker format instead of remote dev mode. |
Changes all logger.warn() calls to logger.once.warn() in ConfigController.ts to ensure warnings are only shown once even when configuration is updated multiple times. Also adds a test to verify warnings are only logged once across multiple config updates. Backport of #10913 to v3-maintenance branch. Co-Authored-By: [email protected] <[email protected]>
Fixes #6855
This PR fixes duplicate warning messages that appear during
wrangler dev
when configuration changes or state transitions occur.Changes
ConfigController.ts: Changed all 6
logger.warn()
calls tologger.once.warn()
to ensure each distinct warning only appears once per sessionTests: Added test case that verifies warnings only appear once even with multiple config updates
Key Review Points
logger.once.warn()
method exists - This assumes the logger has a.once.warn()
method that prevents duplicate messagesLink to Devin run: https://app.devin.ai/sessions/fe4aed656c5945a7adaa0078b1e9e9a8
Requested by: [email protected]