Skip to content

Revert "feat: cache purge API (object cache + native Workers Caching)" - #2281

Merged
khoinguyenpham04 merged 1 commit into
mainfrom
revert-2275-feat/admin-cache-purge
Jul 30, 2026
Merged

Revert "feat: cache purge API (object cache + native Workers Caching)"#2281
khoinguyenpham04 merged 1 commit into
mainfrom
revert-2275-feat/admin-cache-purge

Conversation

@scottbuscemi

@scottbuscemi scottbuscemi commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Reverts #2275, which was merged before maintainer approval. This removes the unreleased cache-purge APIs and restores main to its previous behavior.

This is an exact revert of e88655417db5753a32d65d5bf5202af145d6ede0. The unrelated users:read change bundled into #2275 is also reverted and can be submitted separately with a reproducing test.

Reverts #2275.

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). Do not include messages.po changes except in translation PRs — a workflow extracts catalogs on merge to main.
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion: https://github.com/emdash-cms/emdash/discussions/...

Tests are not applicable because this removes an unreleased feature and its tests. There are no new user-visible strings. No replacement changeset is needed because #2275 was not released; its pending changeset is removed so unchanged published packages are not bumped. This is not a new feature, so no Discussion is required.

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool:

No new code was generated; the change is an exact Git-generated revert.

Screenshots / test output

The full CI suite passes on 70c9dd660031c3bfd005864bb69172bf3522a62a, including typecheck, lint, unit tests, browser tests, and Node and Cloudflare end-to-end tests. There are no visual changes to demonstrate.

@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 70c9dd6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-cache 70c9dd6 Jul 29 2026, 10:01 PM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-do 70c9dd6 Jul 29 2026, 10:02 PM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-playground 70c9dd6 Jul 29 2026, 10:02 PM

@github-actions

Copy link
Copy Markdown
Contributor

Scope check

This PR changes 1,452 lines across 37 files. Large PRs are harder to review and more likely to be closed without review.

If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs.

See CONTRIBUTING.md for contribution guidelines.

@pkg-pr-new

pkg-pr-new Bot commented Jul 29, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@2281

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@2281

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@2281

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@2281

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@2281

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@2281

emdash

npm i https://pkg.pr.new/emdash@2281

create-emdash

npm i https://pkg.pr.new/create-emdash@2281

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@2281

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@2281

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@2281

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@2281

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@2281

@emdash-cms/registry-verification

npm i https://pkg.pr.new/@emdash-cms/registry-verification@2281

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@2281

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@2281

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@2281

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@2281

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@2281

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@2281

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@2281

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@2281

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@2281

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@2281

commit: 70c9dd6

@github-actions github-actions Bot added the review/needs-review No maintainer or bot review yet label Jul 29, 2026

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverting #2275 is the right call if the feature needs to be backed out, and the diff looks like a thorough attempt to roll it back. I checked for leftover references to the cache-purge capability, routes, handlers, virtual module, and Block Kit disabled/title fields and found none, so the public surface appears cleanly scrubbed.

Two things stand out:

  1. No replacement changeset. The original .changeset/object-cache-purge-api.md is correctly deleted, but this PR still removes public API from published packages (emdash, @emdash-cms/admin, @emdash-cms/blocks, @emdash-cms/cloudflare, @emdash-cms/plugin-types, @emdash-cms/plugin-cli, @emdash-cms/sandbox-workerd). CONTRIBUTING requires a changeset for behavior changes to published packages, even when the behavior is "reverts the previous addition".
  2. workerd wrapper loses canonical users:read gating. The revert removes the || manifest.capabilities.includes("users:read") disjunction that #2275 had added to packages/workerd/src/sandbox/wrapper.ts. Only the deprecated read:users alias still gates ctx.users in workerd; a plugin that declares the canonical users:read capability won't get user access. The Cloudflare wrapper already normalizes capabilities and checks the canonical name, so workerd should match it.

I did not run the test suite or typecheck; everything above is from static reading and cross-searching.

const site = options.site ?? { name: "", url: "", locale: "en" };
const hasReadUsers =
manifest.capabilities.includes("read:users") || manifest.capabilities.includes("users:read");
const hasReadUsers = manifest.capabilities.includes("read:users");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] The workerd wrapper gates ctx.users on the deprecated read:users capability alias only. The canonical capability is users:read (see CAPABILITY_RENAMES and normalizeCapabilities), so sandboxed plugins that declare the current name will silently lose user access in workerd. Note that the prior branch had || manifest.capabilities.includes("users:read") here; restoring that disjunction at least preserves base-branch behavior while the broader workerd capability-alias inconsistency is addressed.

Suggested change
const hasReadUsers = manifest.capabilities.includes("read:users");
const hasReadUsers = manifest.capabilities.includes("read:users") || manifest.capabilities.includes("users:read");

A cleaner fix is to import normalizeCapabilities and normalize manifest.capabilities before generating the wrapper, matching the Cloudflare wrapper.

@@ -1,10 +0,0 @@
---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[needs fixing] Removing the original changeset is correct, but this leaves no changeset describing the revert. The revert still changes the public API/surface of several published packages, so CONTRIBUTING requires a new changeset that explains the removal to users upgrading (e.g., a .changeset/revert-cache-purge-api.md noting that the admin cache-purge endpoints, plugin cache:purge capability, and related Block Kit button options have been removed).

@github-actions github-actions Bot added review/awaiting-author Reviewed; waiting on the author to respond overlap and removed review/needs-review No maintainer or bot review yet labels Jul 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Overlapping PRs

This PR modifies files that are also changed by other open PRs:

This may cause merge conflicts or duplicated work. A maintainer will coordinate.

@khoinguyenpham04 khoinguyenpham04 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified as an exact revert of #2275. Full CI and PR compliance pass. No replacement changeset is needed because the reverted API was never released; the unrelated users:read change should be handled in a separate tested PR.

@github-actions github-actions Bot added review/approved Approved; no new commits since and removed review/awaiting-author Reviewed; waiting on the author to respond labels Jul 30, 2026
@khoinguyenpham04
khoinguyenpham04 merged commit 5f0ef18 into main Jul 30, 2026
58 of 60 checks passed
@khoinguyenpham04
khoinguyenpham04 deleted the revert-2275-feat/admin-cache-purge branch July 30, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants