-
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
Fix duplicate warning messages in wrangler dev #10913
Conversation
🤖 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: 5a47225 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: |
packages/wrangler/src/__tests__/api/startDevWorker/ConfigController.test.ts
Show resolved
Hide resolved
|
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: smacleod@cloudflare.com <smacleod@cloudflare.com>
e498685 to
6dcc94d
Compare
|
Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the Depending on your changes, running Notes:
|
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: smacleod@cloudflare.com <smacleod@cloudflare.com>
Co-Authored-By: smacleod@cloudflare.com <smacleod@cloudflare.com>
Co-Authored-By: smacleod@cloudflare.com <smacleod@cloudflare.com>
6dcc94d to
f6f4f78
Compare
|
Congratulations @devin-ai-integration[bot], the maintainer of this repository has issued you a holobyte! Here it is: https://holopin.io/holobyte/cmh98emd100del404421ko5ms This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account. |
…#10962) * fix: prevent duplicate warning messages in wrangler dev (v3 backport) 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: smacleod@cloudflare.com <smacleod@cloudflare.com> * Add changeset for v3 backport Co-Authored-By: smacleod@cloudflare.com <smacleod@cloudflare.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: smacleod@cloudflare.com <smacleod@cloudflare.com>
Fixes #6855
This PR fixes duplicate warning messages that appear during
wrangler devwhen 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: smacleod@cloudflare.com