Skip to content

Conversation

devin-ai-integration[bot]
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: [email protected]

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]>
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

Copy link

changeset-bot bot commented Oct 8, 2025

🦋 Changeset detected

Latest 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

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: e498685

Copy link
Contributor

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 () => {
Copy link
Contributor

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

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.

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: [email protected] <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

🐛 BUG: Duplicate printing of wrangler dev logs

1 participant