Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Oct 8, 2025

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 to logger.once.warn() to ensure each distinct warning only appears once per session

    • Analytics Engine service-worker format warning
    • Live services binding warning
    • Upstream protocol HTTP warning
    • Queues remote mode warning
    • Containers remote mode warning
    • SQLite Durable Objects warning
  • Tests: Added test case that verifies warnings only appear once even with multiple config updates

Key Review Points

  1. Verify logger.once.warn() method exists - This assumes the logger has a .once.warn() method that prevents duplicate messages
  2. Scope of changes - All 6 warning types were changed, though the issue specifically mentioned queues and SQLite DOs
  3. Test coverage - The test only covers one warning scenario but the fix touches all warning types

Link to Devin run: https://app.devin.ai/sessions/fe4aed656c5945a7adaa0078b1e9e9a8
Requested by: smacleod@cloudflare.com

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@changeset-bot
Copy link

changeset-bot bot commented Oct 8, 2025

🦋 Changeset detected

Latest 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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 8, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@10913

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@10913

miniflare

npm i https://pkg.pr.new/miniflare@10913

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@10913

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@10913

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@10913

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@10913

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@10913

wrangler

npm i https://pkg.pr.new/wrangler@10913

commit: 5a47225

@devin-ai-integration
Copy link
Contributor Author

The logger.clearHistory() call is necessary for test isolation when using logger.once.warn().

When logger.once.warn() is called, it tracks which messages have been logged in an internal Set (see onceHistory in logger.ts). Without clearing this history between tests, the second test in the containers describe block won't see the SQLite warning because it was already logged during the first test, causing the test to fail.

This ensures each test starts with a clean slate and can independently verify that warnings are shown.

@devin-ai-integration
Copy link
Contributor Author

Good point! I'll update the test to use Analytics Engine bindings with service worker format instead of remote dev mode.

devin-ai-integration bot added a commit that referenced this pull request Oct 13, 2025
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>
@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Oct 27, 2025
@emily-shen emily-shen marked this pull request as ready for review October 27, 2025 11:32
@emily-shen emily-shen requested a review from a team as a code owner October 27, 2025 11:32
@emily-shen emily-shen force-pushed the devin/1759882705-fix-logger-warn-configcontroller branch from e498685 to 6dcc94d Compare October 27, 2025 11:56
@github-actions
Copy link
Contributor

Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the v3-maintenance branch with your changes. Thank you for helping us keep Wrangler v3 supported!

Depending on your changes, running git rebase --onto v3-maintenance main devin/1759882705-fix-logger-warn-configcontroller might be a good starting point.

Notes:

  • your PR branch should be named v3-backport-10913
  • add the skip-v3-pr label to the current PR to stop this workflow from failing

devin-ai-integration bot and others added 3 commits October 27, 2025 12:02
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>
@emily-shen emily-shen force-pushed the devin/1759882705-fix-logger-warn-configcontroller branch from 6dcc94d to f6f4f78 Compare October 27, 2025 12:02
@emily-shen emily-shen added skip-pr-description-validation Skip validation of the required PR description format skip-v3-pr Skip validation of presence of a v3 backport PR labels Oct 27, 2025
@emily-shen emily-shen merged commit d4f2daf into main Oct 27, 2025
46 of 50 checks passed
@emily-shen emily-shen deleted the devin/1759882705-fix-logger-warn-configcontroller branch October 27, 2025 14:26
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Oct 27, 2025
@workers-devprod workers-devprod added the contribution [Holopin] Recognizes an open-source contribution, big or small label Oct 27, 2025
@holopin-bot
Copy link

holopin-bot bot commented Oct 27, 2025

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.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

emily-shen pushed a commit that referenced this pull request Oct 28, 2025
…#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution [Holopin] Recognizes an open-source contribution, big or small skip-pr-description-validation Skip validation of the required PR description format skip-v3-pr Skip validation of presence of a v3 backport PR

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

🐛 BUG: Duplicate printing of wrangler dev logs

3 participants