Repository navigation
emdash@1.7.0
Minor Changes
-
#4686
91dfa31Thanks @ascorbic! - Adds editorial comments: threads that staff leave on an entry while reviewing it, separate from the public comments visitors post.A thread points at the whole entry, a field, a Portable Text block, or a range of text in a block, and holds a conversation that can be resolved and reopened. Threads are private to staff and never appear on the site.
In the entry editor, select text in any Portable Text field and choose Comment in the formatting toolbar, or press ⌘⌥M (Ctrl+Alt+M), to start a thread beside it. To comment on an image, embed, divider or other non-text block, choose Comment in its block menu (or, without edit access, select the block and choose Comment in the toolbar above it), and to comment on a whole field, use the comment button at the end of the field's label row. The comment button in the editor bar, just before the settings panel toggle, shows or hides the margin and shows how many threads are open. Commenting needs no edit access: Contributors who can't edit an entry, and anyone viewing an entry while someone else holds its edit lock, can still select text and comment. Commented text stays highlighted as you edit, and a thread whose text was deleted is listed as detached with the text it referred to. Links of the form
?thread=<id>open the editor with that thread selected and its text in view, and Go to text on an open thread selects the text it refers to.The API lives under each entry, at
/_emdash/api/content/{collection}/{id}/threads, with routes to list and start threads, reply, edit and delete comments, resolve and reopen threads, and store anchors after the entry's content changes. Each thread and comment in a response carriescanflags that say what the caller may do with it.Mentions and email
Type
@in a comment to mention someone who can take part in threads. A comment body stores each mention as<@USER_ID>, and every thread in a response lists the users it mentions undermentions, with their current names, so a renamed user shows the new name.GET …/threads/mentionable?q=returns up to 10 people to mention, matched by display name, without email addresses. A new comment, or an edit that adds a mention, fails withVALIDATION_ERRORwhen it mentions a user who doesn't exist or can't take part. Mentions already in a comment don't stop it being edited.When the site has an email provider, a new comment emails the people it mentions, the thread's creator and the authors of its earlier comments that weren't deleted, except its own author, anyone who can no longer take part, and users whose email address isn't verified. Editing a comment to mention someone new emails only that person. The email has the entry's title, an excerpt of the comment and a link to the thread. Without an email provider, nothing is sent, and the comment is still saved. See Comment on an entry for mentions and comment emails.
MCP tools
AI agents can review entries through five MCP tools:
editorial_thread_list,editorial_mentionable_list,editorial_thread_create,editorial_comment_createandeditorial_thread_resolve. A token needs thecontent:readscope foreditorial_thread_listandeditorial_mentionable_list, and thecontent:writescope for the other three.editorial_mentionable_listfinds the user IDs that comment bodies mention as<@USER_ID>. The user behind the token needs theeditorial:commentandcontent:read_draftspermissions for every tool.editorial_thread_createstarts a thread on the whole entry, or on one field when you passfield. To comment on specific text, passfieldand the exactquote, with optionalprefixandsuffixto tell repeated text apart. The tool finds the quote in the entry's current draft. Passingprefixorsuffixwithoutquotefails withVALIDATION_ERROR.Visual editing
Editors can review threads on the site itself. In edit mode, each element bound with
{...entry.edit}or{...entry.edit.field}shows a badge with the number of its open threads; threads on text and blocks in a field count toward that field's badge, and threads on a field the page doesn't show count toward the entry's badge. Hover over or tab to a bound element to show its comment button, which opens a popover where you can reply, resolve a thread you're allowed to resolve, follow Open in admin, and start a new thread on the entry or field.A Portable Text field rendered with
<PortableText>in edit mode gets a badge of its own even when no element around it is bound with{...entry.edit.field}. Its text and block threads are highlighted in the page editor, and clicking a highlight opens a popover next to it with just the threads on that text while the cursor stays in the text, and the field's badge still lists all of them; press ⌘⌥M (Ctrl+Alt+M) in a highlight to move to its reply box instead. To start a thread on text, select it and choose Comment in the formatting toolbar, or press ⌘⌥M (Ctrl+Alt+M). When you edit text that a thread points at, the thread moves with it on the next save. The page editor now keeps each block's_keywhen it saves, instead of giving every block a new one, so links to a block from comments and other content survive edits made on the page.The toolbar loads threads with one request per entry on the page, at most four at a time, and only for signed-in users in edit mode who can take part in threads. The popover's code loads the first time someone opens it, from the editor-only
/_emdash/visual-editing/commentspage, which the site's Astro build bundles with@astrojs/react, as it does the inline editor. Pages for logged-out visitors don't change.Permissions
Two permissions are new in
@emdash-cms/auth. Every editorial route also needscontent:read_drafts.editorial:comment(Contributor and above): read threads, start them, and reply.editorial:manage(Editor and above): resolve, reopen and delete any thread, and delete anyone's comment.
A thread's creator may also resolve and reopen it, and so may the entry's author when they hold
content:edit_own. A creator may delete their own thread until someone else replies, and only a comment's author may edit it. Storing recomputed anchors needs edit access to the entry and its current_rev.New playground sessions open with example threads on the "Building for the Long Term" post, from a demo reviewer, so visitors can reply, resolve and add their own.
Upgrading
A migration adds two tables,
_emdash_editorial_threadsand_emdash_editorial_comments. Threads stay while an entry is in the trash, where their comments and threads can still be deleted but not added, edited, resolved or moved, and are deleted with the entry or its collection. Site transfer leaves them out.
Patch Changes
-
#5104
7ed8e09Thanks @ascorbic! - Fixes Cloudflare Access sign-in for people whose Access email contains capital letters. New accounts are now stored with a lowercase email, so these sign-ins no longer fail with "Failed to provision user", and simultaneous first sign-ins no longer create a second account for the same person. -
#5106
db3aa05Thanks @ascorbic! - Fixes work deferred withafter()possibly being dropped on Vercel and Netlify once the response is sent.after()now hands the task to the host'swaitUntil: Netlify's request context, Vercel's request context, orlocals.waitUntilwhen the site's own middleware sets one. Cloudflare keeps using its ownwaitUntil, and@astrojs/nodestill runs deferred work in the long-lived process. -
#5106
db3aa05Thanks @ascorbic! - Updates production responses from/_emdash/apiroutes to omit theServer-Timingheader, so query counts and durations no longer vary between API requests that otherwise get the same answer. Pages and the admin still send the header, andastro devstill sends it on API responses. -
#5116
723784eThanks @ascorbic! - Fixes Atmosphere sign-in leaving records in the database that were never removed. An OAuth state now stops working 10 minutes after the sign-in starts, as intended, and scheduled cleanup deletes the states of sign-ins that were started and never finished. Before, every abandoned attempt left a row in_plugin_storagethat stayed there.Atmosphere sign-in also no longer stores the access and refresh tokens it receives from an account's provider. They were written for every completed callback, including accounts the site then refused, and never used again. Scheduled cleanup deletes the token sets stored by earlier versions.
The cleanup of existing rows needs
emdashupgraded, and the 10-minute state expiry and the end of token storage need@emdash-cms/auth-atprotoupgraded.Also fixes
/.well-known/atproto-client-metadata.jsonusing the host of the incoming request forclient_idandredirect_uris. It now usessiteUrl(orEMDASH_SITE_URL), the same origin the login route sends to the account's provider, so sign-in no longer fails behind reverse proxies that forward a differentHost. -
#5106
db3aa05Thanks @ascorbic! - UpdatesPOST /_emdash/api/auth/magic-link/sendandPOST /_emdash/api/auth/signup/requestto respond before looking up the account and sending the email, so the response time is the same for every address and no longer depends on the email provider's speed. This applies on Cloudflare,@astrojs/node, Vercel and Netlify, and on sites whose own middleware setslocals.waitUntil. On other hosts the email is still sent before responding, as before. Delivery errors are still logged on the server. -
822ac68Thanks @ascorbic! - On sites with an Astrobase, admin and API requests under the base path, such as/blog/_emdash/api/..., now get the same authentication and request checks as the unprefixed paths. This includes the external auth provider, theX-EmDash-Requestheader, the admin Content-Security-Policy, the setup redirect and the write checks that run during a site transfer. Redirect rules, 404 logging and the visual editing toolbar no longer apply to these paths. This also covers a base with spaces or non-ASCII characters, such as/my blogor/über, whose requests arrive percent-encoded.API tokens sent to paths under the base were previously ignored. They are now accepted and scope-checked as on the unprefixed paths.
In
@emdash-cms/cloudflare, preview mode and playground mode now apply their route restrictions to paths under the base, and Hyperdrive no longer serves_emdashreads under the base from the cached binding. -
#5106
db3aa05Thanks @ascorbic! - Fixes the D1 and Durable Object read-replica bookmark cookies (__em_d1_bookmark,__em_do_bookmark) being set on requests that carry anAuthorization: Bearerheader the site never verified. The cookie is now set only for a signed-in session or a token the site has accepted, so a valid token sent to a public page no longer receives one. Requests with a Bearer header are still routed to the primary database. -
#5145
5c9b00dThanks @emdash-autofix! - Fixes admin content list and list API searches failing on Cloudflare D1 with long or multibyte search terms, whether collection search is enabled or disabled. -
#5077
4dd5dbaThanks @emdash-autofix! - Fixes plugin routes on Cloudflare staying broken with the error "This promise was created by a request that has since ended, so it can never settle" after cancellation during storage index checks or creation. Later requests can recover, and requests that wait too long for synchronization receive a503 STORAGE_INDEXES_NOT_READYresponse instead of hanging.If cancellation interrupts an index removal whose outcome remains unknown, state-changing plugin routes stay blocked with 503. If its response never settles, this block lasts for the runtime's lifetime and a restart is required to clear it. Automatic recovery from an abandoned destructive schema operation is not included.
-
69a77adThanks @ascorbic! - Updates how EmDash decides that it is running in development. The development-only endpoints (auth/dev-bypass,setup/dev-bypass,setup/dev-reset,dev/emails,dev/scheduled-tasks, andtypegen), the passkey sign-in fallback for external auth, the console email provider, the relaxed adminContent-Security-Policy,Server-Timingon/_emdash/apiresponses, and OAuth credentials read from build-time environment variables now apply only under theastro devcommand. Before, a site built withastro buildandNODE_ENVset to anything other thanproductionalso got them. -
#5015
8092274Thanks @Yusaku01! - Fixesemdash content get --publishedreturning draft values when an entry has a pending draft. It now returns the published values.EmDashClient.get()also accepts apublished: trueoption. -
#5088
7b97204Thanks @ascorbic! -emdash loginandemdash-plugin loginnow open the sign-in page in your browser only when its address is anhttp:orhttps:URL. Any other address is still printed, so you can open it yourself. On Windows,emdash-plugin loginnow passes the full authorization URL to the browser, including the part after the first&. -
#5172
ba1eb52Thanks @ricardosantisinc! - Fixesemdash logingiving up with "Token exchange failed: [object Object]" while it waits for approval. When the token endpoint's rate limit answers with 429, for example because a second login is polling from the same IP address, the command now waits forRetry-Afterand keeps polling. Other API errors are reported with their message. -
#5042
5030c20Thanks @ascorbic! - Fixes Cloudflare dev servers reloading the worker several times on the first page an editor visits, which could make that request take ten seconds or more. The inline editor's dependencies are now optimized when the dev server starts, whether or not co-editing is enabled. -
#5152
17401f3Thanks @emdash-autofix! - Fixes scheduled Workers Cache purges by adding the namedEmDashWorkerentrypoint for sites that re-export it as their default Worker export.To enable the fix on an existing site, replace the object-style default export in
src/worker.tswith this re-export:export { EmDashWorker as default, EmDashRoom, EmDashRoomSite, PluginBridge, } from "@emdash-cms/cloudflare/worker";
Sites with custom fetch or scheduled handling should extend
EmDashWorker; see the Cloudflare deployment documentation for thehandleRoomUpgradeandcreateScheduledHandler()delegation points. Custom scheduled handlers must passinvalidateViaDefaultEntrypoint: trueto opt into RPC invalidation. The legacy object default export and directcreateScheduledHandler()usage remain compatible, but scheduled Workers Cache purges requireEmDashWorkeras the site's default.emdash doctorrecognizes the subclass form and adds a migration hint for legacy object-style entrypoints while continuing to accept their scheduler wiring. Cache invalidation from co-editing rooms and the plugin bridge is unchanged. -
#5119
7e693aaThanks @ascorbic! - Updatescomment:beforeCreateso that only theauthorName,authorEmail,body, andmetadataa handler returns are used. Changes a handler makes tocollection,contentId,parentId,authorUserId,ipHash, oruserAgentare now ignored, and the comment keeps the values from the submission. A plugin that rewrote those fields from this hook no longer can. -
#5096
a853fe3Thanks @ascorbic! - Limits the length of two values stored from public requests:- The public comment endpoint now rejects an author email address longer than 254 characters with a
400validation error, as it already does for over-long names and comment bodies. The<CommentForm>email input has a matchingmaxlength. Comments stored before upgrading are not changed. - The 404 log no longer records requests whose path is longer than 2,048 characters. Visitors still get the same 404 response.
- The public comment endpoint now rejects an author email address longer than 254 characters with a
-
#5090
a0fe5c9Thanks @ascorbic! - Fixes the public comment endpoints returning comments for entries that are drafts, unpublished, or in the trash.GET /_emdash/api/comments/:collection/:contentIdnow answers404 Content not foundfor such an entry, as submitting a comment to it already did. The reactions endpoint on the same path returns no counts for such an entry and no longer accepts reactions on its comments. -
00367c1Thanks @ascorbic! - ChangesGET /_emdash/api/content/{collection}/authorsso it includes each author'semailonly for callers who holdusers:read(admins), and for API tokens only when they also carry theadminscope. Contributors, authors, editors and narrower tokens receiveid,nameandavatarUrl. The content list's author filter labels an author with no name "Unnamed user".If you call the exported
handleContentAuthorsdirectly, it now omitsemailunless you pass{ includeEmail: true }. -
#5115
a895695Thanks @ascorbic! - Applies link scheme checks to more of the places content stores a URL.- The
src,url, andpreviewUrlofimageandfilevalues, including adarkVariantand image sub-fields of repeaters, now accept onlyhttp:andhttps:URLs and paths without a scheme. The content API, MCP tools, seeds, and plugin content writes reject other schemes, such asjavascript:,data:, andblob:, with a validation error. Seeds and plugin content writes check these values outsideblocksfields, and also reject a URL that is not text. - Seeds, plugin content updates, and site imports reject a
urlfield value that is not text, or text that starts with[or{. Queries return stored text that looks like JSON as an array or object, so such a value did not read back as the text that was checked. - Site import analysis reports a
dangling_referenceblocker for a block in an entry or revision whose block type or version is not in the package. Previously the URL fields of such a block were not checked. getEmDashEntry()andgetEmDashCollection()drop a__proto__key in stored content instead of turning it into the prototype of the returned object, so a repeater row no longer exposes values that were stored under that key as its own fields. Search indexing ignores the key as well.
Existing entries are not changed. A stored value that the new checks reject is still returned by queries, but saving or duplicating that entry fails until the field is corrected. To render older values safely, pass the URL through
sanitizeHref()before putting it in anhref. - The
-
#5098
e574caeThanks @ascorbic! - Fixes the single-entry content API answering differently for missing and existing entries when the caller's role can never perform the action. Updating, deleting, locking, publishing, unpublishing, scheduling, restoring or discarding the draft of an entry, restoring a revision, saving a recovery revision, joining an entry's co-editing room, and calling a plugin's editor panel or action now answer403to such a caller whether or not the entry exists. Previously a missing entry answered404and an existing one403. Roles that can perform the action still get404for a missing entry. -
#5013
c94f442Thanks @swissky! - FixesdecodeSlug()so a slug containing a NUL byte (for example/posts/%00) returnsundefined. On PostgreSQL, routes that decode their slug with it now show their 404 for such URLs instead of failing the content query with a 500. -
#5091
16cb80fThanks @ascorbic! - Fixes feeds, JSON endpoints and other responses that are not full HTML pages keeping their route'sCache-Controlheader when rendered for an editor with the toolbar's edit mode on. These responses include unpublished revisions, so a CDN or caching reverse proxy in front of the site could store one and serve it to visitors. Every edit-mode response is now sent withCache-Control: private, no-store, as pages showing the toolbar already were. This also applies to pages on sites that settoolbar: false. Stored media served through the image endpoint stays cacheable. -
#5212
060e7e7Thanks @khoinguyenpham04! - Updates the editorial comments UI so the page editor and the admin match. Each comment shows the person's photo or generated avatar with their name and time on one line, long threads collapse their middle replies, and the reply box keeps its send button in place. Opened from highlighted text, the page editor's comments popover no longer repeats the field name or the quoted text, and it fits short screens and long names. -
#4828
35d40a3Thanks @danielmlr! - Fixesemdash typestyping blocks fields asunknown[]. The generated.emdash/types.tsnow types each blocks field as the union of its block types, with every retained version, matching theemdash-env.d.tsthe dev server writes. The site thatemdash typesconnects to generates the types, so a site you reach with--urlneeds this release before the output changes. -
#5104
7ed8e09Thanks @ascorbic! - Fixes setup getting stuck when the first admin is created through GitHub, Google, Microsoft, or AT Protocol sign-in but linking the sign-in account fails partway through. Signing in again with the same account now finishes setup; any other account is still refused.canSelfSignup'screateUserfunction in@emdash-cms/authnow also receives the account being linked, ascreateUser(user, account), and may return an existing user forfindOrCreateOAuthUser()to link that account to. -
#4306
0917f1bThanks @iNerdStack! - Fixes the WordPress plugin import review screen so it lists the source site's navigation menus, letting you see which menus will be imported before running the import. Reports skipped menus when a same-named menu already exists, so the import result shows how many were created vs. skipped instead of silently dropping them. -
#5143
628ea8dThanks @Yusaku01! - Fixes the visual editing toolbar and Cloudflare preview toolbar overflowing on narrow screens. Both toolbars now wrap to fit the viewport, keeping the visual editing toolbar's Publish button, close buttons, and long status or error messages visible on mobile and in languages with longer labels. -
#5118
3c64f9bThanks @ascorbic! - Fixes isolated HTML blocks seeing the full address of the page they are on, including its query string and fragment, when the block's JavaScript removes the frame's<base>element.document.baseURIin an isolated block is now always the site's root address, in the admin preview as well as on the site.The block's document now sits in a second sandboxed frame inside the block's frame. Blocks render, resize and open links as before. A few details change:
- Block JavaScript:
parentis now the outer frame, so it is no longer the same astop, anddocument.referreris empty. Send messages to the page withparent.postMessage(), nottop.postMessage(): the outer frame passes them on, and the site only accepts messages from it. Messages from the page arrive with the outer frame asevent.sourceand anoriginof"null". - Sites with a content security policy: if the policy blocks the block's styles, the block's content stays 150 pixels tall even if your site's styles make the frame taller. If the policy sets
base-uri 'none', isolated blocks don't load; allow'self'inbase-urito show them. - Browser tests: a test that looks inside an isolated block needs one more frame step, such as
page.frameLocator("iframe[data-emdash-html-block]").frameLocator("iframe"). buildHtmlBlockFrame()from@emdash-cms/admin/html-blockaccepts an optionaltitlefor the inner frame.
- Block JavaScript:
-
#5053
405dbefThanks @danielmlr! - Fixes WordPress imports dropping the alt text and caption of every media item. Media imported from a WXR file or through the EmDash Exporter now keeps the alt text and caption set in the WordPress media library. Media imported before this release keeps its empty alt text and caption, even if you rerun the media step, because the import reuses files it has already stored; add them in the media library.parseWxr()andparseWxrString()return each attachment's caption ascaption, andparseWxrString()now fills each attachment'smeta, asparseWxr()already did. -
#5056
5684ca8Thanks @danielmlr! - Fixes WordPress imports placing every category and hierarchical term at the top level. Categories and terms imported from a WXR file or through the EmDash Exporter now keep their WordPress parent when the EmDash taxonomy is hierarchical. Terms that already exist in EmDash keep their current parent, so importing again does not rearrange the categories of an earlier import. To nest those, edit each term in the admin and choose its parent. -
#5153
4874debThanks @ascorbic! - The visual editor now reads and saves rich text with the admin editor's schema and converter, so a Portable Text field saves the same way from either editor. When you edit on the page, spans and link definitions keep their_keys (as blocks already did). Tables, galleries, embeds, videos and plugin blocks still show as placeholders to edit in the admin, and they save the way the admin editor saves them. If a field contains a table the admin editor can't open, the visual editor says so instead of loading the field.Both editors now keep the
_key, dimensions, display size, alignment, link and blur placeholder (blurhashanddominantColor) of an image block stored with only aurland noasset, such as imported content. Before, the admin editor dropped them on save. -
#5114
9369192Thanks @ascorbic! - Fixes the Image, Gallery, Cover and Columns Portable Text blocks and theImagecomponent so they render stored color and size values only when each is a single valid CSS value.dominantColorandoverlayColormust be a color, a keyword or avar()reference.minHeightand a column'swidthmust be a length, a percentage, a keyword such asauto, acalc(),min(),max()orclamp()of numbers and units, or avar()reference. Avar()fallback must itself be one of these values.overlayOpacitycan be a number, a numeric string or a percentage, and a gallery'scolumnsmust be a positive integer. Any other value is ignored and the block uses its default: a 300px minimum height, a black overlay at the block's opacity, an automatic column width, or three gallery columns. When an image block's owndominantColoris ignored, the color stored with the media is used. -
#5090
a0fe5c9Thanks @ascorbic! - Fixes comment reactions and per-client rate limits treating each address in an IPv6 /64 network as a separate visitor. IPv6 clients are now counted by their /64 network for comment reactions and for the comment, sign-in, signup, and OAuth rate limits; IPv4 clients are still counted by address. Reactions already stored by IPv6 visitors keep counting, but each of those visitors can react to the same comment once more. For IPv6 commenters, the commentipHashpassed to comment hooks and returned by the admin comments API now identifies the /64 network, and differs from hashes stored before the upgrade, so plugins that match comments onipHashshould expect older and newer hashes of the same visitor not to match. -
#5094
0c9dd87Thanks @ascorbic! - Fixes several behaviours of the legacymarketplaceoption. Sites that do not setmarketplaceare unaffected.- Plugin and theme search and detail lookups, update checks, installs, and updates follow redirects only while they stay on the marketplace origin. A redirect to another host is refused: installs and updates fail with
MARKETPLACE_REDIRECT_UNTRUSTED, search and detail lookups fail with their usual error, and update checks skip the affected plugin. The install statistics request follows no redirects. - The plugin icon and theme thumbnail proxies relay only PNG, JPEG, and WebP images, served as downloads. Other responses, including the marketplace's generated SVG fallback avatars, return
502 PROXY_ERROR; an upstream 404 returns404 NOT_FOUND. Rejected upstream response bodies are no longer passed through. - Installing a marketplace plugin fails with
PLUGIN_ID_CONFLICTwhen the ID is already used by asandboxed: []plugin or by a plugin installed from another source. - Plugin bundles whose file names repeat, including
package/backend.jsnext tobackend.js, are refused withINVALID_BUNDLE.
- Plugin and theme search and detail lookups, update checks, installs, and updates follow redirects only while they stay on the marketplace origin. A redirect to another host is refused: installs and updates fail with
-
#5099
736af38Thanks @ascorbic! - FixesPUT /_emdash/api/media/{id}/replacestoring a file for a media item that was deleted while the replacement was still uploading. The route now checks the item again once the upload has arrived and responds with404if it is gone. If the item is deleted while the new file is being written, the route removes that file. -
#5099
736af38Thanks @ascorbic! - Fixes S3 signed media uploads so a confirmed file can no longer change afterwards. The upload URL fromPOST /_emdash/api/media/upload-urlstays valid for an hour, and confirming the upload kept the file at the key that URL writes, so a later upload to the same URL replaced the confirmed file. Confirming a signed upload, throughPOST /_emdash/api/media/{id}/confirmor the MCPmedia_createtool, now copies the file to a new storage key and makes the item ready under that key.The confirmed item's
storageKeyandurltherefore differ from thestorageKeyin the upload URL response, as they already did for uploads sent through EmDash. Clients should use the values from the confirm response. Storage adapters can implement the new optionalcopy()method to copy files inside the storage service, as the S3 adapter does; adapters without it download and re-upload the file. -
0f67ed9Thanks @ascorbic! - On sites that use an external auth provider such as Cloudflare Access, the OAuth consent page (/_emdash/oauth/authorize) now checks the provider on every request, as the admin and API routes do, including on sites with a non-root Astrobase. WithsyncRoles: true, role changes from the provider apply before the page grants scopes. A request without a valid provider identity now gets a401instead of being identified by the EmDash session alone. -
#5100
1705671Thanks @ascorbic! - Fixes GitHub, Google, and Microsoft sign-in so the callback only signs in the browser that started the sign-in. Opening a callback link that was started in another browser now returns to the login page withinvalid_stateand leaves the current session unchanged.Starting a sign-in now sets a short-lived
HttpOnlycookie namedemdash_oauth_state_followed by part of the sign-in's state, which the callback checks. Sign-ins started in several tabs of one browser can each finish. A sign-in that is in progress during the upgrade has to be started again. If you set a site URL, start sign-in from that host name: a sign-in started on another host name, such aswww.instead of the bare domain, fails withinvalid_state. -
#4701
1981c17Thanks @swissky! - Fixes media served through EmDash's media route (R2 or local storage without a public bucket URL) being served as full-size originals in production whensiteUrlisn't set inastro.config.mjsand neitherEMDASH_SITE_URLnorSITE_URLis set at build time, as in the Cloudflare templates. On pages rendered on demand, theImageandGallerycomponents fromemdash/uinow get resized WebP renditions and a responsivesrcsetwithout extra configuration, through the Cloudflare Images binding with the Cloudflare adapter's default image service, or through sharp on Node. Prerendered pages still needsiteUrl,EMDASH_SITE_URLorSITE_URLwhenastro buildruns. These images are served as the original file instead of failing when the Cloudflare Images binding returns an error, for example after the plan's monthly transformations run out, or on Node withoutsharpinstalled. -
ef0e581Thanks @ascorbic! - Updates the OAuth consent page at/_emdash/oauth/authorizeand the device authorization page in the admin. The Approve and Authorize buttons now respond only after the page has been visible and in focus for one second; a bar fills the button while it waits, and Deny works at once. On the consent page, the delay comes from a script served by the site at/_emdash/oauth/authorize-guard, and the page'sContent-Security-Policyallows only same-origin scripts. If that script cannot run, Approve stays disabled and the page says the script is needed. A consent form opened before a different user signs in on the same browser is rejected; reload the page to get a fresh one. The consent page can no longer be displayed inside a frame, and its form is accepted only when the browser submits it from the consent page on the same site. A script that posts the consent form directly must send the site'sOriginheader. A site behind a proxy that terminates HTTPS must setsiteUrl(orEMDASH_SITE_URL) to its public address, or the form is rejected as cross-origin. -
#5101
246eacfThanks @ascorbic! - Fixesctx.content.restore()in plugins so restoring an entry that is not in the trash fails withNOT_FOUND, the same error a missing entry gets, instead ofCONFLICT. Restoring trashed entries is unchanged. -
#5102
3f9d7fdThanks @ascorbic! - Fixes updating a disabled marketplace or registry plugin so it stays disabled. The update installs the new version, and the plugin's hooks and routes stay off until an admin enables it again. -
#4648
285c949Thanks @dmythro! - Fixes WordPress imports from sites translated with Polylang. Posts in a WordPress export of All content are linked to their translations, and translated categories, tags, and other terms arrive in their own language, under their own names, linked to their translations. Previously each post arrived unlinked, and every term was created in the default locale and copied into the others under its slug, so posts outside the default locale showed slugs such aspastinstead of category names, and each locale listed the terms of every other. An export of Posts leaves out the translations of categories and tags, so its posts still arrive unlinked. Polylang's internal taxonomies are no longer reported as missing.Imported terms join their translations that already exist on the site. When a term's existing translations sit in different translation groups, the import stops with a conflict that names them, because existing terms can't be linked. This happens when you import a Polylang site again after importing it with an earlier version: delete the entries, terms, and menus the earlier import created, empty those entries from the trash, then import again.
-
#5092
5e24aa2Thanks @ascorbic! - Fixes several gaps in preview links and the published-only snapshot:POST /_emdash/api/content/{collection}/{id}/preview-urlnow requires an API or OAuth token to holdcontent:readas well ascontent:write. A token withoutcontent:readgets403 INSUFFICIENT_SCOPE. Signed-in admin sessions are unaffected.- The same endpoint now accepts an
expiresInof at most seven days and responds with400 VALIDATION_ERRORfor a longer, zero, negative, or unrecognized value instead of signing it. The admin uses the one-hour default and is unaffected; API clients that request longer links must ask for"7d"or less. - Links from that endpoint are now always signed for the entry's database ID, so a link requested by slug no longer opens a different entry that later takes the same slug.
- The published-only snapshot (
GET /_emdash/api/snapshotwith a preview signature, or without?drafts=true) no longer includes SEO metadata or the social image of an unpublished entry whose translation is published, and exportsdraft_revision_idandscheduled_atasNULLon content rows. Snapshots with?drafts=trueand backups are unchanged.
Preview links issued before upgrading stay valid until they expire. To end them sooner, rotate the preview secret, then restart or redeploy every serving instance so none keeps using the old secret. When
EMDASH_PREVIEW_SECRETis set, change it; deleting theemdash:preview_secretoption has an effect only when no environment override is set. See Preview secret for the rotation steps. -
#5069
31bc35bThanks @emdash-autofix! - Fixes image fields losing alt text and other media metadata when saving legacy values that contain a URL insrcwithout an ID or provider, including images inside repeaters. -
#5158
a397efcThanks @khoinguyenpham04! - Fixes links into the public site on sites that set Astro'sbase(for example/blog). These links now include the base instead of 404ing:- Preview links from the admin and the preview URL API, when they come from the collection's URL pattern or the default
/{collection}/{id}path. ApathPatternin the request orEMDASH_PREVIEW_PATH_PATTERNis still used exactly as given. - Menu items that point to content, taxonomy terms, and collection archives. Custom menu URLs are unchanged.
- The admin's View Site, Live View, View published, and calendar View live links.
- Links you insert with the editor's link picker from now on. Links already saved in your content keep their old paths.
- URLs returned by the plugin content API's
getPublicUrl(), for trusted and sandboxed plugins.
If you worked around this, remove the workaround after upgrading, or the base will appear twice:
- A base written into a collection's URL pattern.
- A template that puts the base in front of
item.urlfromgetMenu(). - A plugin that adds the base to what
getPublicUrl()returns.
- Preview links from the admin and the preview URL API, when they come from the collection's URL pattern or the default
-
#5122
e2bbd0dThanks @ascorbic! - Fixes redirects from public raw plugin routes on sites behind a TLS-terminating proxy. The host now checks a plugin'sLocationagainst the site's public origin fromsiteUrlorEMDASH_SITE_URL, not the internal request URL, and treats a value with a scheme, such ashttp:other.example/path, as an absolute URL. As a result, an absolute redirect to the site's publichttps://address is accepted, and one to another host or to the same host overhttp://is refused. WhensiteUrlorEMDASH_SITE_URLis set, absolute redirects must use that origin, so use a relative path such as/thanksto stay on whichever host served the request. Relative redirects are unaffected. -
#5120
af2abf7Thanks @ascorbic! - FixesPUT /_emdash/api/content/{collection}/{id}withstatus: "draft"so it unpublishes a published or scheduled entry the same wayPOST .../unpublishand thecontent_updateMCP tool do. The request now needscontent:publish_ownorcontent:publish_any, acontent:beforeUnpublishhook can reject it,content:afterUnpublishhooks run, and the live revision and any pending schedule are cleared. Other fields in the same request are saved first. If the unpublish then fails, the error says the fields were saved, and itsdetails._revis the_revof that save. A draft that still has a live revision or pending schedule from an earlier version is unpublished the same way. On any other draft,statusis ignored. -
46f8a08Thanks @ascorbic! - Updates how/_imagehandles requests on Node.js:- Images that are not EmDash media go to the image endpoint your adapter configured, so
@astrojs/nodereads bundled images from the build output. - Images from other sites are fetched by EmDash itself, without the visitor's request headers, and only from hosts allowed by
image.domainsorimage.remotePatterns. Every redirect must lead to an allowed host too, and never to an EmDash media route. A fetch that takes longer than 10 seconds answers504. - With an adapter that does not read images from disk, a bundled image is fetched from your configured
siteUrl(orEMDASH_SITE_URL). Without one,/_imageanswers404for it, so setsiteUrlif you use such an adapter. - An SVG opened directly at its
/_imageURL downloads instead of displaying; SVGs in<img>tags still render. A cached SVG is only confirmed as current by itsETag, not by date. - The endpoint processes a limited number of images at once, with separate limits for images fetched from other sites and images read locally. Other requests wait, and when too many are waiting it answers
503withRetry-After. - A width or height above 4000 pixels returns the original image for media read from storage, and is scaled down to fit 4000 pixels for other images. For images that are not EmDash media, a width or height that is not a positive number answers
400. - AVIF renditions are served as
image/avif. - With
images: falseor a custom image endpoint, a configured site URL no longer adds the media route toimage.remotePatterns, so EmDash media renders as a plain<img>there.
- Images that are not EmDash media go to the image endpoint your adapter configured, so
-
#5060
afdf4c3Thanks @emdash-autofix! - Fixes extending a saved link over adjacent text producing separate links on the rendered page. Saving now joins adjacent link spans with equivalent options while preserving stored link keys where possible. Existing split links are repaired the next time the content is edited and saved; links separated by unlinked text or with different options remain distinct. -
c5877beThanks @ascorbic! - Changes which redirects plugin routes declared withresponse: "raw"can return. A redirect can no longer make the browser repeat a request other thanGETorHEAD: EmDash now answers500when a raw route returns307or308with aLocationheader for such a request, or301or302for a request other thanPOST.If a raw route redirects after a form submission or other write, return
303 See Otherinstead. The browser follows it withGET. Redirects in response toGETandHEADrequests are unchanged.The Portable Text block editor no longer follows redirects when it loads select options from a plugin's
optionsRoute. The route must answer with the options directly. The editor also requests options only whenoptionsRouteis a valid plugin route name, such asforms/list, that stays inside the plugin's own routes, and when the plugin ID contains only lowercase letters, digits,_and-. Otherwise it sends no request and shows the field's staticoptions. -
#5123
29caf9cThanks @ascorbic! - Fixes redirect loop detection never finishing when a pattern redirect's destination is matched again by a pattern redirect, such as/[...path]→/moved/[...path]or/[...path]→/[...path]/[...path]. Listing redirects, saving a redirect, or analyzing a site package with such a rule ran until the server ran out of memory. Such a chain now counts as a loop: the Redirects page flags the rule, a site import writes it disabled, and a new redirect that leads into the chain is refused. A chain through more than 20 pattern redirects, or one that grows a path past 8,192 characters, is treated the same way.Saving a redirect whose source has percent-encoded brackets, such as
/posts/%5Bslug%5D, is no longer refused as a loop when its destination leads through other redirects to a path that the source would match as a pattern. -
#5117
13bedc5Thanks @ascorbic! - Fixes two problems with how registry plugin requests handle unusual responses:- Registry plugin verification, install, update, update checks, and the registry image proxy no longer follow HTTP redirects from the aggregator. A redirect is now reported as an aggregator error. If your
registryoption points at a URL that redirects, change it to the final URL. - On Node.js, a registry plugin's icon, banner, screenshot, or bundle host that answers with an HTTP status outside 200–599 no longer stops the server process. The download now fails like any other unavailable artifact.
- Registry plugin verification, install, update, update checks, and the registry image proxy no longer follow HTTP redirects from the aggregator. A redirect is now reported as an aggregator error. If your
-
52d7880Thanks @ascorbic! - Fixes images on sites that use Astro route caching with a route rule covering/_imageor the media file route. A304 Not Modifiedanswer to one browser's revalidation could be stored by the route cache and served to every visitor until the rule'smaxAgeexpired, which broke the image for them. The route cache no longer stores304responses on any route, or any response other than200from the image endpoint route (/_imageor yourimage.endpoint.route), such as a404for a missing file or an error. This applies whichever image endpoint serves the route, including a custom one. -
#5164
54ee891Thanks @emdash-autofix! - Makesemdash media repair-usagestop safely before exhausting D1's per-request query allowance on Workers Paid, leaving queries available to release write leases and save status. Repair returnsCONTENT_USAGE_QUERY_LIMITand preserves its indexed-source count instead of returning a generic failure. This does not enable large collections to finish: resumable batches are not yet supported, and repeated runs restart at the first entry. Use--jsonand check the returned status rather than treating exit code0as complete coverage. The lower query allowance on Workers Free is not covered by this safeguard. -
#5093
801bdacThanks @ascorbic! - Fixes sign-in keeping the session ID the browser already had. Signing in with a passkey, magic link, OAuth, Atmosphere, an invite, signup, first-admin setup or external authentication now starts the session under a new ID and removes the previous one from the session store. -
#5104
7ed8e09Thanks @ascorbic! - Fixes first-admin creation so only one person becomes admin when several first sign-ins happen at the same moment.- GitHub, Google, Microsoft, and AT Protocol sign-in during setup: the first sign-in becomes admin. A sign-in that finishes at the same time is now refused with
signup_not_allowedinstead of creating a second admin. With AT Protocol, only the account that becomes admin receives the email entered in the setup wizard, so another account can no longer be linked to the admin by that email. - Cloudflare Access: when several people sign in to a new site at once, one becomes admin and the others get the role from their Access groups.
While setup is still open, a sign-in from a new identity is refused once any user exists, matching the passkey setup step.
@emdash-cms/authadds an optionalcreateUser(user)function tocanSelfSignupresults. When present,findOrCreateOAuthUser()calls it instead ofadapter.createUser(). If it returnsnull, the sign-in is refused withsignup_not_allowed.@emdash-cms/auth-atprotonow requiresemdash1.7.0 or later. - GitHub, Google, Microsoft, and AT Protocol sign-in during setup: the first sign-in becomes admin. A sign-in that finishes at the same time is now refused with
-
#5107
31625c7Thanks @ascorbic! - Fixes slug lookups that name no locale picking an arbitrary or lowest-code entry when entries in several locales share the slug.getEmDashEntrywithout a locale returns the default locale's published entry. An entry whose ID matches comes before one whose slug equals that ID, and a draft no longer hides a published entry with the same slug.- Reads by slug through the REST API, CLI,
EmDashClientand MCP return the default locale's entry, falling back to the lowest locale code only when the default locale has none. - Changes addressed by a slug that exists in more than one locale now fail with
AMBIGUOUS_LOCALE(400) unless the request names a locale. This covers update, delete, permanent delete, restore, publish, unpublish, schedule, unschedule, discard-draft, duplicate, edit locks, term assignment and plugin editor actions, through REST, the CLI,EmDashClientand MCP. Scripts that act on shared slugs without a locale must pass one or use the entry's ID. Changes addressed by ID are unaffected. - Restore and permanent delete by slug prefer a trashed entry over a live entry with the same slug.
To name a locale,
emdash content delete,publish,unpublish,scheduleandrestorenow accept--locale. The matchingEmDashClientmethods accept alocaleoption, the restore and permanent-delete endpoints accept?locale=, and the MCP toolscontent_delete,content_restore,content_permanent_delete,content_publish,content_unpublish,content_schedule,content_unscheduleandcontent_discard_draftaccept alocaleargument. -
a14daefThanks @ascorbic! - Updates the setup and sign-in APIs on sites that sign in through an external auth provider such as Cloudflare Access. Outsideastro dev,POST /_emdash/api/setup/admin,/_emdash/api/setup/admin/verify, and the OAuth and auth-provider sign-in routes under/_emdash/api/auth/now answer 400NOT_SUPPORTEDon those sites, because users are created by signing in through the external provider. The setup wizard never showed the passkey step in this mode, so only scripts that called these routes directly are affected. If the provider is configured withautoProvision: false, turn it on for the first sign-in so that the first admin can be created. -
#5089
83bb981Thanks @ascorbic! - Fixes read-only API responses showing users withoutcontent:read_drafts, such as subscribers, details of unpublished content:GET /_emdash/api/menus/:name,GET /_emdash/api/menus, and themenu_getandmenu_listMCP tools now leave out menu items that link to draft, scheduled or trashed entries, along with the items nested under them, and count only the remaining items initemCount. Subscribers now get the same items the site renders for visitors.GET /_emdash/api/content/:collection/:id/terms/:taxonomynow returns an emptyunresolvedlist to these users, because those assignments can come from an unpublished translation.termsis unchanged.- The content list and single-entry reads, over REST and through the
content_listandcontent_getMCP tools, no longer returndraftRevisionId,versionor_revto these users. Saving or discarding a draft changes these values while the published entry stays the same. These users cannot edit content, so they have no use for_rev.
Contributors and above still get the full responses.
-
#5001
fe7c634Thanks @emdash-autofix! - Fixes the visual editor placing the caret at the start of an image-first body instead of where you first click in the text. -
#5161
ff2a923Thanks @emdash-autofix! - Fixes LiveSearch result links ignoring the collection'surlPattern, which sent root-level pages to URLs such as/pages/my-pageinstead of/my-page. Search and autocomplete results now include a resolvedurlwith date tokens and locale prefixes. ExplicitrouteMapentries still override the default links.WebMcpSearchalso uses the resolved URLs, and default search result URLs honor Astro'strailingSlashsetting. -
#4889
e4c9baaThanks @emdash-autofix! - Fixes stale route caches on Node after scheduled publishing or plugin content actions from hooks and cron tasks. Background purges become available once a non-prerendered request with route caching enabled accesses the EmDash runtime in that process. WithmemoryCache(), publishing invalidates the collection and entry tags so cached listings and articles refresh on the next request rather than waiting for expiry; other server processes retain their own caches until they expire.With a compatible media cache provider, Node hook/cron media deletes and hourly cleanup also purge removed images once a route-cache-enabled request has accessed the EmDash runtime in that process. This does not enable automatic media caching with
memoryCache(). -
#4850
4301fcdThanks @Antonio-Bennett! - Fixes creating a translation when the collection has a non-translatable reference field. The create failed, and on PostgreSQL the API reported the collection as missing. -
#5103
302f950Thanks @ascorbic! - Fixes creating a translation and restoring a revision so the permission check uses the same entry the action changes. Both now look up the entry by ID only:- Creating a translation with
translationOf(REST and the MCPcontent_createtool) checks edit permission on the entry with that ID. Previously, when that ID was also another entry's slug, the permission was checked against the other entry. - Restoring a revision (
POST /_emdash/api/revisions/{id}/restoreand the MCPrevision_restoretool) checks ownership of the revision's own entry, with the same correction.
- Creating a translation with
-
#4888
fe34a65Thanks @emdash-autofix! - Fixesemdash seed --validateaccepting unsupported repeater sub-field types. Invalid or missing types and non-object sub-field entries now produce an error identifying the sub-field instead of reporting the seed as valid. These errors also prevent the seed from being applied. -
#4828
35d40a3Thanks @danielmlr! - Fixesemdash-env.d.tsdeclaring the same type name twice when a name generated for a blocks field or one of its block types matched a collection's interface name, another generated block name, or a type imported fromemdash. For example, acontentblocks field onpagesnext to apage_content_blockscollection declaredPageContentBlocktwice, and one of the two silently took the other's type. The clashing declaration now gets a number suffix, such asPageContentBlock2, and.emdash/types.tsuses the same names. Collection interface names, and generated block names that don't clash, stay the same. -
#5097
c78cc4bThanks @ascorbic! - Fixes the WordPress import wizard accepting a "Connect with WordPress" approval that it did not start. The wizard now sends a one-time value through WordPress, andGET /_emdash/api/import/wordpress-plugin/callbacksends the admin back to the wizard without connecting unless that value returns within ten minutes. The callback also requires theimport:executepermission, like the other import routes. When WordPress does not approve the connection, or the approval expires, the wizard now shows a message and its starting screen so the admin can reconnect. -
#5097
c78cc4bThanks @ascorbic! - Fixes the exportedwxrSourceimport source treating password-protected WordPress posts as published. Such posts now have the statusprivate, so they import as drafts, as they do in the admin and CLI WordPress importers, and they are left out whenincludeDraftsis false. -
#4927
390f8b1Thanks @emdash-autofix! - Fixes MCP schema tools to accept URL and repeater fields, widget configuration and field sort order on creation, and collection admin settings, visibility and sidebar order on update. Addsschema_reorder_fieldsto reorder a collection's fields in one call.schema_create_fieldnow creates reference fields the same way as the REST API: setvalidation.targetCollectionto create a relation, orvalidation.relationto bind an existing one. The olderoptions.collectiontarget remains accepted and now also creates a relation. A reference field with neither a target collection nor an existing relation is now rejected withVALIDATION_ERRORinstead of being created without a relation. -
Updated dependencies [
1168a73,7954e27,6396118,64df16d,368b3e8,db3aa05,d717fd6,c78e210,6eb4bd6,acff8d2,58c4c33,00367c1,1bdcfa8,45b3873,c0dd209,92e81a8,060e7e7,91dfa31,e138e21,933e2ee,4b6bcbe,7afb693,5030c20,7ed8e09,0917f1b,83c764e,0503743,bb86431,3c64f9b,9b494e0,e33afbe,4874deb,af15970,17b2b2d,ef0e581,b843b56,96a63c9,a397efc,afdf4c3,facf797,2072b22,c5877be,29caf9c,7ed8e09,5409819,87b8b0d,35ffffb,dcc6bc1,c78cc4b,eb02dbd]:- @emdash-cms/admin@1.7.0
- @emdash-cms/auth@1.7.0
- @emdash-cms/blocks@1.7.0
- @emdash-cms/gutenberg-to-portable-text@1.7.0