Repository navigation
emdash@1.6.0
Minor Changes
-
#4626
ac16583Thanks @khoinguyenpham04! - Adds draft access for trusted content editor panels. A native plugin's panel receiveseditorDraftbesideentry.editorDraft.get()reads the values open in the editor, including unsaved changes: the field values, the slug, and the SEO title and meta description, with their definitions and a revision.editorDraft.patch(operations, { expectedRevision })sets or clears them in the form without saving the entry. The editor refuses the patch when any of those values changed after the revision was read. A translation or excerpt panel can therefore read the current draft and put its results back for the user to review, without overwriting edits made while it worked. The SEO panel saves patched SEO values the way it saves typed ones, so they take effect at once.editorDraftisundefinedon older versions. The React admin extensions guide covers the rules and has an example.Draft patches from sandboxed editor panels and actions (
admin.editor-draft:patch) change too:- A patched rich text field shows the patched document. Before, it kept showing the old document, and the next keystroke there wrote the old document back over the patch.
- In collections with revisions, the first save that includes a patch keeps the draft revision it replaces, autosaves included, so the values from before the patch can be restored. With collaborative editing on, the room's saves don't keep it.
- A sandboxed patch with rich text that the editor can't load is refused with the "Plugin changes were not applied" message, and the form is left unchanged.
- The "Plugin changes were not applied" message shows as a toast. Before, it was a banner that stayed above the fields after the user moved on.
Field descriptors in the admin manifest include the field's schema
type, which tells apart types that share an editorkind, such asslugandstring. -
#4911
23800a0Thanks @swissky! - Caches EmDash image files for one year on sites with a compatible route-cache provider, such ascacheCloudflare(). Original files from/_emdash/api/media/file/and eligible resized variants from/_imageshare the tagemdash:media:<storageKey>. Replacing an image, or deleting one whose stored file is removed, purges that tag. Deletes from the admin media library and media picker, the MCPmedia_deletetool andctx.media.delete()in plugin routes are covered, subject to the purge limitations.Astro's
memoryCache()does not receive automatic media cache entries at any response size; page caching is unaffected. Other providers must preserve distinct source URLs and transform options in their cache keys and support conditional requests. Audio, video, partial responses and original-file URLs with query strings are not stored. Variants are eligible only when theirhrefis a plain EmDash media path or that path prefixed with the request's origin, without a nested query or fragment.Automatic variant caching and query normalization apply only to Astro's stock sharp service on Node and
@astrojs/cloudflare/image-service-workerdon Cloudflare. With these services,/_imageURLs for EmDash media redirect with a301when their outer query contains unknown or repeated parameters, uses a different parameter order or encodes values differently. This also applies without a cache provider. Stock-service URLs built by<Image>andgetImage()are unaffected. Custom image services retain their existing handling and parameters without these redirects or automatic variant caching. -
#4787
acb8a0fThanks @khoinguyenpham04! - Fixes scheduled entries going live up to a minute after their scheduled time.On Cloudflare, each Cron Trigger run waits up to 70 seconds for upcoming entries and publishes each one at its scheduled time, so an entry scheduled about a minute or more ahead no longer depends on when the next trigger starts. Waiting uses no CPU time, but while entries are scheduled within that window a scheduled invocation stays open for up to about a minute, so consecutive invocations can overlap in Workers logs and metrics. Sites that use
createScheduledHandler()from@emdash-cms/cloudflare/workerget this automatically.On Node.js, the scheduler runs the publishing sweep at the start of every minute, so an entry scheduled for a whole minute, as the admin sets it, goes live at that minute. A schedule with seconds, which only the API and MCP can set, can still go live up to a minute late.
A scheduled publish that another scheduler run or an editor has already completed no longer runs
content:beforePublishhooks, so a hook cannot record a rejection for an entry that is already live.A custom Worker entry point that calls
runScheduledTasks()fromemdash/middlewarepublishes only entries that are already due. To wait for upcoming entries, pass the newpublishUpcomingWithinMsoption:await runScheduledTasks({ publishUpcomingWithinMs: 70 * 1000 });
Patch Changes
-
#4970
45c5053Thanks @emdash-autofix! - Fixes object-cache page-render failures on Cloudflare Workers after a request is cancelled. Deferred work now uses Workers' lifetime extender even with injected or vendored Astro adapters, such as Alchemy, and shared cache operations that reject after their owning request ends use their existing non-fatal fallbacks instead of failing the render. Node deployments keep the existing fire-and-forget behavior. -
#4760
2bbc729Thanks @emdash-autofix! - Reduces D1 rows read by search and autocomplete on cold Workers isolates by skipping full row-count verification of existing search indexes. Missing indexes and indexes left empty by an interrupted rebuild are still repaired automatically. Partially populated indexes are no longer detected automatically; to repair one, send aPOST /_emdash/api/search/rebuildrequest as an Admin (search:managepermission), withX-EmDash-Request: 1and a JSON body such as{"collection":"articles"}. Bearer tokens also require theadminscope. See search index recovery for the complete request and verification steps. -
#4999
732867eThanks @swissky! - Stops the first request to a fresh isolate or process from writing to the database to release stale plugin cron locks. Scheduled maintenance (the Cloudflare Cron Trigger or the Node scheduler) still releases them on every run, so cold anonymous page views on D1 no longer go to the primary for this write. -
#4994
b4e77d5Thanks @swissky! - Fixes cached detail-page 404s staying stale after the missing entry is published.getEmDashEntrynow returns the collection tag incacheHintwhen no entry is found, so publishing the entry purges the cached 404. An entry found in the requested locale keeps only its own id and reference tags. An entry served from a fallback locale, or stored under a legacy locale code such asen-US, also carries the collection tag. On a site whose page passes no other cache hint, this can make a 404 cacheable for up to 60 seconds even without a route rule. To keep misses uncached, see Error responses.Upgrading
Pass the
getEmDashEntryhint toAstro.cache.set()before rewriting to/404, as the templates now do, so the cached 404 is purged when the entry is published. -
#4935
6d0551bThanks @ascorbic! - Fixes external authentication, such as Cloudflare Access, saving a role level that EmDash doesn't define (anything other than 10, 20, 30, 40 or 50) to the user record. Such a record made every later sign-in by that user fail. EmDash now refuses a sign-in with an undefined role level and leaves the user record unchanged.A user record that already holds an undefined role level is not repaired automatically: that user still can't sign in after upgrading. Correct the provider's role mapping, then set the user's
rolecolumn in theuserstable to one of the defined levels. -
#4864
438b2f9Thanks @emdash-autofix! - Fixes allowed-domain self-signup failing with "Setup already complete" when creating a passkey on a site that has finished setup. -
#4967
e8a2286Thanks @emdash-autofix! - Fixes published Portable Text code blocks so keyboard users can focus and scroll them horizontally, with a visible focus indicator and an accessible name based on the filename or language. -
#4935
6d0551bThanks @ascorbic! - Fixes the Node image endpoint returning a 500 for EmDash media that Astro's image service can't optimize. The endpoint now passes Astro's logger to the image service, so the service logs its warning and serves the original image. -
#4947
01f717dThanks @emdash-autofix! - Fixes searches in the admin Media Library and media picker failing on Cloudflare D1 for long search terms, including multibyte text, and fixes the same limit in folder search. Media search also matches storage keys and media IDs, and accepts pasted media file URLs. Short terms may return more results because they can match keys and IDs as well as filenames. -
#4968
e573224Thanks @emdash-autofix! - Fixes media usage tracking missing files linked by their/_emdash/api/media/file/URL. Used in now includes Portable Text paragraph link marks, HTML blockhrefandsrcattributes, and whole string or URL field values, including fields inside blocks and repeaters.Counts both root-relative URLs and full same-site URLs copied from the Media Library. Full URLs must match the site origin resolved from configuration or environment, the Site URL setting, or the setup URL when neither is set. The Site URL setting is used only for HTTPS or loopback HTTP addresses; for other HTTP sites, configure
siteUrlinstead (orEMDASH_SITE_URLon Node.js). External URLs and URLs embedded in plain text are not counted. Deleting media still requires reviewing its references first; usage tracking does not prevent deletion.Playground sessions now record their setup origin automatically, so full URLs from Copy URL are counted without setting Site URL manually.
Upgrade action
Existing entries are not re-indexed automatically. After upgrading, run
npx emdash media repair-usage --allagainst the upgraded instance (use--urlto select the site), or save the affected entries again. Alternatives are themedia_usage_repairMCP tool orPOST /_emdash/api/admin/media-usage/repair, both with{ "scope": "all" }. Until repair completes or the entries are saved again, coverage can still show as complete and a linked file can show No tracked references found. See the upgrade instructions for connection options and verification. -
#4935
6d0551bThanks @ascorbic! - Corrects the types of theAstro.locals.emdashhandlers to match what they return and accept.- A handler result now narrows on
success, soresult.datais typed after anif (result.success)check.result.data?.…andresult.error?.…still work without narrowing. handleContentGetandhandleRevisionGettype the standard properties ofitem, such asstatus,data, andcreatedAt. Other properties still read asunknown. Code that deletes a required property, such asdelete item.draftRevisionId, or assigns anunknownvalue toitem.datano longer type-checks. Use destructuring to drop a property (const { draftRevisionId, ...rest } = item), or castitemtoRecord<string, unknown>first.handleMediaList,handleMediaGet,handleMediaCreate,handleMediaUpdate, andhandleCommentModeratedescribe their result data.handleMediaUploadrequiresbase64andcontentTypeand no longer lists aurloption, which it never supported.
- A handler result now narrows on
-
#4194
12226e5Thanks @emdashbot! - Fixessearch()ranking so full-title phrase matches and titles matching every query term appear before body-only matches, even in small collections or on short result pages. Within title-term matches, shorter titles rank before higher scores.search()scores are now normalized to 0–1 within each collection instead of returning raw BM25 magnitudes, including searches restricted to one collection. Title-match tiers take precedence over scores. Preserve the returned result order and review any custom score thresholds when upgrading.searchCollection()keeps its raw scores and score-based ordering. -
#4238
8275da7Thanks @danielmlr! - Fixes literal heading and list markers, such as# Titleand1. item, turning into Markdown blocks when rich text is read and written back through the CLI, MCP content tools,EmDashClientorportableTextToMarkdownfromemdash/client. Markdown output now escapes these markers at the start of paragraph lines, including lines after a hard break, and escapes setext underlines such as---and===and table delimiter rows such as| --- | --- |. -
#5010
43c901fThanks @emdash-autofix! - Improves search and autocomplete latency across multiple collections on D1 when query coalescing is enabled. Reduces first-search index health checks to a small number of database round trips while preserving automatic repair of missing or empty indexes. -
#4840
c2f56b4Thanks @emdash-autofix! - Fixes duplicate layout queries when anonymous public pages callAstro.rewrite(), such as rewriting an unknown slug to/404. The rewritten page reuses the original request's cached reads and prefetched layout data. Previews, edit mode, and requests carrying session cookies or authorization headers continue to use fresh request contexts. -
#4910
b71f7b1Thanks @emdash-autofix! - Fixes<Comments>dates to use the site's Timezone setting instead of the server's timezone, including dates on threaded replies. Missing or invalid timezone settings use UTC, including on Node.js servers configured with a different local timezone. Set the site's Timezone to keep dates in your preferred timezone. -
#4871
d682215Thanks @emdash-autofix! - Fixes visual editing creating an unwanted draft when clicking into an unchanged Portable Text field that ends in a list, image, heading, blockquote, HTML block, or plugin block, then leaving the field or page. -
#4960
7c7f5a9Thanks @emdash-autofix! - Fixes concurrent content saves failing with hung-request errors on Cloudflare Workers when updating media usage. Later saves can also recover if an earlier request was cancelled while holding a media-usage lock, rather than leaving writes to the collection stuck until the isolate restarts. A save may wait up to a minute before reclaiming an abandoned lock. -
#4857
1b430eaThanks @emdash-autofix! - Fixes layout prefetching on anonymous multilingual Astro pages to load menus and taxonomy terms in the page's locale, avoiding duplicate reads when layouts request that locale explicitly. Sites with a single configured locale, or no i18n configuration, keep their existing prefetch behavior.On non-default-locale pages, implicit
getMenu()andgetTaxonomyTerms()calls still return default-locale data, but now load it separately from the page-locale prefetch. This increases reads for implicit-locale layouts and EmDash's built-in menu widgets on translated pages, including pages whose other navigation already passes an explicit locale. Menu widgets retain their default-locale output; this patch does not change which content they render. Layouts intended to render translated navigation should pass{ locale: Astro.currentLocale }to these helpers to reuse the prefetched data. -
#4890
09a0a95Thanks @emdash-autofix! - Fixes built-in search endpoints on PostgreSQL, including Hyperdrive, so they report503 SEARCH_UNAVAILABLEinstead of returning generic errors or misleading empty results. PostgreSQL search is still unavailable; use a SQLite-family database with FTS5 for built-in full-text search. The editor's link picker explains that content search is unavailable and suggests pasting a URL, without retrying the unsupported search or blaming the network connection. -
#4837
9f79ba3Thanks @emdash-autofix! - Fixes two Astro warnings on static sites: theAstro.request.headerswarning on prerendered pages and thecache.set()warning on 404s when no route cache provider is configured. -
#4805
395d56cThanks @emdash-autofix! - Fixes the Users page showing “Last Login: Never” after magic-link, OAuth (including AT Protocol), or external-provider sign-in. Successful sign-ins now record a login time independently of passkeys, while existing passkey login history remains visible. Previously unrecorded logins appear after the next sign-in; refreshing an existing session does not record a new login.EmDash migrates the database automatically. Existing standalone Kysely auth-adapter databases continue to report passkey history without requiring a schema change.
-
#4812
6b87682Thanks @emdash-autofix! - Prevents SQLite from creating a blank database when the main file is missing but its-walor-shmfile remains, protecting committed content still in the write-ahead log. EmDash refuses the open and logs an error without changing these files. Stop the server and restore the original main file before restarting. This cannot recover data already overwritten by an earlier startup.To intentionally discard all local SQLite data and start fresh, stop all processes using the database and delete
data.db,data.db-wal, anddata.db-shm(substitute your configured database path). Reset scripts that delete onlydata.dbmust also remove its sidecars. -
#4992
56bae1aThanks @emdash-autofix! - Allows content-miss 404s on public page routes with active cache options to be served from the cache for up to 60 seconds, instead of rendering on every request. With a route-cache provider configured, a tags-only hint from the 404 page or its layout can activate this behavior even without a route rule. Shorter lifetimes and explicit cache opt-outs are preserved, and stale-while-revalidate is disabled for these responses.Keep the collection or taxonomy tag on the route rule so publishing the missing entry or saving the missing term purges its cached 404. Previously these responses were never cached. Sites whose rules lack the matching tag can now serve a stale 404 until its short lifetime expires; a failed purge has the same effect. Shipped template layouts supply settings and menu hints, not the missing content's collection or taxonomy tag, so their misses can remain cached after publication until this lifetime expires. To restore uncached misses, call
Astro.cache.set(false)in the 404 page's frontmatter (or the miss branch for a directly returned 404), and skip any later layout calls that re-enable caching.Cached 404 hits no longer reach the origin, so the admin's 404 hit counts exclude those requests. URLs that match no Astro route, internal paths, and paths ending in a file extension are unchanged.
-
#4926
b105cadThanks @emdash-autofix! - Fixes repeatedgetEmDashEntry()calls with the same arguments issuing duplicate database reads within a request, so layouts and blocks can share a singleton entry read. As withgetEmDashCollection(), identical calls in one request now share the same result object, so copy entry data before modifying it. -
#4868
40fe8b5Thanks @emdash-autofix! - Fixes media replacements in the admin not triggeringmedia:afterUpload, so upload plugins can process replaced files and send audit-log and webhook notifications. -
#4965
cfc80bfThanks @emdash-autofix! - FixesEmDashClienterrors losing plain-text response bodies from runtimes and proxies. Non-JSON error messages now include the first 500 characters of the trimmed body, falling back to the HTTP status text or status code when the body is empty or unreadable. -
#4964
f8cf63fThanks @emdash-autofix! - Fixes exact redirect rules for paths with file extensions, such as/old/report.pdf, being saved but never applied. A file request also matches an exact rule saved with a trailing slash. Only exact rules apply to file requests; named and catch-all patterns do not redirect them. File requests are not recorded in the 404 log. -
#4972
1bdb0d2Thanks @emdash-autofix! - Fixes PostgreSQL detection duringastro devwith Cloudflare Hyperdrive, so plugin storage queries and index creation no longer fail withfunction json_extract(text, unknown) does not existwhen Vite loads separate copies of Kysely. -
#4929
0e68d47Thanks @emdash-autofix! - Fixes image sub-fields in repeaters ignoringvalidation.allowedMimeTypesin the media picker and during upload, including repeaters inside block types. Configure the image sub-field through a seed, the schema API, or code to opt into formats such as SVG without changing the global upload allowlist. Editing a repeater in Content Types preserves its configured sub-field allowlists. -
#4976
366fd9fThanks @emdash-autofix! - Fixes sitemaplastmoddates staying unchanged after live SEO metadata edits, including SEO title changes. Sitemap entries and the sitemap index now use the later content or SEO modification date. Saving unchanged SEO settings does not advance the date. -
#4866
f585c35Thanks @emdash-autofix! - Fixes registry and marketplace plugin routes intermittently returning404 Plugin route not foundon warm Cloudflare isolates after an install, update, or uninstall. Requests to/_emdash/api/plugins/*check for plugin-state changes before checking route permissions, without requiring a redeploy. Only newer generation-tagged snapshots are applied, so replica lag can delay a change but cannot restore older plugin code or permissions.Plugin route requests return
503 PLUGIN_SYNC_ERRORif state cannot be read or the requested plugin fails to load. Bundle and sandbox-load failures retry after a five-second backoff, or immediately when the plugin's stored state changes.On Durable Object SQL deployments, upgrade core and the Cloudflare adapter together so plugin state and its generation are committed atomically.
Durable Object SQL also executes existing atomic batches for content saves, menus, seeding and block-type updates as single primary transactions instead of separate statements.
-
Updated dependencies [
a4c05ad,ac16583,ac16583,6d0551b,fe19551,8c2ec3f,5d446cb,8a44cde,8a44cde,438b2f9,9275235,b58be50,814bba4,90df67a,d3c66d2,7ce0d77,817779d,9b131c3,f0c28ef,a570e5d,e573224,a0fdb0d,64b3288,09a0a95,395d56c,e7c8f19,6d0551b,8a44cde,af72255,1118efe,88b7795,a5bd731,c55e559,0e68d47,41149d9,4cf36d3,7218164,c73c600]:- @emdash-cms/admin@1.6.0
- @emdash-cms/auth@1.6.0
- @emdash-cms/blocks@1.6.0
- @emdash-cms/registry-verification@0.4.0
- @emdash-cms/registry-client@0.7.3
- @emdash-cms/registry-lexicons@0.7.1
- @emdash-cms/gutenberg-to-portable-text@1.6.0