Skip to content

Conversation

@ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Nov 11, 2025

Currently the proxy catches expired preview tokens by detecting the error message, and dispatching an event. However currently the event handler is not implemented. This PR implements token refresh by storing the latest bundle and config and then using them to re-run this.#previewToken. I've extracted the call so it can be used in both onBundleComplete and in the new refresh handler. After refreshing, we dispatch reloadComplete with the new credentials.

Fixes [CUSTESC-56000]


  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bug fix
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: bug doesn't exist in v3

@changeset-bot
Copy link

changeset-bot bot commented Nov 11, 2025

🦋 Changeset detected

Latest commit: 02685bf

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 Nov 11, 2025

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@11236

wrangler

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

commit: 02685bf

@ascorbic ascorbic marked this pull request as ready for review November 11, 2025 14:29
@ascorbic ascorbic requested a review from a team as a code owner November 11, 2025 14:29
@ascorbic ascorbic marked this pull request as draft November 11, 2025 14:45
@ascorbic
Copy link
Contributor Author

This is still failing, so taking back to draft

@ascorbic ascorbic marked this pull request as ready for review November 12, 2025 09:40
@ascorbic ascorbic requested a review from penalosa November 12, 2025 09:41
@ascorbic
Copy link
Contributor Author

I have tested locally with a synthetic copy of the error page. Currently waiting an hour for the real timeout to test that.

@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 mk/wrangler/refresh-token might be a good starting point.

Notes:

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

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Nov 17, 2025
@petebacondarwin petebacondarwin merged commit 793e2b4 into main Nov 17, 2025
35 of 36 checks passed
@petebacondarwin petebacondarwin deleted the mk/wrangler/refresh-token branch November 17, 2025 12:37
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Nov 17, 2025
@cloudflare cloudflare deleted a comment from Hafiz613 Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants