I · Prologue
Upgrading
On this page
This page lists every change between one version and the next that an app has to act on: how likely it is to affect your app, what to do, and the way back where there is one. The release policy says what a version promises.
Upgrading to 1.2.3 from 1.2.2
Security hardening
Low: startServer holds a response to its length, answers a failed body, and refuses a fetched Response
Likelihood of impact: low — apps with streamed responses of their own, routes that return a Response from fetch(), its clone, Response.error() or one made before the server started, code that checks instanceof Response or instanceof Request, and routes that set Content-Length, Transfer-Encoding or Trailer on a response.
Under startServer(), a response is held to its Content-Length: a longer body is cut at it and a shorter one closes the connection. A streamed body that fails on its first reads is answered 500 instead of a shorter 200. A body that fails later closes the connection, and the text of its error is never sent. A Transfer-Encoding or Trailer header of a route is not sent, and a Content-Length of a route is sent only when it is one whole number. Nothing changes in code, unless your route sets one of these headers itself.
A stream is cancelled when its client left before the response started. A stream you feed from a timer or an event needs a cancel() that stops feeding it.
instanceof Responseandinstanceof Requestin your own code are now true also for those of the platform, such as fromfetch()and.clone().- A route that returns a
Responseoffetch()or its clone,Response.error(), or one whose body is read or locked now answers500with aTypeError. Before,startServer()sent it as JSON{}. Build aResponseof your own from the body and the headers you choose to pass on, withoutContent-EncodingandContent-Length(responses). - A
Responseyour code made goes out as the pages say, also a subclass of it, a clone of it, and one made before the server started. Before,startServer()sent a clone and one made before the start as{}.
This release fixes GHSA-mxg6-hmhw-47gq.
Upgrading to 1.2.2 from 1.1.0
Commands
Low: A command of your own named add, doctor, upgrade or db:query needs another name
Likelihood of impact: low — apps, and packages they use, with a command of exactly one of these names, such as db:query in a module named db.
marmeon brings four new commands. add installs a framework package at the app's version, doctor checks that a machine can run the app, and upgrade moves every framework package to one version. db:query comes with @marmeon/database and runs one read-only query against a connection. A command of your own with one of these names now stops marmeon build and the start with K8, and the message names both classes. Rename yours, preferably into your module's group (notes:doctor), and change the scheduled tasks and scripts that call it by its old name. There is no way back: the names belong to the framework. See writing commands.
Low: @marmeon/oauth brings the commands make:oauth and make:social-accounts-table
Likelihood of impact: low — apps that add @marmeon/oauth and have a command of their own named make:oauth or make:social-accounts-table.
Nothing changes until you add the package. Its provider registers make:oauth, which writes the sign-in module into the app, and make:social-accounts-table, which writes the migration of the social_accounts table. A command of your own with one of these names then stops marmeon build and the start with K8. Rename yours before you add the package. There is no way back. See the generated module.
Pages, forms and policies
Low: A policy's static guard names the guard whose users it judges
Likelihood of impact: low — policy classes with a static property named guard, also one they inherit.
@marmeon/auth now reads static guard on a policy class: it names the guard whose users the policy judges (policies of a guard). Without the static, or with undefined, a policy judges your app's users as before. Any other value that is not a guard made by defineGuard() and registered, or a guard slot, fails with A8 the first time the gate asks the policy, before the policy runs. The compiler points at such a policy: it has no abilities, so can() and the gate's methods refuse its ability names. Rename the static. There is no way back.
Low: Every page of the web group carries the prop _conflict
Likelihood of impact: low — tests that compare all props of a page, and pages that pass a prop named _conflict.
ShareErrorsFromSession of @marmeon/session shares _conflict on every page of the web group. It holds the conflict of a stale save that a form shows (conflicts), and null when there is none. A test that compares a page's props as a whole now needs _conflict: null. A page's own prop named _conflict is a type error at view() and is dropped at run time: give it another name. There is no way back.
Low: upload() refuses an option it does not know
Likelihood of impact: low — upload rules whose options come from a variable or from JavaScript and carry a key upload() does not take. TypeScript already refuses such a key in an object literal.
upload() takes maxBytes, mime, text and dimensions. Any other key now makes it throw a TypeError that names the key, where 1.1.0 ignored it. A misspelt mimes therefore no longer leaves every file type allowed without a word. Correct or remove the key. There is no way back. See uploads.
Migrations
Low: Raw SQL in a data step that names the migrator's tables stops with D4
Likelihood of impact: low — migrations whose schema.data() step names migrations or migration_lock in raw SQL, or appends raw SQL that changes the schema to a query.
A schema.data() step now reads each statement as it is sent. Raw SQL that names migrations or migration_lock stops the migration with D4, a read included; on SQLite a word inside a string counts too. So does a write to those tables through the query builder inside a CTE, a subquery or an insert … select, and raw SQL that changes the schema, appended to a query or nested in one. In 1.1.0 the guard did not look for the migrator's tables in raw SQL. A migration that ran stays recorded and does not run again in that database. It stops with D4 on every fresh database: in your tests, after migrate:fresh and in a new environment. Read the migrator's tables through the query builder, which may still do so, and move a schema change into a step of its own (schema.alter(), schema.raw()). There is no way back. See changing the data.
Logs and coding agents
Low: A query parameter named state is masked in logs, the error page, the devtools and traces
Likelihood of impact: low — apps with a query parameter of their own named state (/orders?state=open) whose value someone reads in the log, the error page, the devtools or traces.
An OAuth state ties a browser to a pending sign-in, so a reader of the log must not get it. The redactor now masks the value of every query parameter named state, like code, also your own: /orders?state=open shows as /orders?state=[redacted]. The error page, the devtools and traces that record query values mask it in their query fields too. Your routes read the parameter as before. If you need such a value in the log, log it as a field of its own: a log field named state stays readable. There is no way back: the masking has no setting. See keeping secrets out of the log.
Low: A coding agent can read rows of the development database through marmeon mcp
Likelihood of impact: low — apps whose coding agent uses the MCP server that marmeon agents:install sets up, and whose development database holds personal data.
marmeon mcp has a new tool, query: one read-only SQL query on a connection of the app, in development and test only (the query tool). It is there as soon as the packages are upgraded. The server announces it as read-only, and it is meant to run without a question for each call. Secret columns and connections set to managed: false are refused, and string values are masked the way the log is. The other values reach the agent, and with them the provider that runs it. If that is not acceptable, deny the tool in the agent's permissions; for Claude Code, add "mcp__marmeon__query" to permissions.deny in .claude/settings.json.
Low: marmeon check reports the AGENTS.md block and the installed skills as out of date
Likelihood of impact: low — apps that ran marmeon agents:sync or marmeon agents:install, and run marmeon check or the --check of those commands in CI.
The block of AGENTS.md and the skills marmeon-debugging and marmeon-testing now name the new tools of marmeon mcp and tinker --sandbox. Until you run marmeon agents:sync and marmeon agents:install and commit the result, marmeon check warns that they are out of date, and agents:sync --check and agents:install --check exit with 1. There is no way back. See keeping the block current.
The start
Low: A lang/marmeon folder that cannot be read stops the start
Likelihood of impact: low — servers on which the app's lang/marmeon/ folder exists but the process may not read it.
The start reads your rewording of the framework's texts from lang/marmeon/ (the framework's texts). A folder that is there but cannot be read now stops the start. 1.1.0 skipped it and showed the framework's own wording. A folder that is not there still means no rewording. Let the app's process read the folder, or remove it. There is no way back.
Upgrading to 1.1.0 from 1.0.0
Security hardening
Low: A passkey with an RSA key under 2048 bits or an unlisted algorithm no longer signs in
Likelihood of impact: low — accounts whose stored passkey uses an RSA key under 2048 bits, or an algorithm other than ES256, EdDSA and RS256 (for example from imported rows). Common RS256 authenticators such as Windows Hello make 2048-bit keys.
Nothing changes in code. Registration refuses an RSA key shorter than 2048 bits with invalid and fires no event. Sign-in refuses such a stored key, or one whose algorithm registration does not offer, before anything is verified, like any wrong passkey: a passwordless sign-in returns invalid and fires PasskeySignInFailed; as a second factor (after the password, at a step-up, when confirming sudo mode) it returns invalid-code and fires TwoFactorChallengeFailed. An affected account signs in with its password and another second factor or a recovery code, removes the passkey and registers a new one. There is no way back: the bound has no setting.
Upgrading to 1.0.0 from 0.4.0
Before and right after the upgrade
High: Before you upgrade
Likelihood of impact: high — every app checks this list before it moves to this release.
1.0.0 reads what 0.4 wrote: sessions, the session and remember-me cookies, API tokens, queued jobs, cache entries, uploads and the record of migrations. Nobody has to sign in again, no queue has to run empty, and servers of 0.4 and 1.0 may run side by side during a rolling deploy. What two versions do not share: the live stream (the stream's protocol version), whose hints between old and new nodes are lost during the rollout, so that a tab opened before it gets no live updates until its next visit; values encrypted without a context (step 1); links without an expiry and temporary links over seven days (step 3.3); and a reset link that is older than a lowered AUTH_RESET_MINUTES (step 3.3). Do these in order.
- On 0.4, before you move a package. Some changes cannot be made afterwards:
- Values you encrypted without a context: re-encrypt them, deploy the code that passes the context, then upgrade. This release reads none of them (encryption).
- A named Redis connection without a prefix: give it one in its
resolve, and move the keys it kept without a prefix under the new one first (Redis). - A Redis queue whose name ends in
:delayedor:reserved: rename it, and move its jobs with the workers stopped (queue names).
- In development, with the packages at 1.0.0.
- Move every framework package at once:
pnpm up --latest "@marmeon/*" marmeon. Then check thatpackage.jsonnames every@marmeon/*package andmarmeonat exactly1.0.0: an app made before 1.0 does not save exact versions, so pnpm may write^1.0.0. Set each one to1.0.0by hand where it did and runpnpm install; never upgrade one alone (how to upgrade). On the first day after the release, pnpm holds the new versions back (the first day after a release). - Change what stops the start, in
.env,.env.test,.env.example, the compose file and the CI configuration.make:auth,migrate,db:typesandroute:typesstart the app, so they stop on each of these, with a message that names the problem:SERVER_MAX_BODY_SIZE,MAX_BODY_SIZEandHASH_ARGON_MEMORYbecomeSERVER_MAX_BODY_MBandHASH_ARGON_MEMORY_KB(sizes);AUTH_RESET_MINUTESandUPLOADS_SEND_WITHIN_MINUTESare at most 1440 (auth, temporary URLs);SERVER_TRUSTED_PROXIEShas no0.0.0.0/0,::/0or IPv6 range that holds all of IPv4: write*if every peer really is your proxy, or list the proxy ranges (proxies);- a slow Postgres server, such as a paused serverless database, needs
?connect_timeout=<seconds>inDB_URLwhen it takes longer than 10 s to accept a connection (Postgres); - a Vite
basethat is a path or relative (/static/,./) becomes/or the absolute URL of the assets (the base).
- An app made with the starter kit: add
oxc-transformand runmarmeon make:auth --force(the kit). Until then its tests and its type check fail on the old module. - Run
marmeon migrateon the development database, thenmarmeon db:types,marmeon route:typesandmarmeon agents:sync, and commit what they write. 1.0.0 adds no migration an existing app has to run, butmigratewrites the table types in development;db:types --checkfails with "generated by another version" until the types are written again (table types);agents:syncbrings the block ofAGENTS.mdup to date, whichmarmeon checkreports until then (coding agents). - Make the changes of the other entries below. The compiler,
marmeon checkand the tests point at most of them; the lists after this procedure name what they cannot find.
- Move every framework package at once:
- Deploy.
- Set the environment of the servers and the platform to the new names and limits of step 2.2, in the same deploy as the new release: an old name that is still set stops the start.
- Run
marmeon migrate --forceonce, as with every deploy (deployment), and roll the new release out. There is nothing to stop and no session or token to end. - Links you sent before the upgrade: a signed link without an expiry answers 403 unless its route says
signed({ forever: true })(signed links), and a temporary storage link made for longer than seven days answers 403: send new ones, or serve such files through a route of your own (temporary URLs). IfAUTH_RESET_MINUTESwas above 1440 and you lowered it, an open password-reset link older than the new limit is refused when it is used: the limit applies at use, so ask those users to request a new link.
The start stops with a message that names the problem for: a command named dev or start (K8), a scoped binding whose binder does not scope (H11), a route pattern that cannot be read the same way everywhere (H13), a check timeout over its limit, at zero or below (K13), a named Redis connection with an empty prefix (K6), a default layout whose error is no component (R19), a MAIL_DRIVER that no provider brought (Q8), a body schema with a file in a list, a union or an optional object (S2), an environment variable with an old size name, two different defineConnection() definitions with the same name (D23), a csrfExcept pattern that matches every path, does not start with / or starts with a placeholder (a TypeError, CSRF exclusions), abilities() without an ability, a default Redis queue whose name collides (Q4), the proxy ranges, AUTH_RESET_MINUTES and UPLOADS_SEND_WITHIN_MINUTES above, and an invalid connect_timeout. vite.config.ts refuses the options pages and lang, and marmeon build a Vite base that is no URL. marmeon dev, build, route:types and check stop for an error page or a layer backdrop in its former place (K14, system module).
Neither the compiler nor the start finds these: a check timeout written in milliseconds; a number in once(fn, { for }), which is seconds; a number of milliseconds as the timeout of the live test reader, now seconds; a string returned from a route, now sent as text/plain; a link without expires at signed(); a sync or unique job dispatched through a transaction you began yourself; auth.updatePassword() without a confirmed password; a script that tests for exit code 1 after a wrong argument; a temporaryUrl() longer than seven days on a local disk, which now throws when it is signed; a Limit built from a count that is zero or not a number, which now throws when the limiter runs; a test app that runs as production and posts without a CSRF token, which now gets a 419; a call of AccountSessions.end(userId) or marmeon auth:end-sessions that must keep the user's API tokens, which now revokes them; a test or a layout(name) that compares the name of an error page or the backdrop; an island that reads a cookie while its page is rendered on the server for a visitor without a session (islands and cookies); a closure route that returns island(), an island imported through a re-export, a module package built before this version and a controller that returns a page or an island depending on a branch, which all answer 404 (island routes); a csrfExcept such as /webhooks/* that no longer covers /webhooks/stripe/events, whose requests get 419 (CSRF exclusions); a page that shows a table without .attach(T.endpoints()), also a table without actions or exports, which fails when the page is requested (table endpoints); a mail template with mj-social-element, mj-accordion or mj-carousel without its image attributes, which fromMjml() refuses with Q7 when the mail is rendered or sent (MJML); a TimeZone in the ?options= of DB_URL, which UTC silently replaces (Postgres); a body schema built by a factory with a file in a list, a union or an optional object, which answers 500 at its first submit (files); a table whose authorize returns something other than true (table authorize); and a script or a person that read a mail's reset or verification link from a production log, where only recipients and subject are written now (the log mailer).
An entry below that names no way back has none.
High: Apps made with the starter kit take its auth module once more
Likelihood of impact: high — apps made with make:auth, and every app made with create-marmeon on 0.4.
The kit's controllers, mails, tests and translations changed with the entries of this release, and nothing updates them in an app. Once the packages are at 1.0.0 the app still loads, but its type check and many of its tests fail on the old module. On a clean working tree:
- Run
pnpm add -D oxc-transformif the app lacks it: the kit's mails are React views, which the server compiles with it, andmarmeon buildstops without it while any mail view exists. - Run
marmeon make:auth --force. It writes the module again and keeps every migration the app has, adding only the ones it lacks. It deletes the files of the old kit that the new one no longer writes, whenmarmeon-stubs.jsonshows the app left them unchanged:controllers/CreateAccessTokenController.ts, which the kit of 1.0 ships asStoreAccessTokenController.ts, andmail/layout.ts, which became the componentmail/Layout.tsx. A file you changed stays and the command names it: carry your changes to the mail frame (branding, footer) intoLayout.tsx, because the new mails no longer importlayout.ts, and delete the old file once nothing of yours imports it. - Run
marmeon migrate,marmeon db:typesandmarmeon route:types. - Look at
git diffand put your own changes back.
Without --force, port the changes from packages/auth/stubs/react/modules/auth of the installed version; the compiler and the tests point at most places.
Every app made with create-marmeon on 0.4, with or without the kit, also has HASH_ARGON_MEMORY in .env.test and progressBar({ delay: 250 }) in bootstrap/client.tsx: rename them to HASH_ARGON_MEMORY_KB (sizes) and delayMs (the client's spans of time).
There is no way back. See the starter kit.
Security defaults
Medium: Every encryption takes a context of its own
Likelihood of impact: medium — apps that call encrypt() or decrypt() themselves.
Encrypter.encrypt(plaintext, context) and decrypt(payload, context) require the context, also in AesGcmEncrypter and CursorEncrypter. '' or a missing argument throws a TypeError. The context binds a ciphertext to its use: without one, two values an app encrypted were interchangeable.
Give each use of your own a context of its own that starts with none of
cookie:,session:,queue:ormarmeon:// before encrypt(value) // after encrypt(value, 'billing:coupon')Values stored without a context used the empty one. This release does not decrypt them, and no method reads them. Re-encrypt them before you upgrade, on 0.4, where
decrypt(payload)still reads them andencrypt(text, context)already takes a context: runencrypt(await decrypt(row.code), 'billing:coupon')over the column, deploy the code that passes the context, then upgrade.The payload format does not change, and every framework caller already passed a context, so cookies, sessions, jobs and cursors keep decrypting. An app that always passed a context changes nothing.
Medium: A signed link carries its expiry, and signed() refuses one without
Likelihood of impact: medium — apps that make signed links or have routes behind signed().
Making a link:
| Before | After |
|---|---|
signer.temporarySignedRoute(name, params, '7d', { base }) | signer.signedRoute(name, params, { expiresIn: { days: 7 }, base }) |
signer.signedRoute(name, params) (never expired) | signer.signedRoute(name, params, { expiresIn: … }), or signer.foreverSignedRoute(name, params) if the link really must never expire |
signer.signedPath(path) | signer.signedPath(path, { expiresIn: … }) |
expiresInis required and at least one second: a number of seconds or aDurationobject, never a string such as'7d'. 0, negative or sub-second values throw aRangeError. Untyped code withoutexpiresIngets aTypeErrorthat namesforeverSignedRoute().paramsis always required: pass{}for a route without parameters.
Accepting a link:
- A route behind
signed()answers 403 to a link withoutexpires, andhasValidSignature(url)isfalsefor it. An expired link is refused as before. - Links from
foreverSignedRoute(), and old links in mails that were made without an expiry, needsigned({ forever: true })on their route, orhasValidSignature(url, { forever: true }).forevertakes onlytrue. Prefer giving such links an expiry. - An empty or doubled
expires=, or one in the path or fragment, is refused.
Links made with an expiry change nothing, and links sent before the upgrade with an expires keep working; the signature and the query format are unchanged. A link sent without one needs forever as above.
Medium: Access tokens, password changes and reset links have safe defaults
Likelihood of impact: medium — apps with @marmeon/auth that create API tokens, change passwords outside the kit's controllers, or end a user's sessions.
Tokens:
{ abilities, expiresIn }is required.// before tokens.create(user.id, 'CI') // after tokens.create(user.id, 'CI', { abilities: ['users:read'], expiresIn: { days: 90 } })abilities: ['*']allows everything and[]nothing;expiresIn: nullnever expires and0is expired at once. An untyped caller without options gets aTypeErrorbefore anything is written. A customAccessTokenStoretakes the now requiredoptions.Password change:
auth.updatePassword()throws unless the password was confirmed withinAUTH_PASSWORD_TIMEOUT_SECONDS. A route that calls it runscheckPassword(current)first, as the kit does, or sits behindconfirmedPassword().Ending a user's sessions:
AccountSessions.end(userId)andmarmeon auth:end-sessionsnow also revoke the user's API tokens and delete their password-reset link, likeendEveryone(). Keep the tokens withend(userId, { accessTokens: false })or--keep-api-tokens, for an integration that must outlive a sign-out; the result says how many it revoked (accessTokens). The options are an object:end(userId, false)throws aTypeError.Reset links: a changed password deletes the account's reset link inside its transaction, so an older link answers
invalid-token. APasswordResetTokenStoreof your own is asked toforget()the account's address there and when sessions end, as stored and trimmed in lower case (the form the starter kit creates links under); when it fails, the password change fails.AUTH_RESET_MINUTES: 1 to 1440; a larger value such as 10080 stops the start.Session id: a right password in
checkPassword()regenerates the session. Browsers follow on their own. Live streams in other tabs end until the tab navigates, and a request that still carries the old cookie (a double submit, a parallel fetch) is a guest.Tests that hold a session cookie across a right password take the new one from the response:
cookie = (await app.withCookie(S, cookie).post('/confirm-password', …)).cookie(S) ?? cookie;An app that copied the kit's tests takes their updated versions from the kit.
The kit's controllers already pass abilities and an expiry and confirm the password first, so they are unchanged, and so is the reset flow through PasswordBroker.reset(). A stolen remember cookie, a cloned passkey and auth:reset-two-factor end the sessions but keep the API tokens; the clone mail tells the owner to check them. A passkey clone suspended inside an app transaction now stays suspended after a rollback.
Medium: A string from a route is sent as text, and only Html as HTML
Likelihood of impact: medium — apps with routes, controllers or error handlers that return a string.
| Result | Before | Now |
|---|---|---|
| a string | text/html | text/plain; charset=utf-8 |
html`…` or raw(…) | JSON {} | text/html; charset=utf-8 |
Return html`…` from @marmeon/core or this.view() for markup, and drop any String(…) around an html template:
// before
return String(html`…`);
// after
return html`…`;This holds for closures, controller handle(), action requests and error handlers. An Html result gets the CSP header, so ctx.nonce() works in it.
Low: A /0 proxy range stops the start, and development details go only to allowed hosts
Likelihood of impact: low — apps that trust every peer through a /0 range, or develop on a LAN IP or a Compose host name.
SERVER_TRUSTED_PROXIESwith any/0(including/00),::/0, or an IPv6 range that holds all of the IPv4-mapped block (::ffff:0.0.0.0/96,::/80) stops the start. Such a range let every client write its own address intoX-Forwarded-For. Write*if every peer really is your proxy, or list the proxy ranges.- In development, the error page, the exception text of region and island errors, the SSR overlay, the page and island hints and the details of
/up/readygo only tolocalhost, a loopback address or the host ofAPP_URL. Any otherHostgets the plain answer. If you develop on a LAN IP or a Compose host name, setAPP_URLto that host.
Low: A named Redis connection needs a prefix
Likelihood of impact: low — apps with a defineRedisConnection() whose resolve returns prefix: ''.
An empty prefix on a named connection stops the start with the "Invalid configuration" error (K6), as REDIS_PREFIX already did. Give every defineRedisConnection(...) a non-empty prefix in its resolve, e.g. 'notes-app:'. If the connection kept keys without a prefix, move them under the new prefix first: the connection now reads and writes under it. resolve also runs during that check, so keep it free of side effects.
Low: A middleware list that would drop a layer throws
Likelihood of impact: low — apps in plain JavaScript, or with conditional middleware entries.
Each of these throws a TypeError when the routes or groups are defined; the TypeScript signatures are unchanged.
Several layers in one call: chain them.
// before Route.middleware(throttle('x'), authenticate()) // after Route.middleware(throttle('x')).middleware(authenticate())The same for
Route.authorize(a).authorize(b). Chainedauthorize()calls add up, so every check must pass.undefinedor another non-middleware entry in a route or group list, e.g.Route.middleware(flag ? throttle('x') : undefined)or an entry indefineApplication({ middleware: { global: [...] } }): build the list with.filter(Boolean)or chain conditionally.MiddlewareGroups.append()takes a number as its priority.
Low: A binder of your own declares that it scopes
Likelihood of impact: low — apps that use scopedBy with a route binder of their own.
A binder used with bind(…, { scopedBy }) declares static readonly routeBindingScoped = true and reads binding.scope (docs/routing.md › "Your own binder"). Without the mark TypeScript refuses scopedBy, and the app stops with H11 when its routes load. A subclass of Repository keeps the mark; one that overrides resolveRouteBinding passes binding on to super. A scoped binding whose parent is missing from the request answers 404 without calling the binder.
Low: Live validation leaves out every field named like a secret
Likelihood of impact: low — forms that validate card numbers, codes, tokens or similar fields live.
The client no longer sends a field that isSensitiveField knows (passwords, passcodes and passphrases, card numbers and CVCs, one-time codes, tokens, secrets and keys) with a live validation, at any depth. Check such fields when the form is sent.
form.validate('cardNumber'),validating('cardNumber')andvalidate: { fields: ['cardNumber'] }are type errors; drop those names.- The type
PasswordNeverLivefrom@marmeon/http/pageisSensitiveNeverLive.
Low: The deprecated remembered-field patterns are gone
Likelihood of impact: low — apps or client adapters that test field names against the two patterns.
Neither @marmeon/http/client nor @marmeon/http/client/adapter exports SENSITIVE_REMEMBER_FIELD and NEVER_REMEMBERED_FIELD any more.
// before
SENSITIVE_REMEMBER_FIELD.test(name) // or NEVER_REMEMBERED_FIELD.test(name)
// after
isSensitiveRememberField(name)Its second argument lists the fields a form lets in after all, never a password: isSensitiveRememberField(name, ['card_number']). It answers true until loadSensitiveFields() has resolved (docs/forms.md#remembering-input).
Medium: A rate limit takes its numbers by name
Likelihood of impact: medium — apps that call RateLimiter.attempt() themselves, or build a Limit from a number that may be zero or missing.
limiter.attempt(key, 5, 60) becomes limiter.attempt(key, { maxAttempts: 5, decay: 60 }). The two numbers were easy to swap: attempt(key, 60, 5) allowed 60 attempts every 5 seconds instead of 5 a minute, and nothing said so. The old form is a type error, and in JavaScript it throws a TypeError without counting an attempt; so do a maxAttempts that is not a positive finite number and a missing or invalid decay.
The Limit factories (Limit.perSecond(), perMinute(), perHour(), perDay()) throw a TypeError for a count that is not a positive finite number. Such a limit used to be dropped, so Limit.perMinute(Number(env.LOGIN_MAX)) with the variable unset let every request through; it now fails the request instead. Limit.perMinute(0) throws as well. For no limit, use Limit.none().
hit(), tooManyAttempts() and the route middleware throttle() are unchanged. new Limit(…), limit.maxAttempts and limit.decaySeconds are internal: build limits with the factories.
Low: Only the test app turns CSRF protection off
Likelihood of impact: low — code that called CsrfProtection.disable(), tests that run the test app as production, and apps with a csrfExcept pattern that matches every path.
CsrfProtection.disable(), enable() and skips() are no longer API, and disable() throws in a protected environment — any NODE_ENV but development and test, read from the app's environment, not the process's — so a line copied from a test cannot turn the protection off in production. Tests run without it as before, and createTestApp(app, { csrf: true }) keeps it on. A test app that runs as production (env: { NODE_ENV: 'production' }) keeps it on as well, as on a server: a post without a token gets a 419.
A csrfExcept or except() pattern that matches every path (*, /*, **) throws, so a csrfExcept like that stops the start: it turned the check off everywhere. Name the paths that need it (/webhooks/*), or put such routes in a group without CSRF verification. A route that takes signed requests from other sites can use verifyWebhook() instead.
Low: A temporary URL lasts at most seven days on every disk
Likelihood of impact: low — apps that sign temporaryUrl() links for longer than a week, or set UPLOADS_SEND_WITHIN_MINUTES above 1440.
disk.temporaryUrl(key, { expiresIn }) throws a RangeError for more than 7 days on every disk. On S3 such a link failed already, but only in production; on a local disk it was a link that practically never expired. A file that has to stay reachable longer goes through a route of your own that checks access and answers with serveFile(). A disk driver of your own is never asked for more than 604 800 seconds.
The route that serves temporary links of local and memory disks (/_marmeon/storage) refuses one whose expiry lies more than seven days ahead, so links signed for longer before the upgrade answer 403. UPLOADS_SEND_WITHIN_MINUTES above 1440 stops the start, like UPLOADS_LIFETIME_MINUTES.
Low: abilities() needs at least one ability
Likelihood of impact: low — routes that use abilities() without a name.
abilities() without a name checked nothing and let every token through. It is now a type error, and it throws a TypeError when the route is defined, as does an empty name or one that is not a string. A route that every token may call needs no abilities().
Low: Only html and raw() make an Html
Likelihood of impact: low — code that wrote new Html(…) or new Mjml(…).
An Html is sent as text/html, so new Html(markup) was a second way past the escaping of the html template. The constructor is no longer public, and it throws a TypeError at run time too, from JavaScript and from a subclass. Build markup with the html template, and wrap markup you trust with raw() — never a value from a request. Html stays a type, and instanceof Html works as before.
The same holds for Mjml of @marmeon/mail: only the mjml template makes one, so new Mjml(markup) becomes mjml`${raw(markup)}` .
Low: Mails load a web font only from an mj-font of the template
Likelihood of impact: low — apps whose mail templates name Open Sans, Droid Sans, Lato, Roboto or Ubuntu in a font-family without an <mj-font> of their own.
mjml imported these fonts from Google Fonts whenever a template named one, so every opened mail called a third party. fromMjml() turns that list off: such a template now renders in the next font of its stack. To keep the web font, add <mj-font name="…" href="…" /> inside <mj-head>, with a source you may load; it applies to that mail only. Mails of the starter kit need no change: their frame lists system fonts before Roboto.
The way back, for one mail, is its own <mj-font>. See writing mails.
Low: MJML components without an image source of their own are refused
Likelihood of impact: low — apps whose MJML uses mj-social-element, mj-accordion or mj-carousel, or loads an image from a host the template names nowhere else.
mjml fills a missing source of these components with an image from mailjet.com or imgur.com, which every opened mail would then load. fromMjml() refuses such a template with Q7, an MjmlError naming the component, the missing attribute and the host:
mj-social-elementwithoutsrc;mj-accordionwithouticon-wrapped-urlandicon-unwrapped-url;mj-carouselwithoutleft-iconandright-icon.
Set the attribute, on the tag or through mj-attributes (a tag, mj-all or an mj-class), to an image you host. The compiled HTML may also load only from hosts the template itself loads from (an image src, a background-url, an mj-font; a link or text does not count): an image that, for example, a component of your own adds from another host fails with Q7 and its URL, so write that URL into the template. Relative, data: and cid: URLs are fine. The starter kit's mails are unaffected.
There is no way back. See writing mails.
Low: A wildcard in a CSRF exclusion matches within one path segment
Likelihood of impact: low — apps with a * in csrfExcept or in an exclusion a service provider adds.
A * matched across /, so /*/unsubscribe/* also exempted every writing route below a workspace whose slug was unsubscribe. Now * matches within one path segment and ** across segments. Search your modules and service providers for * in their CSRF exclusions:
- A pattern meant for several levels (
/webhooks/*for/webhooks/stripe/events) becomes/webhooks/**; otherwise those requests get 419. - A pattern that does not start with
/, starts with a placeholder (*,/*,/**,/*/unsubscribe/*,/**/x) or has one in its first segment (/webhooks*) stops the start with aTypeError. Write the first segment out, one pattern per locale (/de/abmelden/*,/en/unsubscribe/*).
There is no way back. See excluding paths.
Medium: A table's endpoints hang on its page with endpoints()
Likelihood of impact: medium — apps that call tableRoutes().
tableRoutes() is removed. A table's action, bulk and export endpoints hang on the page that shows it, and run everything that page runs, including the authorize of the page controller's request:
// before
list.get('/', ListMembersController).name('index');
tableRoutes(list.middleware(throttle('members-table')), MembersTable, { export: { middleware: [throttle('members-export')] } });
// after
list.get('/', ListMembersController).name('index').attach(MembersTable.endpoints({
middleware: [throttle('members-table')],
export: { middleware: [throttle('members-export')] },
}));- Attach every table a page shows with
resolve(), also one without actions or exports (.attach(T.endpoints())); otherwiseresolve()fails and names the table and the page. - The endpoints are under the page's path. For a page at the root of its registrar, the URL stays the same.
- Someone who may not see the page can no longer call its export or actions.
- A table has routes only for the kinds it has: one without actions has no action route, one without an export no export route. A request to such a
/_tables/…URL is a 404 for everyone;tableRoutes()registered all three, so a user the table'sauthorizerefused got a 403 there. Nothing a user could do is gone, but a test or a monitor that expects that 403 has to expect the 404.
Medium: The log mailer writes only recipients and subject outside development and tests
Likelihood of impact: medium — apps that read mail links (password reset, verification, signed links) from a production log.
MAIL_DRIVER=log is the default in every environment, and it wrote each mail's whole text to the log, so reset and verification links and their tokens reached production logs. Outside development and tests (production, or no NODE_ENV) the log mailer now writes only each mail's recipients and subject, with a note that the text is left out. Queued mails go through the same transport. Development and tests still log the whole mail.
- An app that has to deliver mails sets
MAIL_DRIVER=smtpwithMAIL_HOST,MAIL_USERNAMEandMAIL_PASSWORD, or uses a transport of its own (docs/drivers.md#mail-transports). - An app that only logged mails changes nothing; the boot warning says that no mail is sent.
There is no option to log the text in production. See the log mailer.
Low: The image of make:docker no longer holds the project's .npmrc
Likelihood of impact: low — apps that keep a registry token in .npmrc and build their image with a Dockerfile from make:docker.
A Dockerfile from make:docker copied the project's .npmrc into the image, so a registry token in it (//npm.pkg.github.com/:_authToken=…) was readable by anyone who could pull the image. A new Dockerfile deletes every .npmrc before the run stage and takes the credential as a BuildKit secret.
- Run
marmeon make:docker --forceagain, or copy the secret mounts and the.npmrccleanup at the end of the last build-stageRUNfrom a newly generated Dockerfile. - Remove the auth line from the project's
.npmrcand pass the credential withdocker build --secret id=npmrc,src=$HOME/.npmrc. - Rotate every token that was in a pushed image or a pushed build cache.
See a private registry.
Spans of time
Medium: Spans of time are seconds or a Duration, and values handed back name their unit
Likelihood of impact: high — apps that write a span of time as a string such as '7d', apps with their own health or app checks, once() props, job middleware or scheduler overlap locks, and code that reads the auth, session, queue or uploads config, a queue event's delay, a cache entry's TTL or a limiter.
A bare number is seconds; anything else is a Duration such as { minutes: 5 } (docs/time.md). A value the framework hands back names its unit. The environment variables (AUTH_RESET_MINUTES …), the worker flags --sleep, --max-time and --stop-timeout, and the stored records keep their names and units.
Strings are gone:
'7d'becomes{ days: 7 }and'60m'becomes{ minutes: 60 }: in signed links, in theexpiresInof API tokens and verification links, and wherever else a span was a string. A string is a type error, and untyped code gets aTypeErrorthat names the object to write.- Import
Durationfrom@marmeon/core;@marmeon/httpno longer exports it. The object form is the typeDurationParts. - An expiry is rounded down to a whole second; a temporary storage URL used to round up. A storage
expiresInunder one second is aRangeError. - A
Temporal.Durationwithyears,months,weeks,microsecondsornanosecondsis refused; it used to count as zero.
Three numbers that keep compiling and change their meaning:
A
static timeoutof a health check or an app check (marmeon check) is seconds, not milliseconds. Check every one, small values included:100, meant as 100 ms, now waits 100 seconds.// before static timeout = 5000; // after static timeout = 5; // or { milliseconds: 5000 }A health check allows up to 60 s and an app check up to 600 s; over that, at zero or below, the start stops with K13, naming the check class.
once(fn, { ttl })in milliseconds isonce(fn, { for }), aDuration, and a number inforis seconds:for: 60_000would mean about 16.7 hours.// before once(fn, { ttl: 60_000 }) // after once(fn, { for: { minutes: 1 } }) // or { for: 60 }An old
ttlkey throws aTypeErrornaming the new form.In tests, the timeout of
LiveStreamReader.hello()andwaitFor()is aDuration:stream.waitFor(n, 3000), meant as 3 s, now waits 3000 seconds. Write{ seconds: 3 }or3.
Core and router:
DEFAULT_HEALTH_TIMEOUTis no longer exported: write2or{ seconds: 2 }.- The
lockandwaitofRoute.block({ lock, wait })areDurations, and zero or a negative span throws aTypeError(block()). CookieOptions.maxAgeand a queued listener'sbackoffalso take aDuration(the backoff a list of them); nothing to change.HealthCheckResult.ms,/up/readyandcheck --jsonkeep milliseconds.
HTTP and server:
createHttpKernel(app, { islandTimeout: 5000 })becomes{ islandTimeoutMs: 5000 }; an oldislandTimeoutkey throws.securityHeaders({ hsts: { maxAge: 31_536_000 } })keeps working, andmaxAge: { days: 365 }works too: whole seconds, and at least a year withpreload.
Queue, notifications and cache:
retryAfterisretryAfterSeconds: on a connection of the queue config, in theQueueConnectiona driver factory returns, in the options of the memory, database and redis drivers, and inJobMiddlewareContextand theQueueConnectionOptionsofQueueConnections.options().QUEUE_*_RETRY_AFTER_SECONDSis unchanged, and the docs anchor isqueues.md#timeouts-and-retryafterseconds.JobQueued.delayandJobReleased.delayaredelaySeconds, as is thedelayof the entries ofapp.queue.dispatched()and of thequeue.dispatchdiagnostics message. A queue driver of your own readsdelaySecondsinQueuedPush(thenextentries ofack(job, next)).- A job middleware reads
context.timeoutSeconds; readingcontext.timeoutthrows. cache.ttl(key)becomescache.ttlSeconds(key), andlimiter.availableIn(key)becomeslimiter.availableInSeconds(key); the old names are gone.- The cache's
ttl,lock()andLock.block()take aDuration; numbers keep meaning seconds. ALimitwindow that is not a whole number of seconds (Limit.perSecond(5, 0.5)), or zero or below (Limit.perSecond(5, 0),Limit.perMinute(5, 0)), is aRangeError;Limit.none()is unchanged. A count that is not a positive number throws as well (rate limit). - A
Durationis taken by a job'stimeoutandbackoff,job.once(key, fn, { for }),withoutOverlapping({ releaseAfter, expiresAfter }), theWorkOptionssleep,maxTime,stopTimeoutandwatchOtherQueues,worker(connection, stopTimeout)and a notification'sbackoff. - A worker started with a span that is not finite or below 0 (or
'5s'from untyped code) stops with aQueueErrorat once, before it claims a job.
Storage:
UploadsConfig.lifetimeandsendWithinarelifetimeMinutesandsendWithinMinutes; the environment variables are unchanged.- A disk driver of your own (
static diskDrivers): the factory returns aDiskDriver, and itstemporaryUrl(key, options)receives{ expiresInSeconds, filename?, base? }, whole seconds of at least 1, instead ofexpiresIn. The app-facingdisk.temporaryUrl(key, { expiresIn })still takes aDuration.
Scheduler:
.withoutOverlapping(30)(minutes) becomes.withoutOverlapping({ expiresAfter: { minutes: 30 } }). The old form is a type error, and untyped code gets aTypeErrornaming the new form. The default stays 24 hours.
Auth and session:
| Before | After |
|---|---|
AuthConfig.passwordTimeout (seconds) | passwordTimeoutSeconds |
AuthConfig.resetExpire (minutes) | resetMinutes |
AuthConfig.resetThrottle (seconds) | resetThrottleSeconds |
AuthConfig.emailChangeThrottle (seconds) | emailChangeThrottleSeconds |
SessionConfig.lifetime (minutes) | lifetimeMinutes |
confirmedPassword({ seconds: 60 }) | confirmedPassword({ maxAge: 60 }) or { maxAge: { minutes: 1 } } |
TWO_FACTOR_MAX_AGE | no longer exported; write { hours: 24 } |
error.retryAfter of a throttled failure | error.retryAfterSeconds |
- Reading an old config key throws a
TypeErrornaming the new one, andconfirmedPassword({ seconds })is refused. twoFactor({ maxAge })takes aDurationtoo; a number still means seconds, and the default stays 24 hours.- A
throttledfailure comes fromattempt(), two-factor, passkeys and password checks. An app that copied the kit's auth controllers renames the field there. - Every window keeps its value.
Medium: The client's spans of time name their unit, in milliseconds
Likelihood of impact: medium — apps on @marmeon/react that set prefetch, progress, pending, debounce or poll times.
Rename the options; the values stay milliseconds, and TypeScript reports every place that still uses an old name.
| Before | After | Where |
|---|---|---|
cacheFor | cacheForMs | <Link>, router.prefetch(), PrefetchOptions |
delay | delayMs | progressBar(), showProgress() (ProgressOptions) |
delay: 300 | delayMs: 300 | usePending(); delay: 'short' stays |
debounce | debounceMs | useQueryState() (QueryStateOptions), the validate option of useForm() and <Form> (LiveValidationOptions) |
searchDebounce | searchDebounceMs | useTable() (TableControllerOptions) |
poll | pollMs | <Island> |
HOVER_PREFETCH_DELAY | HOVER_PREFETCH_DELAY_MS | @marmeon/http/client/adapter |
usePoll and createPoll take their interval in the options:
// before
usePoll(15_000, reloadOptions, { keepAlive });
createPoll(run, 1000, options);
// after
usePoll({ intervalMs: 15_000, keepAlive }, reloadOptions);
createPoll(run, { intervalMs: 1000, ...options });The old form is a type error and throws a TypeError naming { intervalMs }. An interval that is not finite, not above 0 or above 2 147 483 647 ms throws C5, in usePoll on the server too.
Data and the queue
High: The generated table types declare primary keys
Likelihood of impact: high — every app with @marmeon/database.
bootstrap/database.d.ts is format 3: it fills a new PrimaryKeys interface with the primary key of every table, and a repository takes its key from the schema instead of a column named id. A json() column is written as JsonColumn<'table.column'>, which reads as Json unless the app declares a type for that key (below).
Run
marmeon db:typesonce and commitbootstrap/database.d.ts;marmeon db:types --checkfails with "generated by another version" until then.Replace
KeyOf<'table'>withPrimaryKeyOf<'table'>.A table you type by hand declares its key, or
find()and the other methods that take a key refuse it in the types:declare module '@marmeon/database' { interface PrimaryKeys { orders: 'id' } }A table without a single-column primary key makes
find(),findOrFail(),exists(),update(),tryUpdate(),delete(),forceDelete(),restore(),relation(),chunk()and the route binding throw aTypeError; there is no fallback toid. Usequery()for such a table.A table that raw SQL (
schema.raw()) created is unknown to a managed connection, so its repository has no key: create the table withschema.create(), or usequery().A route binding checks the value against the key column first: digits for an integer, a UUID for a
uuid, at most 255 characters for anything else; any other value answers 404. A key of a timestamp, boolean, JSON or decimal column needs astatic routeKeyPatternon its repository, and so does a text key longer than 255 characters.A scoped route binding compares with the column the foreign key references, and a scope column that is no foreign key is a
TypeError.A
json()column can carry the type of its value. Declare it once andRow<…>,selectandfind()read the column as that type instead ofJson; a declared type that is not JSON (aDate, a class, a function,bigint,unknown) reads as a message that names the key, and an open part is typed asJson. The type is a promise: nothing checks the shape of a value on read, and writes still take a string (JSON.stringify). Nothing changes for a column without a declaration. See a JSON column's type.declare module '@marmeon/database' { interface JsonTypes { 'surveys.options': readonly string[] } }
Low: Postgres connections time out after 10 seconds and keep UTC
Likelihood of impact: low — apps whose Postgres server is slow to accept a connection, or that set TimeZone through ?options=.
- The pool and the migration lock give up connecting after 10 s with D11. If the server needs longer, e.g. a paused serverless database, set
?connect_timeout=<seconds>inDB_URL: whole seconds from 0 to 2147483, and0waits without a limit, as before. Any other value stops the start, naming it. - A full pool that cannot hand out a connection in that time fails with D11 "no free connection; raise
DB_POOL_MAXor shorten transactions". - A
DB_URLwith its own?options=keeps them, and UTC is set after them, so aTimeZoneamong them is replaced by UTC.
Low: queue.using(trx) follows its own transaction, and a stopped job keeps its attempt
Likelihood of impact: low — apps that dispatch through queue.using(trx) or listen to JobQueued.
- Dispatch a
syncor unique job throughqueue.using(trx)only with thetrxthatconnections.transaction()hands you. With a transaction you began yourself (db.transaction(),db.startTransaction(), a second connection) or a derived handle (trx.withSchema()), such a dispatch throwsQueueError, inQueueand inQueueFake. - A listener on
JobQueuedruns after the commit, and not for a transaction you began yourself. - A job cut off by a worker stop (past
--stop-timeout) goes back without counting its attempt, so it no longer lands infailed_jobs. A worker killed outright or a job that times out still counts it.
Low: A transaction takes one of three isolation levels
Likelihood of impact: low — apps that pass isolationLevel: 'snapshot' or 'read uncommitted'.
TransactionOptions.isolationLevel takes the exported IsolationLevel: 'read committed', 'repeatable read' or 'serializable'. Anything else is a type error and throws a TypeError before the transaction begins.
Low: A lock that waits returns a Result
Likelihood of impact: low — apps that call lock.block().
lock.block(wait, callback) returns ok(result), or err({ kind: 'timeout' }) without calling the callback, like lock.get(callback) returns err({ kind: 'locked' }). LockTimeoutError is gone. Returned from a transaction() callback, timeout rolls the transaction back.
block() always takes the callback now, and throws a TypeError without one: the protected code never runs without the lock. To hold a lock without a callback, take it with get() and release it yourself.
// before
const report = await cache.lock('report', 60).block(5, () => this.#reports.build());
// after
const report = await cache.lock('report', 60).block(5, () => this.#reports.build());
if (!report.ok) abort(423);Low: Queue sizes and unique jobs in tests name what they mean
Likelihood of impact: low — apps that count a queue on another connection, or assert on unique jobs in tests.
queue.size(name, connection)becomesqueue.size(name, { connection }).queue.size('redis')counted the queue namedredis; a second string is now a type error and throws.- In tests, the
uniqueof a dispatched job readsforSecondsinstead offor(typeDispatchedUniqueof@marmeon/queue/testing).
Low: The where of unique() and exists() is typed by the repository's query
Likelihood of impact: low — apps that pass where to unique() or exists().
The where callback gets the repository's own query type instead of any. A wrong column name, a value of another type, or a callback that does not return the query (an async one, one without return) is a compile error. Fix the column or the value, or run marmeon db:types if the column is new. ctx stays any unless you annotate it with the context the request has, such as ctx: HttpContext<Authenticated, { workspace: Row<'workspaces'> }>, which then also checks ctx.params. Run-time behaviour does not change.
There is no way back. See database rules.
Low: Equal live hints of one transaction go out once
Likelihood of impact: low — apps that call broadcast.refresh() per row inside a transaction, and their tests that count hints.
Inside a transaction, refresh() registers its hint on the outermost transaction, and after the commit equal hints go out once: the same channel, the same only in any order, leaving out the same tab. A hint from a savepoint that rolled back is dropped; outside a transaction every hint goes out at once, as before. The channel's sequence rises once per transaction, so an open tab reloads once. A test that expected n hints for n rows changed in one transaction expects one, in assertRefreshed({ times: n }), app.live(path).waitFor(n) and app.broadcast.refreshed(channel).
There is no way back. See sending hints.
Medium: A Redis queue name must not collide with the keys of another queue
Likelihood of impact: low — apps on the Redis queue driver with a queue whose name ends in :delayed or :reserved.
On the Redis driver, a queue named a:delayed used the key queues:a:delayed as its list, which is queue a's delayed set; the same held for :reserved. A push or a reserve failed with WRONGTYPE or mixed the jobs of two queues. The driver now refuses such a name before any Redis call, in push, reserve, size, counts, ack, release and fail, with a message that names the queue, the suffix and the queue it would collide with. a:delayed:x and delayed stay allowed; the database and memory drivers are unaffected.
- A default queue with such a name (
QUEUE_REDIS_QUEUE) stops the app at the start with Q4. - A refused name that is already in the queue registry is no longer listed or taken, so jobs queued under it are not worked.
queue:size, the devtools page and the worker's look at other queues keep working. - Rename the queue, then move its jobs with the workers stopped:
- Pick a name no queue uses yet. Move
<prefix>queues:x:delayedto<prefix>queues:x-delayedwithRENAMENX, and do the same for its:delayedand:reservedkeys if they exist.RENAMENXrefuses an existing target;RENAMEwould overwrite it and lose its jobs. CheckTYPE <prefix>queues:x:delayedfirst: only alistbelongs tox:delayed; azsetis queuex's delayed set and stays. - Run
SREM <prefix>queues x:delayedandSADD <prefix>queues x-delayed.
- Pick a name no queue uses yet. Move
There is no way back. See the queue drivers.
Configuration and drivers
Medium: A size in an environment variable names its unit
Likelihood of impact: medium — apps that set SERVER_MAX_BODY_SIZE, MAX_BODY_SIZE or HASH_ARGON_MEMORY, or pass maxBodySize.
An old name that is still set stops the start and names the new one, with the conversion. Check .env, .env.test, the deployment settings and CI.
| Before | After | Value |
|---|---|---|
SERVER_MAX_BODY_SIZE=8m, MAX_BODY_SIZE | SERVER_MAX_BODY_MB=8 | whole MiB, 1 to 1024 |
HASH_ARGON_MEMORY | HASH_ARGON_MEMORY_KB | KiB, unchanged |
createHttpKernel(app, { maxBodySize }) | createHttpKernel(app, { maxBodyBytes }) | bytes |
ServerConfig.maxBodySize | ServerConfig.maxBodyBytes | bytes |
DEFAULT_MAX_BODY_SIZE (@marmeon/router) | no longer exported; the default stays 8 MB |
Divide a value in bytes by 1,048,576; it must come out as a whole number. A limit under 1 MB, or one that is no whole number of MB, goes through createHttpKernel(app, { maxBodyBytes }).
Low: A mail transport of your own returns the provider's message id
Likelihood of impact: low — apps with a mail transport or a Mailer of their own, or code that reads MailConfig.
- A transport's
send()resolves with aMailReceipt,{ messageId }, wheremessageIdisundefinedwhen the provider gives none. It may have aclose(). - A class that implements
Mailerresolvessend()with aSentMail: the composed message and itsmessageId. MailConfig.mailerisMailConfig.driver, and the boot warnings of the log mailer carry the log context keydriver.- A provider can bring a transport with
static mailDrivers = { name: factory }andMAIL_DRIVER=name; bindingMailTransportin the container still works. AMAIL_DRIVERthat no provider brought stops the start with Q8 and lists the known names.
Low: The Vite plugin has no pages and lang options
Likelihood of impact: low — apps that pass pages or lang to marmeon() in vite.config.ts.
Remove both options; passing either throws a TypeError. Views live in modules/<module>/views/ (.tsx), language files in lang/ and modules/<module>/lang/. A custom glob only half worked before: the route types and the server's translator read the default places.
Low: createPinoLogger() takes its destination and app as options
Likelihood of impact: low — apps that build their own pino logger.
createPinoLogger(config, stream, app) is createPinoLogger(config, { destination: stream, app }). A stream as the second argument, or a third argument, throws a TypeError.
Low: The kernel's asset version is assetVersion
Likelihood of impact: low — apps that pass version to createHttpKernel().
createHttpKernel(app, { version }) is createHttpKernel(app, { assetVersion }), the name of ServerConfig.assetVersion and SERVER_ASSET_VERSION. The old key throws a TypeError.
Low: Vite's base is / or an absolute URL, and the server links a page's chunks under it
Likelihood of impact: low — apps that set base in their Vite config.
The server serves the build under / only, so a path base (/static/) or a relative one (./) never worked without a proxy. marmeon build now refuses both when Vite resolves its config, and a build made earlier with such a base stops marmeon start, with the value named. An absolute http(s) URL that ends in / and carries no credentials, query or fragment is accepted; the server then prefixes every modulepreload and page stylesheet with it, where it used to link them as /assets/… on its own origin, which answered 404 when the assets lived elsewhere.
- Build with
base: '/'(the default) or with the absolute URL where the assets are hosted. Apps that leavebasealone change nothing. - A CDN base: the CDN has to send
Access-Control-Allow-Origin, because every tag iscrossorigin; and a policy without the nonce needs the origin inscript-srcandstyle-src.
There is no way back. See the base.
Low: A session codec of your own has no encrypts
Likelihood of impact: low — apps that bind a SessionCodec of their own.
SessionCodec is seal() and open(); encrypts is gone, and nothing read it. Remove it from your codec: an object typed as SessionCodec with encrypts no longer compiles.
// before
const codec: SessionCodec = { encrypts: true, seal, open };
// after
const codec: SessionCodec = { seal, open };Routes and pages
Low: A route pattern reads the same everywhere, or the start stops
Likelihood of impact: low — apps with unusual route patterns.
A pattern that the server, links, the bind check and the sitemap could read differently stops the app with H13, which names the pattern:
- a parameter name is letters, digits and
_, starting with a letter or_(:user_id, not:user-id); - a parameter fills a whole segment (not
/a/:x{[a-z]+}.json); - only the last parameter may be optional (not
/a/:x?/b); - a name may not repeat in one pattern;
- a constraint must be closed and may not name a group.
ExtractParams reads a parameter only after / or at the start of the path, so /files/v:version gives no key, as at run time.
Low: A file in a list, a union or an optional object stops the start
Likelihood of impact: low — apps with an upload() field that is not a field of its own.
A body schema with upload() inside a list (r.array, r.list), a union, a field added with .when(), or an optional, nullable or defaulted object at any depth stops the start with S2, naming the field. Such a schema never worked: the submit answered "invalid" without saying why. Give each file a field of its own, in the body or in an object that is always there; upload(…).optional() and .nullable() on the field stay allowed. A schema built by a factory is checked at its first submit instead, and answered with a 500.
Low: twitter.image takes the shape of openGraph.image
Likelihood of impact: low — pages that set twitter.imageAlt.
// before
twitter: { image: '/card.png', imageAlt: 'A card' }
// after
twitter: { image: { url: '/card.png', alt: 'A card' } }A plain twitter: { image: '/card.png' } keeps working. twitter:image:alt is written only next to an image that survives URL resolution, and a relative URL resolves against the origin of APP_URL.
Low: Head keeps its server tags when the page hydrates
Likelihood of impact: low — tests that assert the head marker, default layouts with an error that is no component, and path-relative head URLs.
- A test that asserts
data-marmeon-head="ssr"on a child tag of<Head>now seesssr-tag; the title and the head fields keepssr. - A default layout whose
erroris not a component fails on every page with R19, like a page's own layout. Such an app was already broken on its first error. - A path-relative head URL (e.g.
canonical="notes/1") resolves against the origin ofAPP_URL, not its path. Root-relative values such as/de/xare unchanged. - An element that
<Head>creates gets only primitive props, neveron*, objects or functions. Script and style get the page's nonce; their ownnonceprop is ignored.
Low: Once props are scoped by the page's language
Likelihood of impact: low — apps that copied the auth kit's tests.
The browser keeps a page's once props per session and language, so a switch from /de/… to /en/… sends them again. An app's code changes nothing. An app that copied the kit's tests keeps an old test in modules/auth/auth.test.ts ("the app name in the layout … comes with the first page only") that now fails: take the current version from the kit (marmeon make:auth --force for the test file, or copy it).
Low: block() on a route takes lock and wait by name
Likelihood of impact: low — routes that pass arguments to .block().
.block(5, { seconds: 2 }) becomes .block({ lock: 5, wait: { seconds: 2 } }): two spans of time side by side were easy to swap. .block() without arguments is unchanged, and so are the defaults (lock 10 seconds, wait as long as lock). A number as the first argument, a key it does not know, or a second argument throws a TypeError.
Low: Flash data is put with session.flashData()
Likelihood of impact: low — apps that call session.flash().
session.flash(key, value) is session.flashData(key, value). "Flash" now always means the message that redirect().flash() sends and useFlash() shows; flash data is read with session.get() on the next request, like redirect().with(). There is no alias, so TypeScript points at every call.
Low: WhenVisible takes reload, and resolveRoute() takes options
Likelihood of impact: low — pages that pass params to <WhenVisible>, and client adapters of your own.
<WhenVisible params={{ only: ['stats'] }}>is<WhenVisible reload={{ only: ['stats'] }}>. On every other componentparamsare route parameters.paramson<WhenVisible>throws aTypeErrornamingreload.- For client adapters:
resolveRoute(manifest, name, params, query, { locale })isresolveRoute(manifest, name, { params, query, pageLocale }). More arguments, or a key it does not know, throw aTypeError.Navigator.cachedPagesis internal.
Low: The error pages and the layer backdrop live in the system module
Likelihood of impact: low — apps with their own error page (modules/errors/views/) or layer backdrop (modules/layers/views/Backdrop.tsx).
Move modules/errors/views/ to modules/system/views/errors/ and modules/layers/views/Backdrop.tsx to modules/system/views/layers/Backdrop.tsx, then run marmeon route:types. The views are named system/errors/Error, system/errors/<status> and system/layers/Backdrop: a test that asserts assertPage('errors/Error') asserts system/errors/Error, and a layout(name) that compares names gets the new ones. Until the files are moved, marmeon dev, build, route:types and check stop with K14 and name the new path.
Low: A binder's context is typed by the state of its route
Likelihood of impact: low — apps with a route binder of their own that reads ctx, and code that calls resolveRouteBinding() itself.
RouteBindingContext<State> types ctx by the state the binder needs; without the argument it carries no state, where it was any.
- A binder that reads
ctx.user, or anything else a middleware adds, declares it:resolveRouteBinding(value: string, { ctx }: RouteBindingContext<Authenticated>).bind()then compiles only on a route behindauthenticate(), and the message names the missing keys. - Code that calls
resolveRouteBinding()itself passes a context whoseparamsare the raw strings, or usesfindByRouteKey(value).findByRouteKey()hands the binder a context that throws aTypeErrornaming the repository when read. - Binders that read only
scope,with,requestorparamsare unaffected.
There is no way back. See your own binder.
Low: A form's field for a boolean rule is a boolean
Likelihood of impact: low — pages whose form has a field of r.boolean() or r.accepted() and set it to something other than true or false, compare it with 'on', or cast it.
In a form typed from its controller (useForm('route', …), useForm<Controller>(), FormHandle, FormPart) a field whose rule is r.boolean() or r.accepted() holds a boolean, also inside an object or a list; with .optional() or .default() it is boolean | undefined. The same holds for such a field in the data of useAction().submit(), and PendingSubmission.input types it boolean. A checkbox needs no cast: checked={form.data.agree} and form.set('agree', event.target.checked).
- Code that sets such a field to
'on','1',1or another spelled-out value, inform.set(),setData()or the initial data, or casts it to the rule's input type, no longer compiles: settrueorfalse. - A check like
form.data.agree === 'on'becomesform.data.agree. - A form typed directly (
useForm<{ agree: BooleanInput }>()) keeps its type.
Requests do not change: the rules still take 'on', '0' and '1' from a form posted without JavaScript.
There is no way back. See fields and errors.
Medium: A route form types number fields as numbers and defaulted fields as present
Likelihood of impact: medium — every useForm() form that has a number rule or a .default() field.
form.data.count was number | \${number}`, and a field with .default()was optional inform.dataandinitial`. Now:
- A number rule's field is
number. Where the field may be missing (optional, nullable or defaulted), it also takes''for an empty input. - A defaulted field is required in
form.dataandinitial, inside objects, lists and union members too. - A pending submission's
inputis what was sent: an action's data as passed, or a route form's fields. useAction()bodies are unchanged.FormOutputOf<C>andActionFieldsare exported.
What an app does: set numbers (e.target.valueAsNumber), or '' for an empty optional field; add every defaulted field to initial, and drop ?? [] fallbacks. In an app from the starter kit, both two-factor forms need { code: '', recovery_code: '' }. pnpm typecheck lists each place. There is no way back.
Low: A later .when() sees the fields of the .when()s before it
Likelihood of impact: low — schemas that put a condition on a conditional field.
A condition on a field that an earlier .when() adds never held, so its fields were neither checked nor in the body. Now a later .when() sees the fields of the ones before it, and its fields are checked and kept. Send the fields the form shows, or change the condition. There is no way back.
Low: A standalone describeAccess() check sees HttpContext, not any
Likelihood of impact: low — checks written apart from their route that read params or middleware state.
describeAccess((ctx) => …, label) outside .authorize() gave ctx: any, so a typo in ctx.params compiled. Such a check now sees HttpContext, and it must return boolean or Promise<boolean>. A check written inside .authorize() keeps the route's bound context. Write the check inside .authorize() after the .bind() it reads, annotate ctx (HttpContext<Authenticated, { ticket: Ticket }>), or pass the type argument. There is no way back.
Low: An island request reaches only a controller that returns island()
Likelihood of impact: low — islands built outside a controller method, module packages with island controllers, and tests that stand in for an island.
A request with the island header used to reach any route, run its middleware, and only then learn whether the handler returned an island. Now the loader marks the controllers whose own methods call this.island(…) or island(…) imported from @marmeon/http, in development, in Vitest and, through .marmeon/injections.json, in production. An island request to any other route answers 404 before a middleware runs, and a marked route answers a page request with 404 after the global middleware.
- A closure route or a helper outside the controller that returns
island(): write it as a controller class that callsthis.island(…)in one of its methods. islandimported through a module of the app that re-exports it: import it from@marmeon/httpin the controller's own file, or callthis.island().- A module package that ships island controllers: rebuild it with
marmeon package:buildfrom this version; a package built before answers 404 for its islands. - A controller that returns a page or an island depending on a branch: split it into two routes.
- Tests: a fixture that stands in for an island needs such a controller too; a test that expected a login redirect on a direct call of an island URL expects 404.
marmeon route:list shows island routes. There is no way back.
Low: A resolver you pass to the router takes a class or a token
Likelihood of impact: low — code that passes its own resolve to validate(), new Router() or dispatch().
A route's checks (authorize, afterAuthorize, describeAccess) and its hooks can now resolve a token, not only a class: resolve(Clock) or resolve(Translator) works where only resolve(SomeClass) did. A hook can read session.readOnly to tell whether the request may change the session, and runs after the locale is set, so a hook after RequestLocale.use() already speaks the new language (after the checks).
An app that uses the defaults has nothing to do. A resolver you pass yourself, to validate(schema, value, { resolve }), new Router({ resolve }) or dispatch(…, { resolve }), is now typed <T>(key: Constructor<T> | Token<T>) => T:
// before
resolve: (Class) => new Class()
// after
resolve: (key) => container.make(key)A resolver typed for classes only does not compile any more; otherwise check typeof key === 'function' before new key(). Outside an app, the default resolver refuses a token with a TypeError that names it.
There is no way back.
Low: A table's filters and its actions' answers are typed by name and by handler
Likelihood of impact: low — pages that type a run() or runBulk() callback with the bare TableRunOutcome, or a table's data by hand.
table.filter('status') reads the filter status of the props as its definition made it (a select with options, a date range, a has filter); a name the table does not define is a type error. run() and runBulk() type outcome.data.data as what the action's handler returns, serialized (a Date becomes a string). A handler that answers with json(body) types outcome.data as that body, without counts; a Response handler gives unknown; a redirect-only handler has no data outcome at all.
A callback typed with the bare
TableRunOutcomeno longer accepts the outcome of an action whose handler returnsjson()or aResponse. Let the run type it, or widen it on purpose:// before — no longer compiles for such an action table.run('report', row).then((outcome: TableRunOutcome) => …); // after table.run('report', row).then((outcome) => …); const report = (outcome: TableRunOutcome<any, any, boolean>) => …;A value typed by hand as
TableData<Row, …>no longer fitsTableProps<typeof SomeTable>for a table with actions or filters: type it asTableProps<typeof SomeTable>.A cast such as
outcome.data.data as { at: Date }fails, because the date arrives as a string.
A hand-written TableFilter<'a' | 'b'> still fits, useTable() call sites do not change, and a bare TableRunOutcome is the same type as before. There is no way back.
Low: IslandElementProps is a union of route and href
Likelihood of impact: low — components that are typed with IslandElementProps.
<Island href={…}> embeds an island whose URL the server chooses, so a page can render the panels a user may see without knowing every panel's route (islands the server chooses). IslandElementProps is therefore a union of the route form and the href form. A component typed (props: IslandElementProps<N>) narrows before it reads props.route; href is the other member. Omit<IslandElementProps, …> no longer distributes over the members. Apps that only use <Island route> change nothing.
There is no way back.
Medium: An island rendered with its page sees cookies only while the page is private
Likelihood of impact: medium — apps with islands on pages outside the session group, or on a guest's page, that read a cookie or the session.
An <Island route> on a page without StartSession was resolved in-process with the visitor's cookie header. When the island's route started the session, it loaded the visitor's own, although the page had gone out as public with the shell: a cache could keep a signed-in visitor's data and serve it to everyone. The server now decides before it runs the island:
- An island whose route starts the session, on a page that started none, loads in the browser: the server renders its
fallback, and the island appears after hydration with the visitor's own session. Nothing runs twice. - The
cookieheader reaches an island rendered with its page only while the page is private: for a visitor whose session the store already keeps (a signed-in one, or a guest whose session holds data). On pages withoutStartSession, on a guest's page in the session group, and in apps without@marmeon/session, the island sees no cookies. - In development, a warning names the page route and the island route once.
Pass what such an island reads from a cookie as page props, or let it load in the browser; to render a session island on the server, put its page in the session group. Check tests that expect server-rendered content from session islands on such pages.
There is no way back. See how islands load.
Low: A table's authorize must return true
Likelihood of impact: low — tables whose authorize returns something other than a boolean.
A table's own authorize was tested for truthiness, so an untyped check that returned a Response, an object, 1 or a non-empty string let the request through; the boolean type stopped it only at compile time. The page, the row actions, the bulk actions and the exports now let a request through only when the awaited check is true. Any other value answers 403, like false; a check that throws (can() with 403 or 404) still propagates. An authorize that returns a boolean changes nothing.
Renamed exports
Low: Names that two packages exported have names of their own
Likelihood of impact: medium — apps that import one of the names below; TypeScript reports each.
Rename the imports and type positions; there are no aliases.
| Before | After | Package |
|---|---|---|
RequestInfo (type and token) | ClientInfo | @marmeon/http |
NO_REQUEST_INFO | no longer exported; write { ip: undefined, userAgent: undefined } | @marmeon/http |
RequestInfo, JobInfo, TaskInfo | CurrentRequest, CurrentJob, CurrentTask | @marmeon/core |
ActionException, VisitException | ActionError, VisitError | @marmeon/http/client, /client/adapter, @marmeon/react |
Router, Action (the types of useRouter() and useAction()) | ClientRouter, ClientAction | @marmeon/react |
KeyOf, ParamsOf, CheckKey | MessageKeyOf, MessageParamsOf, CheckMessageKey | @marmeon/i18n, @marmeon/i18n/messages |
Invokable, InvokableClass | CallableTask, CallableTaskClass | @marmeon/scheduler |
Entry | CacheEntry | @marmeon/cache |
ServeOptions | ServeFileOptions | @marmeon/storage |
ColumnOf | RepositoryColumnOf | @marmeon/validation |
PasskeyConfigError | PasskeySetupError | @marmeon/auth/passkeys |
ActionError and VisitError are types, not classes, so there is no instanceof to change.
Low: PostgresConnection is PostgresConnectionOptions
Likelihood of impact: low — apps that import the type of a Postgres connection's options.
The options of a Postgres connection (driver: 'pgsql', url, host …) are PostgresConnectionOptions, like RedisConnectionOptions and QueueConnectionOptions. Connection stays the connection itself. There is no alias.
Packages that left experimental
Low: The data tables have names of their own
Likelihood of impact: low — apps with @marmeon/table, @marmeon/react/table or @marmeon/react/table-tanstack.
| Before | After |
|---|---|
Table (what defineTable() returns) | DataTable |
Tables (the injected service) | DataTables |
RowOfTable | DataTableRow |
RowOf of @marmeon/react/table and @marmeon/table/client | TableRowOf |
Column | ColumnDefinition |
CheckKey | CheckColumnKey |
VisibilityCheck | TableVisibilityCheck |
- The
RowOfhelper of@marmeon/tableis no longer exported: read a row withDataTableRow<typeof MembersTable>.KeyNameandVisibilityare no longer exported either. - The constructor of
DataTablesis internal: take the service by injection.
Low: @marmeon/live names the units of its config and its test reader
Likelihood of impact: low — apps that read LiveConfig or test live updates.
LiveConfig.heartbeatandretryareheartbeatSecondsandretryMs; the environment variables are unchanged.- In tests,
BroadcastRecorderisBroadcastTester, andstream.retryof aLiveStreamReaderisstream.retryMs. The timeout ofhello()is aDuration, so a number is seconds (spans of time).stream.waitFor(until, timeout, what)becomesstream.waitFor(until, { timeout, what }), withtimeoutaDuration;waitFor(1)is unchanged. The constructor ofLiveStreamReaderis internal. LiveBackendandLiveMessageare no longer exported; they have no replacement.
Low: @marmeon/devtools has names of its own
Likelihood of impact: low — apps that import from @marmeon/devtools or read its entries.
DevtoolsConfigErrorisDevtoolsSetupError.- Each content type is named after its entry:
MailContentisMailEntryContent,RequestContentisRequestEntryContent, and so on; the embeddedErrorContentisErrorDetails. The keys of the entries ('mail','exception'…) stay. FileStoreandFileStoreOptionsareFileDevtoolsStoreandFileDevtoolsStoreOptions.MemoryStoreis no longer exported: type a variableDevtoolsStore.- A reader of job entries reads
content.delaySecondsinstead ofcontent.delay. DevtoolsTesteris exported as a type only (import type);createTestApp()makes it, andapp.devtoolsstays.- Entries written before the upgrade may show incompletely;
marmeon devtools:clearempties them.
Low: The client adapter API is stable and smaller
Likelihood of impact: low — client adapters of your own; apps on @marmeon/react change nothing.
pageQuery(page)ispageQueryOf(page).@marmeon/http/client/adapterno longer exportsloadLiveValidation,loadPrefetch,loadViewTransitions,withoutDefaults,mergePageandResetProps. For the two remembered-field patterns, see the remembered-field patterns.defineFeature,Feature.setup,FeatureHost,slot/Slot,LayerHost, the members ofLayerStackbutlist, and the constructors ofRegionOwner,Region,LayerStackand the feature classes are internal: an adapter uses the features the core ships.islands.region()refuses an owner that this navigator did not make with aTypeError, andRegionOwner.liveis aReadonlyMap.
Internals moved
Low: Undocumented machinery leaves the stable API
Likelihood of impact: low — apps that imported names no docs page names.
One rename: ReadOnlyViolation (@marmeon/http) is ReadOnlyError; its code stays H6. Everything else below was undocumented; use the documented API instead.
@marmeon/http: no longer exported from the main entry:CONNECTION_HEADER,LIVE_PATH,LiveSigner,DOCUMENT_HEADER,SESSION_PATH,INTENDED_KEY,OLD_INPUT_KEY,flashableInput,jsonResponse,PageSession,AssetVersion,LiveDeclaration,browserRoutes,BrowserRoutes,Flasher,FlashEntry,PropOrigins,staticView(now internal), andaddFlash,addLive,carryLive,withLiveMethod,toLayer,compilePolicy,epochOfResolver,SessionEpoch,SessionEpochController,SessionEpochAnswer,TabSyncMessage,TAB_SYNC_CHANNEL,LIVE_CHANNEL,mergeOf,propKind,resolveProp,ResolvedPage,PartialReload,OnceContext,ReadOnlyOptions,WritePermit,ERRORS_KEY,httpSolutions,BrowserRoute,HiddenReason.@internal:RedirectResult.toResponse()andCloseLayerResult.toResponse(),SharedData.entries/resolve/liveChannels,Prefetches.landed()/size, andSession.queueFlash/takeFlashin@marmeon/session. Instant visits stay available through<Link instant>andapp.placeholder().@marmeon/core: no longer exported from the main entry:MAX_ENTRY_BYTES,ENCRYPTED,currentTransaction,REDACTED_KEYS,runTransaction,rollBackOnErr,missingListenerQueue,InjectionWarning,NODE_ENVIRONMENTS,DOTENV_MARKER,resolveEnvironment; the last three are internal in@marmeon/core/environmenttoo (the last machinery).readEnvFileis exported from no entry.Container.onWarning()andContainer.warningsare@internal. Ask about a transaction withinTransaction().@marmeon/router: no longer exported:joinPaths,queryInput,issueOfFields,nothingToValidate,attributeName,parseCookies,serializeCookie,createNonce(usectx.nonce()),messageOf,NOT_LIVE.Router.dispatch()anddispatchNotFound()with their typesDispatchInput,DispatchOptionsandResponseFactoryare internal: a server of your own usescreateHttpKernel(), and tests use the test app. The constructors ofRouteandRouteDefinitionare@internal.@marmeon/validation:RuleDefinition,RuleStep,BuildContextandEngineare no longer exported; theRuleconstructor,~rule,~engineandwithare@internal.~standardis unchanged.@marmeon/database: a migration uses the builder's methods (table.string(),table.index()…), notBlueprint's lists orseal(); the constructors ofBlueprint,ColumnandPendingFactory,Column.specandallIndexes()are@internal. The running methods ofMigrator(migrate,rollback,reset,fresh,dropAllTables,connections) are@internal: runmarmeon migrate, or, where a call must stay, pass{ onRun, … }as its only argument.status(),changed(),missing(),projection()andfiles()stay public.SchemaMarker,MigrateOptions,MigrationRun,UnknownSchema,TypeGeneratorandRenderedare no longer exported.@marmeon/queueand@marmeon/notifications:JobRunner,PayloadCipher,Prepared,WorkerDependencies,NotificationDeliverer,DelivererDependencies,PendingDelivery,NotificationRegistryandRecipientRegistryare no longer exported.QueueConnections.runner()andcipher()and the constructors ofWorkerandSendQueuedNotificationare@internal; get a worker withapp.make(QueueConnections).worker(…).@marmeon/auth:PasswordHasherInternalsis no longer exported, andnew PasswordHasher(options)takes only its options.@marmeon/server,@marmeon/testing,@marmeon/table,@marmeon/storage,@marmeon/devtools: build test responses withcreateTestApp(), table builders withcolumn()/filter.*/action()/bulk()/exportCsv(), and render pages with the kernel's own renderer: the constructors ofTestResponse,PendingTestResponse,ColumnDefinition,Filter,RowAction,BulkActionandTableExport,TestResponse.fromandKernelOptions.rendererare@internal, andPageRenderer,PageRenderOptions,RenderFailureDetails,CookieCryptoandSessionAccessare no longer exported.TemporaryUploads,TargetRequest,UploadTarget,UploadSourceandUploadsOptionsare no longer exported, and the constructors ofTemporaryUploadandRejectedUploadare@internal.checkS3Sdkis not needed.StorageFakeno longer extendsStorageManager(never importable); its public members are unchanged, only the protectedbuild()/memory()are gone.marmeon:runfrommarmeon/mainis no longer API; only the launcher calls it.
Low: Auth events take the user, the details and the time; service constructors are internal
Likelihood of impact: low — apps that build auth events in tests or fakes, or build a framework service with new or extend one.
new SignedIn(user, remember, at, { via, ip, userAgent }) becomes new SignedIn(user, { remember, via, ip, userAgent }, at), and new TwoFactorChallengeFailed(user, at, details) becomes new TwoFactorChallengeFailed(user, details, at). The event objects keep their fields.
An app gets the framework's services from the container, and tests get the fakes from createTestApp(), so their constructors are no longer stable API:
@marmeon/auth:Auth,TwoFactor,Passkeys,EmailChange,PasswordBroker,AccountSessions,Gate,NoStoreWhenSignedIn,EmailVerification,TwoFactorStore,PasskeyStore,DatabaseAccessTokens,DatabasePasswordResetTokens,DatabaseSignIns. The symbol-keyed members ofAuthandAccountSessionsare internal too.DatabaseEmailChangeskeeps its constructor.@marmeon/session:Session,StartSession,VerifyCsrfToken,ShareErrorsFromSession,UserSessions,SessionLottery.@marmeon/http:CheckAssetVersion,ClearClientHistory,EncryptCookies,UrlSigner,ValidateSignature.@marmeon/core:ErrorReports,EventDispatcher,ConsoleLogger. A logger of your own implementsLoggerrather than extendingConsoleLogger.TransactionFrameis no longer exported at all (the last machinery).@marmeon/database:Migrator,Factories(Seedingis no longer exported at all, more names).@marmeon/cache:RateLimiter,CacheHealthCheck,LimitLiveValidation.@marmeon/i18n:Locales,Translators.@marmeon/redis:RedisConnection.@marmeon/queue,@marmeon/storage,@marmeon/notifications:QueueConnections,QueueHealthCheck,QueueFake,StorageFake,NotificationFake,Inbox.NotificationStoreis no longer exported at all (the last machinery).@marmeon/scheduler:Scheduler, and its methodscheckProcess(),lockWarning()andreleaseHeld(); runmarmeon schedule:work.
Replace new Gate(…) with container.make(Gate) (or take it by injection), and a fake built by hand with the one createTestApp() installs.
Low: More names only the framework used leave the API
Likelihood of impact: low — apps that imported a helper no docs page names.
An app that imported one of these gets a type error. Where an app has a use for it, the replacement is named:
@marmeon/core:deprecatedis imported from@marmeon/core/deprecationonly.LOOPBACK_HOSTS,devSecured,devEnvironment,forbiddenDevHostandnotInDevelopmentleave@marmeon/core/dev;devHosts,devOnlyand the two host checks stay.@marmeon/http:ActionParamsOfisParamsOf, andActionQueryOfisQueryParamsfrom@marmeon/http/pageor@marmeon/router.WrappedProp,ClientRoutesOptions,isLiveValidationandliveValidationFieldsare no longer exported;toSearchParamsleaves@marmeon/http/pageand is internal everywhere (the last machinery).@marmeon/router:fillPath,isLiveValidation,liveValidationFields,AccessProblem,MiddlewareProblem,PipelineOptions,RequestStateOptions,ValidateOptions,MessageOptions,ValidatedRequestandRouteEntryare no longer exported.@marmeon/auth/testing:authenticatedTokenis no longer exported; sign in withactingAs(user, { guard: 'api' }), or create a token withcreate()of theAccessTokenStore(app.make(AccessTokenStore).create(user.id, name, { abilities, expiresIn: null });expiresIntakes aDurationornullfor a token that never expires).@marmeon/database:Seedingis no longer exported; run seeders withmarmeon db:seedor the test app'sseedoption.@marmeon/i18n:CurrentLocaleandcreateTranslateare gone, andMessagesis imported from@marmeon/i18n/messagesonly.@marmeon/cli:CheckReport,CheckStatus.@marmeon/queue:CacheSource,JobEvents.@marmeon/storage:TemporaryUrls,UploadRule,RejectedUpload.@marmeon/notifications:AnyRecipientResolverClass.@marmeon/mail:compose. None has a replacement an app needs.
Low: The last machinery of the services leaves the API
Likelihood of impact: low — apps and tests that built a framework service with new, or called a member or imported a name no docs page names.
What the container or createTestApp() builds, and what only the framework calls, is internal. Take services from the container and fakes from the test app (app.events, app.mail, app.schedule, app.storage …):
@marmeon/core: the constructors ofContainer,EnvBlock,EnvSchema,EventFake,HealthChecks,ErrorSolutions,RedactorandTransactionFinishedError(the error class stays);Container.isScope,EventRegistry.listenersFor()andbindingsFor(),EventFake.isFaked(),Redactor.payload()andfit(),CurrentJob.fromReporter. Make a scope withcontainer.createScope()and environment variables withenv()and thee.*builders. Thecontaineroption ofcreateApplication()is internal.TransactionFrameandEventDispatcherOptionsare no longer exported.environment.problem,check,fromDotEnvanddotEnvDevelopmentWarningare gone fromenvironment;isDevelopment(),isProtected(),isTest(),name(),app()anddescribe()stay.resolveEnvironment(),buildEnvironment(),ResolvedEnvironment,DOTENV_MARKERandNODE_ENVIRONMENTSin@marmeon/core/environment(andResolvedEnvironmentin@marmeon/core) are internal: themarmeonlauncher resolvesNODE_ENV, an app reads it throughenvironmentand names a value withNodeEnvironmentName.HealthReport,HealthCheckResult,ListenerQueueandescapeHtmlare internal: write HTML with thehtmltemplate, which escapes every value, and read/up/readyby its documented JSON;@marmeon/queuebindsListenerQueue.@marmeon/router: the constructors ofRouterandCookieJar, andRouterOptions;CookieJar.lock(),useCodec()andqueued(), andCookieCodec;RequestNonce.want()andforDocument();MiddlewareGroups.version;Router.findByName();RouteDefinition.routeName,inSitemap,isInternalandblocking, and theRouteBlockingtype.matchesPathandurlForleave@marmeon/routerand@marmeon/router/url, andurlForleaves@marmeon/http/page: build a URL withrouter.url(name, params, query)or redirect withredirect().route(). A client adapter keepsmatchesPathfrom@marmeon/http/client/adapter.statusText(),toSearchParams()(also from@marmeon/router/url),ResponseContext,PageQuery,GET_HAS_NO_BODYandISLAND_IS_GET_ONLYare internal: read a status's text fromresponse.statusText, and build a query withURLSearchParams.CookieDefaults, from@marmeon/routerand@marmeon/http, is internal:SESSION_SECURE_COOKIEdecidesSecurefor every cookie.@marmeon/i18n:Locales.add()is gone; the supported locales are fixed once the app has booted, and an app adds one through a language file orAPP_LOCALES.Catalog.namespaces().@marmeon/http:ServerClosing,ReadOnlyandParentRequestare no longer exported: the framework drives them, and there is no public replacement. The constructor ofCloseLayerResult(usecloseLayer());ClientHistory.clearedandsiteData;CookieEncryption.isEncrypted(). The fields of the page prop descriptors (AlwaysProp.value,DeferredProp.groupandresolve,MergeProp.valueandmatch,OnceProp.resolve,keyandexpiresInMs,OptionalProp.resolve…) are internal: create props withalways(),defer(),merge(),once()andoptional().@marmeon/session:Session.start(),save(),abandoned,ended,hasFlash(),started,persistsandregenerateToken();Session.readOnlystays public.Session.idandexistsare internal too: the id is the session's secret, so never log it or key data by it. Rotate the token withsession.regenerate().@marmeon/database: the constructor ofConnections, andisolate(),used()andverify(); a test gets a clean database withcreateTestApp(app, { database: 'refresh' }), which isolates thedefaultconnection. Isolating another connection has no public replacement.@marmeon/table:DataTables.runAction(),runBulk()andexport(),DataTable.definitionand the read-only fields of the builders (isSortable,visibility,confirms,limit…);TableDefinitionandRowAuthorizationare no longer exported.tables.resolve()stays.@marmeon/auth: the writing methods ofTwoFactorStore(startSetup,confirm,useStep,consumeRecoveryCode,replaceRecoveryCodes,removeTotp) and itsremainingRecoveryCodes(), and those ofPasskeyStore(userHandle,create,updateCounter,suspend,release,rename,remove): change factors throughTwoFactorandPasskeys. The constructors of the auth events the framework dispatches — all butSignedIn,RegisteredandTwoFactorChallengeFailed. The_auth_*keys are no longer declared onSessionData; don't write them.FACTOR_CHANGE_MAX_AGEis no longer exported (it is 15 minutes, with no setting).AuthConfig.protectedis gone, and reading it throws; askenvironment.isProtected(). The constructor ofPolicyResponse: useallow(),deny()anddenyAsNotFound().@marmeon/cacheand@marmeon/redis: the constructors ofLock(usecache.lock()),Limit(useLimit.perMinute()…),RedisConnectionsandRedisHealthCheck;Limit.maxAttemptsanddecaySeconds;RedisConnections.inUse().@marmeon/queueand@marmeon/scheduler:Worker.process(),QueueConnections.verify(),cache()andevents,JobRegistry.add(); the constructors of the queue events (JobQueued,JobProcessing,JobProcessed,JobReleased,JobFailed);QueueFake.listenerQueued()(assert withassertListenerQueued()); the constructors ofScheduleTester,ScheduledTaskFinishedandScheduledTaskSkipped;Scheduler.schedules(),due(),tick()andrunNow(); the constructor ofCronExpression, and itsmatches(),matchesHour()andhourRestricted.@marmeon/mail,@marmeon/notifications,@marmeon/storage: the constructor ofMailFake(useapp.mail, and don't subclass it);NotificationStoreis no longer exported (read notifications throughInbox);StorageFake.defaultDisk,named(),options(),verify()andclose();TemporaryUpload.extension.UPLOAD_TYPESis internal:UploadMimenames the types an upload rule accepts.@marmeon/cliand@marmeon/devtools: the constructor ofOutput;FileDevtoolsStore.directoryandmaxAgeMs.- Types and registries only the framework used:
RouteLookup(from@marmeon/routerand@marmeon/http),TaskRunandWallTime(from@marmeon/scheduler) andUploadProblem(from@marmeon/storage) are no longer exported; drop a type import of them.HealthChecks.add(),all()andrun()andErrorSolutions.add()andfind()are internal: register checks withstatic healthand solutions withstatic solutions, and read the checks through/up/ready. Also internal:ErrorReports.flush(),QueueConnections.find()andfailed()(thequeue:failed*commands read the failed jobs),RedisConnections.verify()andclose(),NotificationChannels.make()(add()stays),FileDevtoolsStore.maxBytes, andredact()from@marmeon/core.
Low: Passkeys need the password, and EverySessionEnded takes the time last
Likelihood of impact: low — apps that register or remove passkeys, or build EverySessionEnded in tests.
passkeys.register(response, name, password)andpasskeys.remove(id, password)require the password as a string in their type, as they always did when they ran: without it the answer wasinvalid-password. An empty password gets that answer before anything is hashed.new EverySessionEnded(at, counts)isnew EverySessionEnded(counts, at), like the other auth events;atis optional, and aDateas the first argument throws aTypeError. Its constructor is internal now, like those of the other events the framework dispatches: a test reads the event the framework fired fromapp.eventsinstead of building one.
Commands and the scheduler
Low: The built-in command classes are no longer exported
Likelihood of impact: low — apps that import a framework command class, usually in tests or a schedule.
The command classes of auth, cache, database, devtools, notifications, queue, scheduler, session and storage are exported from no entry; a command's API is its name and flags. Run a command by its name instead:
// in a test
const run = await app.command('queue:retry', { args: ['all'] });
// in a schedule
s.command('queue:retry');run.code is the exit code and run.lines every printed line, with ✓ before success and ✗ before error lines (docs/testing.md#running-commands).
Low: A refused command argument exits with 2
Likelihood of impact: low — scripts and tests that check a command's exit code.
A command that refuses an argument throws CommandArgumentsError and exits 2, with the message on stderr, an empty stdout and no stack. A missing module, an existing file or a missing --force still exits 1.
- A script that tests for exit code 1 after a wrong argument gets 2 now. This covers the
make:*generators,start/dev,queue:work,schedule:work,queue:retry,queue:forget,queue:prune-failed,schedule:test,migrateand the rollback commands,publish,auth:end-all-sessions,auth:end-sessions,auth:reset-two-factor,auth:prune-tokens,make:auth --adapter,notifications:pruneanduploads:prune(docs/console.md). - In tests,
app.command()returnscode: 2for them. - An app's own command throws
CommandArgumentsError(frommarmeonor@marmeon/core) to exit with 2. - An app that copied the kit's
end-sessions.test.tsandtwo-factor.test.tstakes their current version: they expect 2.
Low: dev and start are reserved for the launcher
Likelihood of impact: low — apps or packages with a command named dev or start.
The launcher always answered marmeon dev and marmeon start itself, so such a command was unreachable. Registering one now stops the app with K8: rename it.
Low: The scheduler writes timeZone, and a task definition is read-only
Likelihood of impact: low — apps that set the time zone of a task or a schedule.
.timezone('Europe/Berlin')becomes.timeZone('Europe/Berlin'), andtimezoneinTaskDefinitionandScheduleConfigbecomestimeZone.SCHEDULE_TIMEZONEstays.TaskDefinitionis read-only; code that mutated one no longer compiles..description()is shown inschedule:listand must be one line of text; anything else is refused (Q5).
Low: The scheduler names the time a task was due dueAt
Likelihood of impact: low — listeners on the scheduler's events or its schedule.task channel, and tests that read a task run.
event.minute of ScheduledTaskStarting, ScheduledTaskFinished, ScheduledTaskFailed and ScheduledTaskSkipped, and minute of TaskResult, are dueAt: a point in time in epoch milliseconds, not a minute of the hour. The same holds for ScheduleTaskMessage, the report on the schedule.task channel. In the devtools, a schedule entry reads content.dueAt (assertRecorded('schedule'), the JSON API); entries written before the upgrade still show, without their due time.
A scheduler event built in a test takes { task, dueAt, reason, … }; one without a numeric dueAt throws a TypeError.
Low: modules:check and schema:project are steps of marmeon build
Likelihood of impact: low — scripts that call marmeon modules:check or marmeon schema:project.
Both are hidden commands that marmeon build runs, and a hidden command is no longer API: it may change in any release. serve, which marmeon start and marmeon dev run, stays API. Run marmeon build.
Formats
Low: schedule:list --json writes format 2
Likelihood of impact: low — scripts that read schedule:list --json.
options.overlapMinutes is options.overlapSeconds (30 minutes is 1800), and each task has a description, a string or null.
Low: The live stream carries its protocol version
Likelihood of impact: low — apps with live updates notice it once, during the rollout.
Nothing to change. The stream URL carries v=1 and the messages between nodes carry "v":1; a stream request of another version gets a 204, and a message without the mark is ignored. A tab opened before the upgrade stops getting live updates until its next visit reloads it. During a rollout from 0.4, live hints between old and new nodes are lost; an end is bounded by LIVE_MAX_STREAM_SECONDS.
Upgrading to 0.4.0 from 0.3.0
High: Upgrade with every process of the old release stopped
Likelihood of impact: high — every app.
0.4.0 cannot run next to 0.3: it renames the session and remember-me cookies, gives API tokens a new form, marks sessions, queued jobs and the page protocol with a format version, and reads no record of the old release. Upgrade in this order (the upgrade that stops every process):
- Before, while 0.3 runs. Let the queue run empty:
marmeon queue:work --stop-when-empty, untilmarmeon queue:sizeshows nothing waiting or delayed (a job delayed into the future does not run empty). Retry or give up whatmarmeon queue:failedlists: failed jobs of 0.3 cannot be retried afterwards. Plan to issue every API token again, and tell your users that they sign in again. - In development, in this order:
- Move every framework package to 0.4.0 at once:
pnpm up --latest "@marmeon/*" marmeon. Afterwardspackage.jsonnames every@marmeon/*package andmarmeonat exactly0.4.0; never upgrade one alone (how to upgrade). On the first day after the release, pnpm holds the new versions back (the first day after a release). - Rename the environment variables in the files of the repository (
.env,.env.test,.env.example, the compose file, the CI configuration) and give Redis and Postgres the names they now require.make:auth,migrate,db:typesandroute:typesstart the app, and 0.4.0 stops at the start while an old name is set orREDIS_PREFIXorDB_DATABASEis missing (K6) (environment variables, Redis, Postgres). The environment of the servers and the platform follows in step 4. - An app made with
make:auth: remove the auth module frombootstrap/app.ts, runmarmeon make:auth --forceand delete the files of 0.3 it leaves (the kit). Until then the app does not load. - Rewrite the migrations before anything runs them (a migration is a plan).
- An app made with
make:authon 0.3: add the migrations of its auth tables (the kit's migrations). - Run
marmeon agents:syncand commitAGENTS.mdandCLAUDE.md, which are new in this release: without themmarmeon checkreportsagentsas skipped (coding agents). Optionally,marmeon make:lint-config --forcewrites the lint preset anew with the rule that refuses imports of@marmeon/*/internal; it replaces your changes to.oxlintrc.json, so add them back, and pass--boundariesif you use it (lint). Also optionally,securityHeaders()from@marmeon/httpreplacesmiddleware/SecurityHeaders.tsin theglobalmiddleware ofbootstrap/app.ts. If you turned on HSTS in that file, pass it on, assecurityHeaders({ hsts: { maxAge: 31_536_000, includeSubDomains: true } }), or the header is no longer sent (the other security headers). - Run
marmeon migrateon the development database, thenmarmeon db:typesandmarmeon route:types, and commit what they write: until then their--checkfails with "generated by another version of Marmeon". If a command stops at the start, its message names what is missing; a queued listener of your own needs its name first (queued listeners). - Make the changes of the other entries below. The compiler,
marmeon checkand the tests point at most of them.
- Move every framework package to 0.4.0 at once:
- Stop every process of 0.3 on every machine: web, workers, the scheduler, cron jobs and every CI or release job that runs
marmeon. With the queue on Redis nothing makes a forgotten worker fail, so stop each one. - Set the environment of the servers and the platform to the new names, with
REDIS_PREFIXandDB_DATABASEwhere they apply (0.3 reads none of the new names, and 0.4.0 stops at the start on an old one), deploy, runmarmeon migrate --force, thenmarmeon auth:end-all-sessions --force --keep-reset-tokens(apps with@marmeon/auth), then start the new release. Untilmigratehas run, every query fails with D2 and/up/readyis red. The second command deletes the sign-ins with their remember-me tokens, revokes the API tokens that are left and rotates every session key, so nothing of 0.3 signs anyone in. After the kit's migrations it reports0 sign-ins deletedand0 API tokens revoked, because those migrations deleted both already; the session keys it rotates are what it is still run for. - After the start, issue the API tokens again and hand them out.
What is lost:
- Every session and every "keep me signed in" token. Users sign in again, with their second factor where they have one; a sign-in that waited for its second factor during the upgrade ends too.
- Every API token (the API token entry).
- What an open tab had typed and not sent: the tab gets a
409on its next request and loads the page anew. If you cache HTML documents publicly with amax-age, a tab can get an old document once after that reload (deployment). - The jobs of 0.3 that had not run, queued listeners, mails and notifications included. Their records carry no version: a worker of 0.4.0 fails each at once (Q1), logs and reports it and keeps its payload readable in
queue:failed, but none can be retried, so the mail or notification it would have sent is not sent (deploying while jobs wait).
Everything else stays: users, passwords, second factors and recovery codes, passkeys, reset links (with --keep-reset-tokens), uploads, notifications and the cache, as long as the app keeps its Redis prefix and its database name (Redis, Postgres).
From this release on, a job a worker does not know waits up to six hours for a worker that knows it, instead of failing after its tries; a queue driver of your own honours the new availableAt option of release() (queue drivers). When you rotate APP_KEY later, keep the old key in APP_PREVIOUS_KEYS, or everyone is signed out again.
There is no way back: 0.3 reads neither the cookies, the sessions and the jobs nor the record of migrations that 0.4.0 writes.
High: Apps made with the starter kit take its auth module again
Likelihood of impact: high — apps made with make:auth.
The kit's controllers, commands, listeners, translations and tests changed with the entries of this release, and nothing updates them in an app. Once the packages are at 0.4.0 and the environment is renamed (the stopped upgrade, step 2), the app does not even load: the kit's module of 0.3 imports names that 0.4.0 no longer exports, such as Lockout, so make:auth, a command of @marmeon/auth, is not offered either (marmeon list shows only the built-in commands). On a clean working tree:
Remove the auth module from
bootstrap/app.ts: the lineimport auth from '#modules/auth';andauthinmodules.Run
marmeon make:auth --force. It writes the module again and adds it tobootstrap/app.tsagain. It keeps every migration the app has and adds only the ones it lacks.Delete the files of 0.3 that the kit no longer has.
make:authdeletes nothing, and the type check fails on what they import:git -C modules/auth rm account-failures.ts account-failures.test.ts throttle.ts email-change.ts tasks/PruneEmailChanges.ts commands/EndSessionsCommand.ts commands/ResetTwoFactorCommand.ts passkeys.ts passkeys-browser.test.tsLook at
git diffand put your own changes back.
The files that go, in modules/auth:
account-failures.tsandaccount-failures.test.ts(sign-ins are limited insideAuth.attempt()now);throttle.ts(password checks are limited by@marmeon/auth);email-change.tsandtasks/PruneEmailChanges.ts(a change of address isEmailChangenow);commands/EndSessionsCommand.tsandcommands/ResetTwoFactorCommand.ts:auth:end-sessionsandauth:reset-two-factorcome with@marmeon/auth, and two commands of one name stop everymarmeoncommand with K8. A command you customized keeps working under another name. Tests import the classes from@marmeon/auth; pass the address as it is stored (lower case);passkeys.tsandpasskeys-browser.test.ts(the browser side of passkeys is@marmeon/auth/passkeys/browser).
New in the module: password-errors.ts, listeners/QueueLockoutMail.ts (without it the owner of a locked account gets no mail), listeners/NotifyAboutEmailChange.ts, and the tests login-limits.test.ts and route-limits.test.ts. AuthServiceProvider.ts no longer binds SignInStore (the binding is harmless but redundant). Without --force, port the files from packages/auth/stubs/react/modules/auth of the installed version; the compiler points at most places.
There is no way back. See the starter kit.
High: A migration is a plan: up and down describe the change instead of running it
Likelihood of impact: high — every app with migrations, the copies of the starter kit's included.
marmeon migrate takes the steps a migration describes and runs them, and the app knows its schema from these plans, not from the database. In modules/*/migrations:
up: async (schema) =>anddown: async (schema) =>becomeup: (schema) =>anddown: (schema) =>. Find them withgrep -rnE '(up|down): async \(schema\)' modules.await schema.create(,.alter(,.drop(,.dropIfExists(and.rename(lose theawait. Find them withgrep -rnE 'await schema\.(create|alter|drop|dropIfExists|rename)\(' modules.- Data written through
schema.dbmoves intoschema.data(async (db) => { … }). - Raw DDL (
sql`…`.execute(schema.db)) becomesschema.raw(sql…). A branch onschema.driverbecomesschema.raw({ sqlite: …, pgsql: … }), or readsdriverinschema.data(async (db, { driver }) => …). Marmeon records no owner, secret, soft-delete or timestamps mark for what raw SQL makes. schema.hasTable()andschema.hasColumn()are gone: a migration describes one change. UsedropIfExists, or SQL withif existswhere a table may be missing.- A plan is deterministic: no time, environment, file or database content may decide which steps
upadds. - A migration that changes a table created by raw SQL with
schema.alter()orschema.rename()stops with D19, even when both ran already. Rewrite the rawcreate tablein the old migration asschema.create()(this keeps.secret()andsoftDeletes()), or make the change in raw SQL too. - On Postgres, an index whose default name is longer than 63 bytes stops with D5. For a migration that ran already, pass the name Postgres stored (
select indexname from pg_indexes where tablename = '…'); in a new migration, a short name of your own, so that a laterdropIndexfinds it.
Rewrite the files before the first marmeon migrate of 0.4.0. That run adds a checksum column to migrations and records the checksum of every migration file as it is then; from then on migrate and migrate:status warn about a file that changed after it ran. Editing a migration that ran changes nothing in the database.
There is no way back. See Migrations and raw SQL.
High: Apps made with make:auth on 0.3 write the migrations of their auth tables
Likelihood of impact: high — apps made with make:auth on 0.3, and apps with a sign_ins table from make:sign-ins-table.
The kit's tables changed: API tokens are found by a unique hash, a device's remember-me token lives on the row of its sign-in and remember_tokens goes, every account has a session key, and an open change of address has a table of its own, email_changes, instead of three columns of users. A migration the framework shipped never changes, so nothing writes these changes for an app made on 0.3. Until they have run, /up/ready is red and names what is missing.
Take the kit again first (the kit).
make:auth --forcekeeps every migration the app has and adds the one it lacks,0001_01_01_000007_create_email_changes_table.migrateruns it although migrations with later timestamps ran already: it creates a new table and changes none. An app that ports the kit by hand copies that file from the kit instead. Never write a secondemail_changestable:migratethen fails.Add these migrations to
modules/auth/migrations, named with the current timestamp so that they sort after every migration that ran, in this order. Each one ends what it touches: the upgrade ends every session anyway.// <timestamp>_reissue_personal_access_tokens.ts — every token is deleted: its form is gone and no code reads it. import { defineMigration } from '@marmeon/database'; export default defineMigration({ up: (schema) => { schema.data(async (db) => { await db.deleteFrom('personal_access_tokens').execute(); }); schema.alter('personal_access_tokens', (table) => table.unique('token_hash')); }, down: (schema) => schema.alter('personal_access_tokens', (table) => table.dropUnique('personal_access_tokens_token_hash_unique')), });// <timestamp>_add_remember_columns_to_sign_ins.ts — the remember-me token moves onto the sign-in row; every sign-in ends. import { defineMigration } from '@marmeon/database'; export default defineMigration({ up: (schema) => { schema.data(async (db) => { await db.deleteFrom('sign_ins').execute(); }); schema.alter('sign_ins', (table) => { table.dropUnique('sign_ins_remember_selector_unique'); table.dropColumn('remember_selector'); }); // A column cannot be marked secret later: the selector is made again. schema.alter('sign_ins', (table) => { table.string('remember_selector', 32).nullable().secret().unique(); table.string('remember_validator_hash', 64).nullable().secret(); table.string('remember_previous_validator_hash', 64).nullable().secret(); table.timestamp('remember_rotated_at').nullable(); table.timestamp('remember_created_at').nullable(); table.string('remember_fingerprint', 64).nullable(); }); }, down: (schema) => { schema.alter('sign_ins', (table) => { table.dropColumn('remember_validator_hash'); table.dropColumn('remember_previous_validator_hash'); table.dropColumn('remember_rotated_at'); table.dropColumn('remember_created_at'); table.dropColumn('remember_fingerprint'); table.dropUnique('sign_ins_remember_selector_unique'); table.dropColumn('remember_selector'); }); schema.alter('sign_ins', (table) => { table.string('remember_selector', 32).nullable().unique(); }); }, });// <timestamp>_fill_empty_session_keys.ts — a random key for every account without one, from the database's own generator. import { defineMigration, sql } from '@marmeon/database'; export default defineMigration({ up: (schema) => { schema.data(async (db, { driver }) => { if (driver !== 'pgsql' && driver !== 'sqlite') throw new Error(`fill_empty_session_keys: no source of random bytes known for "${driver}"`); const key = driver === 'pgsql' ? sql`replace(gen_random_uuid()::text || gen_random_uuid()::text, '-', '')` : sql`lower(hex(randomblob(32)))`; await db.updateTable('users').set({ session_key: key }).where('session_key', 'is', null).execute(); }); }, down: () => {}, });// <timestamp>_drop_remember_tokens_table.ts — the tokens are not copied; "keep me signed in" works again after the next sign-in. import { defineMigration } from '@marmeon/database'; export default defineMigration({ up: (schema) => schema.drop('remember_tokens'), down: (schema) => schema.create('remember_tokens', (table) => { table.id(); table.foreignId('user_id').constrained().cascadeOnDelete(); table.string('selector', 32).unique(); table.string('validator_hash', 64).secret(); table.string('previous_validator_hash', 64).nullable().secret(); table.timestamp('rotated_at').nullable(); table.timestamp('last_used_at').nullable(); table.timestamp('expires_at'); table.string('account_fingerprint', 64).nullable(); table.timestamps(); }), });// <timestamp>_drop_pending_email_columns_from_users.ts — an open change of address is not carried over; its owner asks again. import { defineMigration } from '@marmeon/database'; export default defineMigration({ up: (schema) => schema.alter('users', (table) => { table.dropColumn('pending_email'); table.dropColumn('pending_email_token'); table.dropColumn('pending_email_expires_at'); }), down: (schema) => schema.alter('users', (table) => { table.string('pending_email', 255).nullable(); table.string('pending_email_token', 64).nullable().secret(); table.timestamp('pending_email_expires_at').nullable(); }), });Once the environment variables are renamed (environment variables), run
marmeon migrate(in production as step 4 of the stopped upgrade), thenmarmeon db:types.
Code that read users.pending_email* reads nothing now: a change of address goes through EmailChange and EmailChangeStore. An app without the kit but with a sign_ins table from make:sign-ins-table needs the sign-in migration above and drops its own remember_tokens table; an app with a UserProvider and no sign_ins table runs marmeon make:sign-ins-table (sign-ins). A remember_tokens table created under another migration name is not dropped for you. With a user table of your own, give every account without a session key a random one, as the third migration does.
There is no way back; the tokens and columns these migrations drop hold nothing that still works after the upgrade.
High: The app reads its schema from the migrations and refuses queries while one is pending
Likelihood of impact: high — every app with a database.
- An app that starts before
marmeon migraterefuses every query with D2 (MigrationStateError) and readiness is red. It recovers within a second aftermigrate, without a restart. Scripts andmarmeon tinkeragainst a database that is not migrated setDB_MANAGED=false. table_owners,secret_columnsandschema_markersof 0.3 stay in the database, andmigratenames them. Drop them by hand once no process of 0.3 runs, on every connection that has them. The record of migrations of 0.3 is read as it is.- Tables and columns made with
schema.raw()or by another tool are not inTablesandRelationsand have no relations, kinds or marks:with()on them stops working and code that used their types fails to compile. Create them withschema.create(), or type them for reading withdb.withTables<{ … }>(). selectAll()andreturningAll()name the columns the migrations know: a column that raw SQL or another tool added no longer comes back, so name it in the query. A whole-row value of a migration table (to_jsonb(t),eb.table('t')) fails with D9. The compiled SQL lists the columns instead ofselect *; update query snapshots.- Raw SQL in a migration that renames or drops a table or column the migrations know rolls the migration back (D3): use
schema.alter()orschema.rename(). A new migration with an older timestamp that changes a table a migration already run has changed is refused until it is renamed. - Dropping or renaming a column breaks every
selectAll(),returningAll()and relation of that table in processes of the release before. Drop or rename a column only in the release after the one that stops using it;retire()takes it out of use first. - Own tables without a record of migrations are kept:
migratecreatesmigrationsand names the tables it did not make. A database another tool manages (with amigrationstable of its own, say) getsmanaged: falseorDB_MANAGED=false. Migrator.onOneConnection(),owners(),secrets()andmarkers()are removed: usemigrator.projection(). AswitchoverMigrationStateError.reasonhandles the new'unmanaged'.- Tests that build tables with raw DDL on a managed connection use migrations instead.
There is no way back. See how the app knows its schema.
High: Environment variables are named after what they configure and their unit
Likelihood of impact: high — every app that sets one of the old names in a .env file, its deployment, a compose file or CI.
Rename these variables in .env, .env.test and .env.example, and wherever else the environment is set: compose files, CI, and the server or platform (in step 4 of the stopped upgrade). The values stay the same; nothing is converted. The .env.test of an app made on 0.3 sets MAIL_MAILER=array: until it says MAIL_DRIVER=array, every test stops with K6. An old name that is set stops the start in every environment, even next to the new one, names its replacement and is never read; marmeon check reports it too.
| Old | New |
|---|---|
DB_CONNECTION | DB_DRIVER |
QUEUE_CONNECTION | QUEUE_DRIVER |
DB_QUEUE_CONNECTION | QUEUE_DATABASE_CONNECTION |
DB_QUEUE | QUEUE_DATABASE_QUEUE |
DB_QUEUE_RETRY_AFTER | QUEUE_DATABASE_RETRY_AFTER_SECONDS |
REDIS_QUEUE_CONNECTION | QUEUE_REDIS_CONNECTION |
REDIS_QUEUE | QUEUE_REDIS_QUEUE |
REDIS_QUEUE_RETRY_AFTER | QUEUE_REDIS_RETRY_AFTER_SECONDS |
MAIL_MAILER | MAIL_DRIVER |
AUTH_PASSWORD_TIMEOUT | AUTH_PASSWORD_TIMEOUT_SECONDS |
AUTH_RESET_EXPIRE | AUTH_RESET_MINUTES |
AUTH_RESET_THROTTLE | AUTH_RESET_THROTTLE_SECONDS |
AUTH_EMAIL_CHANGE_THROTTLE | AUTH_EMAIL_CHANGE_THROTTLE_SECONDS |
SESSION_LIFETIME | SESSION_LIFETIME_MINUTES |
UPLOADS_LIFETIME | UPLOADS_LIFETIME_MINUTES |
UPLOADS_SEND_WITHIN | UPLOADS_SEND_WITHIN_MINUTES |
LIVE_REDIS_CONNECTION | LIVE_CONNECTION |
LIVE_HEARTBEAT | LIVE_HEARTBEAT_SECONDS |
LIVE_RETRY | LIVE_RETRY_MILLISECONDS |
MAX_BODY_SIZE | SERVER_MAX_BODY_SIZE |
HEALTH_PATH | SERVER_HEALTH_PATH |
ASSET_VERSION | SERVER_ASSET_VERSION |
SHUTDOWN_DELAY | SERVER_SHUTDOWN_DELAY_SECONDS |
KEEP_ALIVE_TIMEOUT | SERVER_KEEP_ALIVE_TIMEOUT_SECONDS |
TRUSTED_PROXIES | SERVER_TRUSTED_PROXIES |
SSR_ENABLED | SERVER_SSR_ENABLED |
OTEL_TRUST_TRACEPARENT | MARMEON_OTEL_TRUST_TRACEPARENT |
OTEL_RECORD_QUERY_VALUES | MARMEON_OTEL_RECORD_QUERY_VALUES |
PORT, HOST and the names of the OpenTelemetry specification (OTEL_SDK_DISABLED …) keep theirs. An app with files from marmeon make:docker runs it again with --force, or renames HEALTH_PATH in its Dockerfile, SHUTDOWN_DELAY and TRUSTED_PROXIES in its compose file, and TRUSTED_PROXIES in the systemd units of --systemd. A test that pins DB_CONNECTION pins DB_DRIVER.
These variables are read as switches now: MAIL_SECURE, MAIL_REQUIRE_TLS, AUTH_PRIVATE_REGISTRATION, AUTH_REVOKE_TOKENS_ON_PASSWORD_CHANGE, SESSION_ENCRYPT, SESSION_SECURE_COOKIE, SERVER_SSR_ENABLED, MARMEON_OTEL_TRUST_TRACEPARENT, MARMEON_OTEL_RECORD_QUERY_VALUES and DEVTOOLS_ENABLED. They take true, false, 1 and 0 in any letter case; any other text (yes, off) stops the start, and empty keeps the default (SESSION_SECURE_COOKIE then follows APP_URL). DEVTOOLS_ENABLED=1 counts as on, so it also stops a production start. OTEL_SDK_DISABLED follows the OpenTelemetry specification: only true disables, any other value, 1 included, leaves spans on.
There is no way back; the old names are never read. See renamed variables and every variable.
High: An app with @marmeon/redis sets APP_NAME or REDIS_PREFIX
Likelihood of impact: low — apps with @marmeon/redis installed whose environment sets neither variable. Apps made by create-marmeon require APP_NAME already.
The prefix of every Redis key and channel comes from REDIS_PREFIX, or from APP_NAME as a slug, and no longer falls back to marmeon:: two apps on one Redis without either shared their sessions, cache, rate limits, locks and queues. An app with @marmeon/redis installed, whichever drivers it uses, now stops at start:
[marmeon:K6] Invalid configuration — the application cannot start:
• redis: REDIS_PREFIX — set REDIS_PREFIX, or APP_NAME (with a letter or digit) — apps on one Redis share their keys otherwise (docs/redis.md#configuration)Set one of them in .env and wherever the environment is set (CI, and the server or platform in step 4 of the stopped upgrade):
APP_NAME="My App"gives the prefixmy-app:.REDIS_PREFIX=notes-app:is used as written; end it with the colon yourself. An emptyREDIS_PREFIX=and anAPP_NAMEwithout a letter or digit count as not set.- An app whose keys live under
marmeon:because it relied on the old default setsREDIS_PREFIX=marmeon:to keep them. Otherwise its cache starts empty, and jobs still waiting undermarmeon:are not found, not even as failed ones. - Staging and production on one Redis give each its own
REDIS_PREFIX.
A named connection from defineRedisConnection() keeps the prefix it gives in resolve. There is no way back to a default prefix. See Redis.
High: An app on Postgres sets DB_DATABASE or a DB_URL with the database's name
Likelihood of impact: low — apps with DB_DRIVER=pgsql that set neither DB_DATABASE nor a DB_URL with a path, and so used the database marmeon.
Postgres no longer falls back to the database marmeon: two apps on one server without a name of their own shared every table, from users and sessions to the cache and the jobs. Such an app now stops at start:
[marmeon:K6] Invalid configuration — the application cannot start:
• database: DB_DATABASE — set DB_DATABASE, or DB_URL with the database's name in its path — apps on one Postgres server share their tables otherwise (docs/database.md#configuration)Set one of them in .env and wherever the environment is set (CI, and the server or platform in step 4 of the stopped upgrade): DB_DATABASE=notes, or DB_URL=postgres://user:secret@host:5432/notes; the URL wins. DB_DRIVER is the DB_CONNECTION of 0.3 (renamed variables).
- An app whose tables are in the database
marmeonsetsDB_DATABASE=marmeon, or/marmeoninDB_URL. Any other name is another, empty database. - An empty
DB_DATABASE=counts as not set, and so does aDB_URLwithout a path (postgres://app@db:5432,postgres://app@db/):pgwould then readPGDATABASEor take the user name. - Staging and production on one server each need their own database name.
- A named connection from
defineConnection()whoseurlhas no path gives it one, or setsdatabase; otherwise it throws aTypeError.
SQLite keeps its default file. There is no way back to a default name. See database configuration.
High: API tokens have a new form, and every token is issued again
Likelihood of impact: medium — apps that issue API tokens.
A token no longer carries its row id: it looks like marmeon_…, without the |, and is found by the unique hash of its secret. Every token issued before stops working, and the upgrade deletes them (the kit's migration, auth:end-all-sessions). Each app issues its tokens again and hands them to every integration, script and client that used one: plan this before you deploy.
AUTH_TOKEN_PREFIXis empty, or at most 16 lower-case letters, digits and_, ending in_(defaultmarmeon_). Any other value stops the start, so change it before you deploy.AccessToken.idisnumber | string. Code that cut the id out of a token reads it fromAccessTokenStore.list()instead.- A token table of your own: delete the old rows and add
unique('token_hash')in a migration. With UUID keys, adapt the revoke controller.
There is no way back. See the token format.
High: A queued listener needs a stable name, or the app does not start
Likelihood of impact: medium — apps with queued listeners: a class with static queue passed to listen(Event, Class).
A worker finds a queued listener by a name that a rename or a minifier cannot change. Add one to each:
export class SendWelcomeMail {
static readonly listener = 'accounts.send-welcome-mail';
static queue = { tries: 3 };
// …
}Use lower-case words with a . after the module, and never change the string later. The app does not start until every queued listener has one. Notifications and mails with static queue need none. Queued listener jobs of 0.3 do not run (the stopped upgrade).
There is no way back. See queued listeners.
High: An ExceptionHandler with a report() method no longer reports
Likelihood of impact: medium — apps that extended DefaultExceptionHandler and overrode report(), for example to send errors to a tracker, or bound an ExceptionHandler of their own with a report() method.
Errors go to the error reporters that providers bring, and the framework no longer calls report() on the handler. TypeScript does not flag the extra method, so such an app stops reporting without a type error; the kernel logs one warning at the first server error ("The ExceptionHandler has a report() method, which is not called any more").
- Move the code into an
ErrorReporter(report(report: ErrorReport)), list it in a provider'sstatic errorReporters, and removereport()from the handler. DefaultExceptionHandlerhas no constructor parameters: a subclass that callssuper(logger, redactor)drops the arguments.- An error you catch yourself while the request still answers 200 is reported with
app.container.make(ErrorReports).report(error, { source: 'request' }). - A reporter whose constructor throws stops the start with K12; a wrong DSN no longer switches reporting off without a sound.
The log line of an error is unchanged. There is no way back. See reporting.
High: A UserProvider writes the session key with the password and compares both
Likelihood of impact: high — every app with @marmeon/auth: apps made with make:auth take the kit's UserRepository.ts, a provider of your own implements the methods below.
A session is bound to the account's id and session key, no longer to its password hash. A rehash after higher HASH_* costs keeps every sign-in, and code that writes password itself ends no session any more: write a new key with it, or call AccountSessions.end(). To end everything, run marmeon auth:end-all-sessions.
- Apps made with
make:auth: takeUserRepository.tsfrom the kit and replace the testsauth.test.ts,two-factor.test.tsandpasskeys.test.ts(the kit). Your own callsupdatePasswordHash(id, hash, expected)becomeupdatePasswordHash(id, hash, { expected }). Tests that writepassworddirectly also write asession_key; a test double that overridesfindByIdreturnssessionKey. - A provider of your own:
updatePasswordHash(id, hash, { expected?, sessionKey?, expectedSessionKey? })returns a boolean. WithsessionKeyit writes hash and key in one statement, and only where the stored key equalsexpectedSessionKey(IS NULLfornull); otherwise it returnsfalse.updateSessionKey(id, key, expected)is a compare-and-set in one statement (IS NULLfornull); called with the stored key as bothkeyandexpected, it returnstrue.updateEverySessionKey(key)is oneUPDATEwithoutWHEREand returns{ accounts, sampleId };sampleIdis required whenaccounts > 0.auth:end-all-sessionsneeds it.findById()andfindForSignIn()(before:findForLogin(), renamed) returnsessionKey(nullwhen the account has none) from asession_keycolumn (64 characters,.secret()), read after the write, not from a cache; otherwiseupdatePassword()and a reset fail with A5.findForSignIn()compares the normalized identifier exactly.- New accounts get a random key (32 bytes, base64url);
NULLstays allowed. - The framework checks only the shape of the answers: test the compare-and-set yourself.
- JavaScript providers with the positional
expectednow receive an object: on SQLite the binding throws, on Postgres the comparison never matches, so a sign-in that needs a rehash is refused as a wrong password. - Every app with a
UserProviderinstalls@marmeon/cacheand registers its provider, or the boot stops with A7: sign-ins and password checks are limited through it. Test harnesses withdiscover: falseaddCacheServiceProvider(withCACHE_DRIVER=memory, say).
There is no way back. See for your own user provider.
Medium: Auth events, methods and types are named after signing in
Likelihood of impact: high — every app with @marmeon/auth: the kit's UserRepository.ts, every provider of your own, and code that uses the auth API.
Rename what the compiler points at:
| Before | After |
|---|---|
Login (event) | SignedIn |
Logout (event) | SignedOut |
Failed (event) | SignInFailed |
Lockout (event) | SignInLockedOut |
event name auth.login | auth.signed-in |
LoginPayload | SignedInPayload |
LoginInput | SignedInInput |
LoginVia | SignInVia |
via: 'login' (event field, Auth.signIn()) | via: 'app' |
auth.login(user) | auth.signIn(user) |
auth.logout() | auth.signOut() |
LoginOptions | SignInOptions |
LoginThrottle | SignInThrottle |
findForLogin() (UserProvider) | findForSignIn() |
findForSignIn() keeps the signature and the contract of findForLogin(). Rename it in the kit's UserRepository.ts (the kit), in every provider of your own, and in seeders and tests that call it. In JavaScript or behind a cast, a provider with only the old name stops the boot with A5, which names findForSignIn(); nobody is signed in and no account is reported as unknown.
The kit's LoginController, ShowLoginController, LogoutController and the view Login.tsx keep their names, and so do the routes auth.login and auth.logout. A queued listener job stored under the event name auth.login is never delivered to a listener of auth.signed-in; the jobs of 0.3 fail at once after the upgrade in any case, so let the queue run empty before (the stopped upgrade).
There is no way back. See Authentication and for your own user provider.
Medium: Password checks and sign-in limits are part of Auth
Likelihood of impact: medium — apps with their own sign-in, password, two-factor or passkey controllers.
Auth.attempt() limits password sign-ins per client and per account and dispatches SignInLockedOut itself, and every password check of a signed-in user runs under its throttle.
- Replace
auth.confirmPassword(p)with(await auth.checkPassword(p)).ok, and showthrottledto the user. - Replace
logoutOtherDevices(p)withcheckPassword(p)followed byupdateSessionKey(). - Test
TwoFactor.disable()through.ok, never its truthiness. - Remove your own counting around sign-ins,
checkPassword(),disable()and the passkey methods, and your own lockout dispatches; otherwise each counts twice. Tests that read the cache keylimiter:login:<email>|<ip>stop doing so. - Handle
throttledfromattempt():retryAfter, andaccount: truewhen waiting does not help. new SignInLockedOut(identifier, ip, scope)takes the scope; a listener that blocks an IP acts only on'client'.- Set the device cookie after a successful sign-in (
auth.deviceCookie()) and after a reset (broker.deviceCookie(user)). - Code that builds
AuthorPasswordBrokerby hand passes aRateLimiterand aSignInThrottleas the last arguments; resolve them from the container instead.
The new environment variables of the limits are optional. There is no way back. See limits on password sign-ins.
Medium: The auth stores and the session store are abstract classes
Likelihood of impact: low — apps with their own reset-token, API-token, two-factor, sign-in, remember-me or session store, their own hasher, or test doubles of these.
- Write
extends PasswordResetTokenStore,AccessTokenStore,TwoFactorState,SignInStoreorSessionStoreinstead ofimplements, callsuper(), and implement every member,forgetEveryone()andrevokeEveryone()included. Test doubles written as object literals (container.instance(SessionStore, { … })) become subclasses. User id parameters areAuthUserId: convert a string route parameter for a numeric id. RememberTokenStoreis gone: a remember-me token lives on the row of its sign-in. Move its methods into one class thatextends SignInStore:issueTokeninstead ofcreate,consume(it returnssignInnow),rememberedinstead ofexists,forgetTokeninstead offorget,rebind,dropToken, andendAll/endEveryoneinstead offorgetUser/forgetEveryone.prune(window, days)takes the days. Keep the guarantees their JSDoc names: user-scoped writes, an atomic revocation on theft,commitAnywayon expiry and theft, read-after-write forremembered.- A session store:
class YourStore extends SessionStore, withoverridebeforedestroyUserundernoImplicitOverride. ExtendSessionStoreitself, never a built-in store. - A source passed to
combineFactors()needsfactors,enabledSinceandremoveAll. A store for changes of address addswaiting(). - A hasher of your own adds
failureFloorMs(), returning milliseconds of 0 or more;0gives up the padding of failed sign-ins. - In JavaScript or behind a cast, a missing member or an invalid
failureFloorMs()answer fails with A6. - Listeners of
EveryoneEndedandEverySessionEndedstop readingrememberTokens. - Code that constructs
AccountSessions,NewPassword,PruneTokensCommand,PasswordBroker,TwoFactororPasskeysitself: their constructor parameters changed (TwoFactorandPasskeystakeSessionConfiglast); resolve them from the container. - Removing a passkey through the package API instead of the kit's controller: call
updateSessionKey()afterwards, as the controller does, so that the sessions of a cloned passkey end.
There is no way back. See your own stores.
Medium: The session and remember-me cookies are named __Host-… over https
Likelihood of impact: medium — apps that set SESSION_COOKIE or AUTH_REMEMBER_COOKIE, run behind a TLS proxy, or name these cookies in tests.
With Secure cookies the two cookies carry the __Host- prefix and no Domain. The cookies of 0.3 are never read (the stopped upgrade).
AUTH_REMEMBER_COOKIEdefaults tomarmeon_remember(before:remember_web). An app that sets it checks the name.- If
SESSION_COOKIEorAUTH_REMEMBER_COOKIEstarts with__Host-or__Secure-, remove the prefix: the framework adds it, and the app does not start otherwise. - Behind a TLS proxy, serve with
APP_URL=https://…. - Tests that read or set these cookies by name take the names from
cookieNames(app)(@marmeon/auth/testing) orsessionCookieName()/rememberCookieName(): with an httpsAPP_URLthe literal names no longer match. ctx.cookiesno longer shows cookies whose names are not RFC 6265 tokens (a[b],x:y).
There is no way back. See the __Host- prefix.
Medium: Pages and visits give PageInfo, not the page object
Likelihood of impact: medium — apps that read protocol fields of usePage(), of what router.visit() and router.reload() resolve to, or of visit callbacks.
usePage(), router.visit(), router.reload(), router.on('success'), onSuccess and VisitException.page give PageInfo: props, url, component, route, locale, query and flash, read-only. For the fields that are gone:
| Before | After |
|---|---|
.version | useNewVersion() or router.on('version') |
.deferredProps | <Deferred> or <WhenVisible> |
.layers | useLayer() |
.csrf | xsrfToken() from @marmeon/http/client (same-origin requests pass by Fetch Metadata anyway) |
.epoch | tabSync |
@marmeon/react exports only the app's API now:
- Remove imports of
BackdropandErrorPage: the built-in error page and layer backdrop still apply; to replace them, addmodules/errors/views/Error.tsxormodules/layers/views/Backdrop.tsx. SHORT_PENDING_DELAYbecomesusePending(name, { delay: 'short' }),pagesAroundbecomes<Pagination>;layoutsOfhas no replacement.pageQueryis no longer in@marmeon/http/client: useuseQueryState(), which also fills in the defaults.MarmeonAppandMarmeonAppPropsare no longer exported: the app's entry iscreateMarmeonApp().
There is no way back. See Pages.
Medium: A controller passes the status and headers of a result as options
Likelihood of impact: high — apps that answer with another status than 200 from a controller.
this.view('notes/Edit', props, 422); // before
this.view('notes/Edit', props, { status: 422 });
this.json(data, 201); // before
this.json(data, { status: 201 });
this.redirect(url, 301); // before
this.redirect(url).status(301);The same goes for the standalone view() and json() of @marmeon/http, whose headers move from a further argument into { headers }, and for new RedirectResult(url, status), which becomes new RedirectResult(url).status(status). The compiler points at each call; a number that slips through at run time throws a TypeError that names { status: 422 }.
There is no way back. See Responses.
Medium: A middleware adds to the request context and never replaces a key
Likelihood of impact: medium — apps with middleware of their own, or code that assigns to ctx.
next()refuses every key the context has already and the names every object has (then,toJSON,constructor). A reserved key (request,params,route,query,input,inputRead,cookies,ip,nonce,expectsJson,body,pageQuery) in what a middleware declares does not compile; any key given tonext()that is reserved or present fails when the request runs with aTypeError(H8) and a 500. Give the value a key of its own (next({ activeTeam })). A middleware may not replace a key an earlier one set (userafterauthenticate()). Adding a new key works as before.- The context is frozen one level deep, and so are
ctx.paramsandctx.route:ctx.team = …,Object.assign(ctx, …)and assignments toctx.paramsthrow aTypeError; usenext({ … }). Values inside the other keys (theuserobject,ctx.query,ctx.request.headers) stay changeable. - A loaded route is frozen:
route.name(),route.internal(),route.block(),route.middleware.push(…)orroute.reserved = …afterRouter.loadthrow aTypeError. Set these insidedefineRoutes(). - Two middleware that declare the same key in
static addsstop the start with H8, naming the route, the key and both, for instanceauthenticate()on a group and again on a route: remove one.marmeon checkreports it. - A middleware that adds keys declares them:
static adds = ['team'] as constin a class,defineMiddleware(name, handle, { adds: ['team'] })for an object. Without it, only the run-time check applies.
There is no way back. See adding to the context.
Medium: useForm takes the route parameters as an option
Likelihood of impact: high — apps with forms whose route has parameters, and every app made with make:auth.
useForm('notes.update', { note: id }, initial, options); // before
useForm('notes.update', initial, { params: { note: id }, ...options });
useForm('notes.store', {}, initial); // before
useForm('notes.store', initial);The compiler points at each call; where it cannot see one (untyped code), the old forms throw a TypeError when the component renders. Apps made with make:auth take the kit's views (the kit) or edit them as the compiler shows.
There is no way back. See Forms.
Medium: The database's types have names of their own, and a module's database runs queries only
Likelihood of impact: medium — apps that name query-builder types or run DDL or raw SQL through a module's Database.
Kysely<DB>becomesConnection<DB>,SelectQueryBuilderbecomesSelectQuery;Selectable<Tables['t']>,Insertable<…>andUpdateable<…>becomeRow<'t'>,NewRow<'t'>andRowUpdate<'t'>(for a table type not inTables:RowOf<T>,NewRowOf<T>,RowUpdateOf<T>). All come from@marmeon/databaseand are the same types;Transaction<DB>andsqlkeep their names.queue.using(x)takes only a transaction (trxfromconnections.transaction()):queue.using(db)does not compile. Pass the transaction, or dispatch withoutusing().Database<'module'>offersselectFrom,selectNoFrom,fn,case,dynamicandisTransaction, plusinsertInto,updateTable,deleteFromandtransaction()for the module's own tables.schema,executeQuery,getExecutor,destroy,introspection,$extendTables,$omitTablesand$pickTablesare gone: code that runssql`…`.execute(db)with a module's database, changes the schema or closes the connection injects the unscopedDatabase, or moves into a migration.Databasewithout a module name is unchanged.- A statement kind the secret guard does not know is refused at run time, and so is a function name that is not an identifier, in
fn.aggand quoted (fn('"MyFunc"')) too: write a plain or schema-qualified name (pg_catalog.lower), or usesql`…`.
There is no way back. See table types and module boundaries.
Medium: The migrations of a module come only from the app or its workspace
Likelihood of impact: low — apps with a module that reads its migrations from a package in node_modules, a link to another repository, or a place outside the app.
A module whose migrations lie in node_modules or outside the app and its workspace stops the start with D20: Bun with a symlink backend, Deno's npm cache, a link: to another repository, a volume outside the app root, a link to node_modules or outside in a subfolder of migrations, a real node_modules inside it, and a workspace root that everyone can write or another user owns. Monorepos with pnpm-workspace.yaml or workspaces and the lockfile in their root are not affected.
Move the files, with the same names, into a module of your app and point migrations at them; new timestamps would make new migrations that create the tables a second time. If the app's module has another name, run UPDATE migrations SET module = '<your module>' WHERE module = '<package module>' once. A package brings its migrations through marmeon publish.
There is no way back. See migrations from a package.
Medium: The page client's adapter API moves to @marmeon/http/client/adapter
Likelihood of impact: low — apps that drive the client core, write client features of their own or import page-protocol names.
useFeature()andnavigator.use()take only a stableFeatureHandle;@marmeon/http/clientoffers two,hooksandtabSync. Every other handle (actions,islands,layers,live,liveValidation,prefetch,optimistic,remember,guard,instant,revalidateOnBack,queryState,selection,uploads,viewTransitions,devtools), its API type,Navigator,defineFeatureand the other building blocks of the client core come from@marmeon/http/client/adapter, which may change in any minor release. A handle thatdefineFeature()did not make throws aTypeError, and a feature it made is frozen.VisitOptions.ignoreGuardstakesIgnoredGuard(message,active()); a customProgressIndicatorreceives aProgressSourceinstead of the navigator.pageInfo,pageName,scriptJson,ERROR_PAGE,LAYER_BACKDROPandmatchesPathmove from@marmeon/http/pageto@marmeon/http/client/adapter.- The page protocol has its own entry: the
*_HEADERconstants,PAGE_SCRIPT_ID,MAX_LAYER_DEPTH, the typesPageObject,RegionObject,OnceInfo,LayerInfo,LiveHint,LiveSubscription,RegionKind,RegionOutcomeStatusandLayerClose, andisPageObject,isPrefetch,isActionRequestandregionOfcome from@marmeon/http/protocol, no longer from@marmeon/httpor@marmeon/http/page. Augmentations of@marmeon/http/page(Views,SharedProps,FlashData) stay. - No longer exported, without replacement: the
DEFAULT_*constants,SCROLL_REGION_ATTRIBUTE(write thescroll-regionattribute),matchesRouteName,confirmRequestandnativeConfirm,isSensitiveFieldandSENSITIVE_FIELD(useisSensitiveRememberField), and from the client entries of devtools and tableDevtoolsBar,installDevtoolsHookandparseSort,sortValue,propOf(for a column's sort value write-nameorname).
There is no way back. See writing a UI adapter.
Low: The page protocol has a version
Likelihood of impact: low — apps with a client of their own that sends x-marmeon headers, and tests that set them by hand.
A request of another protocol version gets a 409 before any controller runs, and the tab loads the page anew. A client of your own sends x-marmeon: 1. In tests, replace a hand-set x-marmeon: 'true' with the helpers of the test app (navigating(), acting(), island() …) or with PROTOCOL_VERSION from @marmeon/http/protocol.
There is no way back. See a tab of another protocol version.
Low: Test doubles come from /testing, and the internals of the packages are no longer exported
Likelihood of impact: medium — app tests that import fakes, and code that imported names the docs do not describe.
| Name | Import from |
|---|---|
TestClock, EventFake | @marmeon/core/testing |
QueueFake | @marmeon/queue/testing |
StorageFake, ExpectedContents | @marmeon/storage/testing |
ScheduleTester | @marmeon/scheduler/testing |
MailFake | @marmeon/mail/testing |
NotificationFake | @marmeon/notifications/testing |
twoFactorCode, authenticatedSession | @marmeon/auth/testing |
DevtoolsTester | @marmeon/devtools/testing |
BroadcastRecorder, LiveStreamReader, RecordedRefresh, LiveEvent | @marmeon/live/testing |
Tests that go through createTestApp() (app.mail, app.notifications, app.queue …) change nothing. Further:
createHttpKernel()andTestApp.kernelofferfetch,requestandsettleonly. A test that faked the peer with Hono's env argument ({ incoming: { socket: { remoteAddress } } }) passes{ remoteAddress }.PinoLoggeris not exported: usecreatePinoLogger().LocalDisk,MemoryDiskandS3Diskare not exported: configure the disk indefineStorage(), or implementDiskfor a driver of your own.MarmeonEntriesandMarmeonPluginApi(@marmeon/vite) becomeMarmeonOptions['entries'].new DatabaseHealthCheck(connections)goes:DatabaseServiceProviderregisters the check.- Every other name that left a package was not documented and lives under its
/internalsubpath, which may change in any release: the generated lint config forbids importing it, andmarmeon checkreports such imports. An app that needs one should open an issue.
There is no way back. See Fakes.
Low: Some packages and options are experimental
Likelihood of impact: low — apps that use devtools, live, otel, table or tinker.
Nothing to change. These may change in a minor release now: @marmeon/devtools, @marmeon/live, @marmeon/otel, @marmeon/table (with @marmeon/react/table and /table-tanstack), marmeon tinker, the devtools feature of @marmeon/http/client, the Vite options pages and lang, the devtools, broadcast and live() helpers of the test app, and ResolvePage.features. See experimental.
Low: The app's definition is apart from the options that boot it
Likelihood of impact: low — apps whose definition carries env, phase, container or override, and tests that pass env inside the definition.
- Move
env,phase,containerandoverridefrom the definition inbootstrap/app.tsintocreateApplication(definition, { … }). createTestApp({ ...definition, env })becomescreateTestApp(definition, { env }). The option layers over.envand the process environment instead of replacing them, so pin every key the test depends on, such asDB_DRIVER.- A package that augmented
ApplicationOptionsaugmentsApplicationDefinitionand readsapp.definitioninstead ofapp.options.
There is no way back. See Modules.
Low: The schemas of the framework's queued payloads are Standard Schemas
Likelihood of impact: low — code that passed such a schema to Valibot, for example v.parse(SignedIn.schema, …).
For types, use EventPayload<typeof SignedIn>, JobPayload<…> or the named …Payload types; to validate, SignedIn.schema['~standard'].validate(value). Run-time behaviour does not change. There is no way back.
Low: marmeon exits with 2 when a command is called wrongly
Likelihood of impact: low — scripts that read exit code 1 as "called wrongly".
Check for 2 instead. Scripts that only test for a non-zero exit need no change. There is no way back. See exit codes.
Low: A cache store of your own is a driver, and its locks a LockStore
Likelihood of impact: low — apps with a cache store of their own, or code that typed a variable as CacheStore and locked through it.
- Register the store as a driver:
static cacheDrivers = { name: factory }on a provider, whose factory returns{ store, locks }. The methodslock,unlock,forceUnlockandlockOwnermove to theLockStorereturned aslocks(one object may be both). CacheStorehas no lock methods:store.lock()on aCacheStoredoes not compile;new Lock(store, …)takes aLockStore.CacheConfig.driveris astring, so an exhaustiveswitchover it stops narrowing.CACHE_DRIVERaccepts any lower-case name; a name no provider brought is refused atboot()with the known names.
Apps that only use Cache, cache.lock() and RateLimiter change nothing. There is no way back. See locks.
Low: The passkey types come from @marmeon/auth/passkeys
Likelihood of impact: low — code that types passkey values with the types of @simplewebauthn/browser or /server.
Take the types from @marmeon/auth/passkeys. A value typed with the other ones may no longer compile against Passkeys.register(), signIn() or confirm(): prf values are base64url strings, and attestationFormats is string[]. There is no way back. See Passkeys.
Low: A package's "marmeon" field holds only the keys the protocol knows
Likelihood of impact: low — apps that use a package with another key in the "marmeon" field of its package.json.
An unknown key (a misspelt provider, a migrations key) or a field that is null, false or a string stops the next start or marmeon discover with a message naming the package and the key. The package has to be fixed; until then use a version without the key, or pnpm patch / overrides it. A package author keeps providers, browser and experimental only, and declares migrations on the provider as static migrations. There is no way back. See the package protocol.
Low: next() takes the extension when any member of a union adds keys
Likelihood of impact: low — middleware declared with a union whose members add keys, such as defineMiddleware<{ user: User } | {}> or next: Next<A | B> in a class, that calls next() without an argument.
Such a middleware no longer compiles: the next handler would read a key that was never set. Pass the extension to next(…), or declare the keys as optional in one type ({ user?: User }). {} and object still allow next() without an argument. Run-time behaviour does not change. There is no way back. See adding to the context.
Upgrading to 0.3.0 from 0.2.0
High: A server listens on 127.0.0.1 unless HOST says otherwise
Likelihood of impact: high — every app that runs marmeon start or marmeon dev outside the generated Docker image or the systemd unit and has to be reached from another machine.
Before, a server without HOST listened on every interface. Now HOST defaults to 127.0.0.1 in every environment, and startServer() falls back to it as well, so the server answers only the machine it runs on. A buildpack or PaaS that runs marmeon start itself, a load balancer or proxy on another host and a phone on the LAN that tests marmeon dev no longer reach it.
Set the interface the server must answer on:
HOST=0.0.0.0Behind a proxy on the same machine, in the generated image (its Dockerfile sets HOST=0.0.0.0) and with the systemd unit (HOST=127.0.0.1), nothing changes. Code that calls heldOnLoopback(port, undefined) directly has to pass the host, a plain string.
The start line shows 127.0.0.1 as http://localhost:PORT. On macOS a program on :: or ::1 with the same port does not stop a server on 127.0.0.1, and localhost then reaches that program: before listening, the start tries [::1]:PORT and warns once when something answers (PORT=0 skips the check).
The way back is HOST=0.0.0.0, which listens on every interface as before. See Configuration and Deployment.
High: Accounts keep a session key that UserProvider.updateSessionKey() compares and sets
Likelihood of impact: high — apps made with make:auth and every custom UserProvider or RememberTokenStore.
AccountSessions.end(id) is new: it ends every session of an account on any session driver by deleting its remember-me tokens, rotating its session key and removing the session rows a store can find. For it, and for the races around password changes and signing out other devices, UserProvider.updateSessionKey(id, key, expected) is now a compare-and-set, RememberTokenStore has an exists() and auth.updateSessionKey() returns a boolean. A provider that returns nothing from updateSessionKey() makes the call throw, with the remedy in its message.
What the app has to do:
- Apps made with
make:auth: add a nullable, secretsession_keycolumn tousers(table.string('session_key', 64).nullable().secret()), and takeupdateSessionKey()and thesessionKeyin#credentialsfrom the stub'sUserRepository.ts. Portcommands/ResetTwoFactorCommand.ts: injectAccountSessions, callend()before removing the factors and check the factors again afterwards; without itauth:reset-two-factorleaves a lost device signed in, which can enrol a first factor of its own. Optionally copycommands/EndSessionsCommand.tsand register it formarmeon auth:end-sessions <email> --force. - A custom
UserProvider:updateSessionKey(id, key, expected: string | null | undefined): Promise<boolean>. With a string ornullit writes only if the stored key equalsexpected(IS NULLfornull), in one statement, and returns whether it wrote; withundefinedit writes regardless.findByIdhas to hand the key back assessionKey. - A custom
RememberTokenStore:exists(cookie): Promise<boolean>, by selector and consistent withforgetUser()at once (no cache, no lagging replica). - Code that uses the result of
auth.updateSessionKey():falsemeans this session was ended meanwhile and is signed out.
There is no way back; the interfaces require the new members. See Authentication.
High: Changing a second factor needs a second factor proven in the last 15 minutes
Likelihood of impact: high — apps with two-factor authentication or passkeys, made with make:auth or with their own routes for these methods.
TwoFactor (begin, setup, regenerateRecoveryCodes, disable) and Passkeys (registrationOptions, register, remove, release) require the second factor proven within the last 15 minutes (FACTOR_CHANGE_MAX_AGE) on an account that has one, and throw otherwise. Without the new middleware the two-factor and passkey routes answer 500 for such accounts once the proof is older, and the e-mail change and the API-token creation are refused only by this middleware. confirm() records a fresh proof only for the first factor, and registering the first passkey drops a TOTP setup begun before it.
Add confirmedSecondFactor({ verify: 'auth.two-factor.verify' }) after confirmedPassword() (accounts without a factor pass it):
import { confirmedSecondFactor } from '@marmeon/auth/two-factor';
const factors = sudo.middleware(confirmedSecondFactor({ verify: 'auth.two-factor.verify' }));
factors.post('/settings/tokens', CreateAccessTokenController);and register these routes on factors: the two-factor settings page, setup, recovery codes and disable, the passkey page, options, store, release and remove, and POST /settings/tokens. For PUT /settings/email, add .middleware(confirmedSecondFactor({ verify: 'auth.two-factor.verify' })) after confirmedPassword() in its own chain and keep throttle('email-change'), as the stub does. Leave it off two-factor confirm, verify, the step-up routes and the passkey rename. The stub's routes.ts shows all of it. Also add await twoFactor.requireRecentProof('changeEmail') at the start of your UpdateEmailController, as the stub does, so an e-mail route added without the middleware is refused too.
There is no way back. See Two-factor authentication.
High: The cookie session driver is gone
Likelihood of impact: low — only apps that set SESSION_DRIVER=cookie.
A session kept in the cookie lives in the browser, so the server cannot end it: signing out other devices, a password change or AccountSessions.end() never reached it. SESSION_DRIVER accepts file (the default), database, redis or memory, and an app that still sets cookie fails at boot with a message naming the four.
Choose one: file, database (publish the table with make:session-table) or redis. Existing cookie sessions end once; users sign in again.
In code: CookieSessionStore (@marmeon/session) and COOKIE_SESSION_WARNING (@marmeon/auth) are removed; SessionConfig['driver'] no longer includes 'cookie', so a comparison against it stops compiling; new UserSessions(store) requires its store.
There is no way back. See Sessions.
High: Remember-me tokens are bound to the account state and need an account_fingerprint column
Likelihood of impact: high — apps made with make:auth and every app with its own RememberTokenStore or UserProvider.
Before, a remember-me token signed the account in as long as its row existed. Now each token stores the fingerprint of the account state the sign-in verified (the one sessions keep: a SHA-256 of the id, the password hash and the session key), and a cookie signs in only while the account still has it. A password reset, a new password, a new session key, AccountSessions.end() and a rehash after changed HASH_* costs therefore end every remember-me token of the account, not only its sessions. A token without a fingerprint is refused. attempt() also compares the account it verified with a fresh findById() after the password check, and answers invalid-credentials if the hash or the key changed meanwhile.
What the app has to do:
Add the column before the new code serves requests. Until
remember_tokens.account_fingerprintexists, remember-me sign-ins and requests with a remember-me cookie fail with a database error. Apps made withmake:authbefore this release need a migration, named with the current timestamp:import { defineMigration } from '@marmeon/database'; export default defineMigration({ up: (schema) => schema.alter('remember_tokens', (table) => table.string('account_fingerprint', 64).nullable()), down: (schema) => schema.alter('remember_tokens', (table) => table.dropColumn('account_fingerprint')), });Run it with
marmeon migrate. The remember-me cookies of existing devices stop working once; those users sign in again.A custom
RememberTokenStore:create(userId, expiresAt, fingerprint)takes the fingerprint (a third, required parameter), stores it and returns it fromconsume()asfingerprint.rebind(userId, cookie, fingerprint)is optional: it keeps the device that changes its own key (updateSessionKey(),logoutOtherDevices()) signed in. Without it that device signs in again.A custom
UserProvider:findForLogin()returnssessionKeyexactly asfindById()does. If only one of them returns a key,attempt()throws an error that names the provider.
There is no way back; a token without a fingerprint is never accepted. See Authentication.
High: marmeon start refuses a development NODE_ENV that comes from .env
Likelihood of impact: high — every app that runs marmeon start or pnpm start locally, and every server, container, CI job or end-to-end test that gets NODE_ENV from a .env file.
Before, marmeon start served the app with the development tools (Vite, devtools, mail previews, error pages with source code) whenever .env said NODE_ENV=development, which is what the starter .env says, and only logged a warning. Now marmeon start and the hidden marmeon serve exit with 1 before any app code loads when NODE_ENV=development or test comes from .env alone. The message names the way out. marmeon dev, a NODE_ENV set in the process environment, and a .env without NODE_ENV or with production are unchanged. queue:work and schedule:work only warn, as before.
What the app has to do:
- To try the build on your machine:
NODE_ENV=production marmeon start(pnpm startis the same, the app'sstartscript ismarmeon start). - To run the development stack through
starton purpose: setNODE_ENV=developmentin the shell, or usemarmeon dev. - Servers, containers, systemd units, CI jobs and
webServerentries of end-to-end tests that relied on.envforNODE_ENVsetNODE_ENV=productionin the real environment. The generated Docker image and a server that already sets it need no change.
The way back is NODE_ENV=development in the process environment, which is only worth it on a machine that is meant to run the development stack. See Configuration and Deployment.
Medium: A passkey confirms sudo mode, and some actions ask for the password again
Likelihood of impact: medium — apps that bind passkeys, and apps that call Passkeys.remove() or TwoFactor.regenerateRecoveryCodes() themselves.
A passkey proven now, with user verification, confirms sudo mode like a typed password, and a passwordless passkey sign-in counts as a fresh confirmation. So passwordRecentlyConfirmed() and confirmedPassword() no longer mean "a password was typed". This applies the moment the app upgrades: a passwordless passkey sign-in reaches confirmedPassword() routes straight away, whether or not the app adds the passkey confirmation routes. In a kit app made before this release the e-mail and API-token forms do not ask for the current password, so a passkey holder (who also passes confirmedSecondFactor()) can change the address or create a token until the app copies those fields. An action that lets whoever holds the passkey stay in the account has to ask for the current password in its own form, as the kit does for the e-mail change, API-token creation, removing any passkey and regenerating recovery codes.
Passkeys.remove(id, password)needs the password for every passkey; a call without one getsinvalid-password.TwoFactor.regenerateRecoveryCodes(password)takes the password and returns aResult(invalid-password|throttled) instead of the codes.- A
throttlederror from a password check may carryaccount: true: the account's cap held it up, and signing in again with the password lifts it. Password checks count per sign-in (5 a minute, 20 an hour) plus a per-account cap of 20 an hour for sessions that did not begin with a typed password. Existing sign-ins count against that cap until the user signs in again with the password.takePasswordCheck(),clearPasswordCheck()andAuth.passwordCheckScope()are public for app code. TwoFactorChallengeFailed.duringcan be'confirm'; an exhaustiveswitchover it stops compiling until it handles the value.- Apps built from the kit: copy the current-password fields on the e-mail, API-token and recovery-code forms first, then the passkey confirmation controllers and routes (
auth.password.confirm.passkey.options,auth.password.confirm.passkey), the newthrottle.ts(per sign-in, withauth) and the sign-out of other devices inRemovePasskeyControllerfrompackages/auth/stubs/react/modules/auth.
Sudo mode also needs a confirmation made within the current sign-in, a typed password or a passkey proven now. After auth.login(user) (a magic link, OAuth, impersonation) a route behind confirmedPassword() asks again, even once the second factor is completed. A confirmation older than the current sign-in, including one left in the session by an earlier account, does not count.
There is no way back. See Authentication and Passkeys.
Medium: Sign-ins, remember-me cookies and second-factor proofs have upper bounds
Likelihood of impact: medium — apps with twoFactor() areas, apps whose users stay signed in for more than a day, and apps with their own RememberTokenStore.
twoFactor()withoutmaxAgeaccepts a proof for 24 hours (TWO_FACTOR_MAX_AGE) instead of for the whole session; passmaxAge(seconds) for another window, there is no "never". A remember-me sign-in carries the proof of the device that made the token, so a token older than the window asks for the factor again.AUTH_REMEMBER_DAYSaccepts 0 to 30 (default 30); a value outside that stops the boot. A token older than the setting is refused even if its row says otherwise, andauth:prune-tokensdeletes it, so schedule that command (the kit runs it daily). With0no remember-me cookie is made, a presented one signs nobody in and the kit hides the checkbox.- A sign-in lasts at most
AUTH_SESSION_MAX_HOURS(default 24, up to 720) from the moment it was made, however active the user is, so users without remember-me are signed out 24 hours after signing in. A session restored by a remember-me cookie also ends with that token. Sessions open at deploy time start their clock at their next request, so this limit cuts nobody off at deploy. A valid remember-me cookie signs the user in again in the same request. Raise the value if 24 hours is too short; tests that jump the clock past 24 hours need a higher value too. - A custom
RememberTokenStore:prune(maxAgeDays: number)deletes expired tokens and those mademaxAgeDaysor more days ago, andconsume()must return a validcreatedAtandexpiresAt, or every remember-me sign-in is refused. - Apps made with
make:auth:ShowLoginControllerpassesremember: config.remember, andLogin.tsxrenders the checkbox only when it is true (see the stub).
The way back is a larger AUTH_SESSION_MAX_HOURS (at most 720) and a maxAge on twoFactor(); the 30-day cap on remember-me has none. See Authentication.
Medium: The session cookie ends when the browser closes
Likelihood of impact: medium — every app with sessions; no configuration changes, but what users notice does.
The session cookie and XSRF-TOKEN are sent without Max-Age. The server still ends a session after SESSION_LIFETIME of inactivity and a sign-in after AUTH_SESSION_MAX_HOURS, whatever the browser keeps.
- Users who do not tick "Keep me signed in" are signed out when the browser closes (unless the browser restores its session, and then it keeps the cookie).
- A guest's session data ends at browser close: the chosen locale, the intended URL, flash data and anything the app keeps in the session, such as a cart. Keep what has to outlive the browser somewhere else.
- Remember-me users go through a remember-me sign-in after every browser restart: the token rotates,
viaRemember()is true, the session is new (new CSRF token, no old input), sign-in events fire more often, andtwoFactor()areas ask again once the token's factor proof is older than theirmaxAge. - App tests that assert
Max-Ageon the session cookie orXSRF-TOKENneed updating.
There is no way back; remember me is how a user stays signed in across a browser restart. See Sessions.
Medium: A second factor, a passkey and an API token need a confirmed address
Likelihood of impact: medium — apps made with make:auth that let anyone register or have users with unconfirmed addresses, apps with a custom TwoFactorState, and apps that listen to TwoFactorDisabled or PasskeyRemoved.
Before, an account with an unconfirmed address could add an authenticator app or a passkey and create API tokens. Someone who registered a victim's address first could add a factor and wait; the victim's password reset did not remove it. Now the starter kit puts authenticator setup and confirm, the passkey options and store routes and API-token creation behind verified() in every registration mode, and an unconfirmed address sees a notice with a resend link instead of the setup controls. And a password reset of an account whose address was never confirmed (email_verified_at and first_verified_at are null) removes, in the same transaction as the new hash, every passkey, the authenticator (a pending setup too), the recovery codes and the API tokens.
What the app has to do:
- Apps made with
make:auth: copyroutes.ts(theverified()group for the factor and token routes), the two settings controllers and views, the language keys and theNotifyAboutTwoFactorDisabledandNotifyAboutPasskeyRemovedlisteners frompackages/auth/stubs/react/modules/auth. Your own routes that add a factor or create a token needverified()too. - A custom
TwoFactorStateimplementsremoveAll(userId): Promise<void>. TypeScript refuses a source without it, and a password reset throws aTypeErrorbefore the reset token is spent when the bound source has none. - Listeners:
TwoFactorDisabled.viacan be'reset'andPasskeyRemovedhas avia('user','reset'; jobs queued before the upgrade read as'user'). Handle the new value; the kit sends onedisabled_by_resetmail instead of one mail per factor. - The
UserProviderhas to loademail_verified_at. Without it the reset keeps the factors and logs a warning once. - Creating an API token now needs a confirmed address, like adding a factor.
There is no way back. See Security, Two-factor authentication and Email verification.
Medium: Open uploads are capped per session and in total
Likelihood of impact: medium — apps with file upload fields; forms that take many or large files in one session notice, and apps with an existing temporary_uploads table need one migration.
Before, a client could ask for any number of upload targets and leave the files unsent for a day. Now a session may hold UPLOADS_MAX_OPEN open uploads (default 20) with at most UPLOADS_MAX_OPEN_MB megabytes announced (1024), and all sessions together at most UPLOADS_MAX_OPEN_TOTAL_MB (10240, 0 turns this one off). Every open upload counts for at least 64 KiB. A target past a limit gets a 429 with Retry-After; a file larger than a limit could ever take gets a 422 with the real maximum. The bytes of a file are cut off at the announced size (a 413 above it), and on S3 the presigned POST binds that size. uploads:prune deletes unused uploads as soon as their token expires (UPLOADS_LIFETIME, default 120 minutes), not only after 24 hours; used uploads still go by age.
What the app has to do:
- An existing
temporary_uploadstable gets the two indexes the counts use. Add the migration shown in File storage, named with the current timestamp, and runmarmeon migrate. Without it the counts scan the table. Tables made by the currentmake:uploads-tablehave them. - Forms with many or large files per session raise
UPLOADS_MAX_OPENandUPLOADS_MAX_OPEN_MB, andUPLOADS_MAX_OPEN_TOTAL_MBfor a busy app. - Keep
uploads:prunescheduled every hour; it is also what frees the room an abandoned upload takes. - A client of your own has to announce the true file size with the target, as the built-in client does.
The way back is high values for the three variables, or 0 for the total; the per-session limits cannot be switched off. See File storage.
Medium: Vite reads no .env file and no VITE_* variable
Likelihood of impact: low — only apps that read import.meta.env.VITE_*, or set their own envDir or envPrefix in the Vite config.
Before, Vite read the .env* files and wrote every VITE_* variable that client code reads, from those files or from the process environment, into the public bundle. Now marmeon() sets envDir: false and a prefix no variable uses, so import.meta.env.VITE_* is undefined in client and server (SSR) code, without an error. MODE, DEV, PROD, SSR and BASE_URL stay. Without viteEnv, the plugin refuses at start an app's own envDir or envPrefix, and a prefix another plugin adds; the message names viteEnv: true.
What the app has to do:
- Move the values to shared props, or set
marmeon({ viteEnv: true })invite.config.ts(and invitest.config.tsif the tests read them). - An app that sets its own
envDirorenvPrefixfails to start until it setsviteEnv: true.
The way back is marmeon({ viteEnv: true }); then every VITE_* variable of the process and of the .env files is public again. See Vite.
Medium: Apps made with the starter kit copy its security fixes by hand
Likelihood of impact: medium — every app made with make:auth or create-marmeon before this release; the code stays as it is, the apps own their copies of the kit and only gain the fixes below when they copy them.
An app owns the files make:auth and create-marmeon wrote, so a framework update changes none of them. Each change below is in packages/auth/stubs/react/modules/auth (or the new-app template); compare your copy with it. Ordered by what it protects, security fixes first:
Sign-in limits per client and per account (security). Without them an IPv6 host owns a whole /64 of rate-limit buckets, one client can try unlimited passwords at argon2 cost, and guesses spread over many clients against one account are never stopped.
- Copy
AuthServiceProvider.ts(every address-based limit keys onclientKey(ctx.ip)from@marmeon/cache, and the newlogin-clientlimit of 30 a minute),controllers/LoginController.ts(the key islogin:<email>|<client>) androutes.ts(throttle('login-client')onPOST /login). In your own limiters, replaceby(ctx.ip)withby(clientKey(ctx.ip)). - For the ceiling of 100 failed password sign-ins an address may take a day (the 101st gets
auth.login.locked, even with the right password): copyaccount-failures.ts,jobs/SendLockoutMailJob.tsandmail/LockoutMail.ts, add thelogin.lockedandmail.lockout.*texts tolang/en.tsandlang/de.ts, register the job inindex.ts, and updateLoginController(takesQueue),ResetPasswordControllerandPasskeySignInController(takeRateLimiter). Anyone who knows an address can lock its password sign-in for a day; the owner gets back in with a password reset or a passkey. Use thedatabaseorrediscache store and keepcache:prunescheduled, since each address tried leaves a cache entry for a day. - If you keep
auth.test.ts,@marmeon/serverbecomes a dev dependency.
- Copy
A rehash never writes an old password over a reset (security). Without it, a password reset that lands between a sign-in's password check and its rehash is overwritten by the old password. In
UserRepository.ts,updatePasswordHash(id, hash, expected?)returns abooleanand writes onlywhere password = expectedin one statement (as the stub does; the column is a secret, so the comparison is a rawsqlfragment). A provider that returns nothing still works but keeps the race.Secret files stay out of git (security; new apps only get this by themselves). Without it only
.envis ignored, andmake:docker's.env.productionwith production secrets can be committed bygit add -A. Add to.gitignore:.env* !.env.example !.env.testRun
chmod 600 .env(a.envcopied from.env.exampleis readable by group and others;marmeon key:generatenow creates it as 0600 and tightens an existing one before writing the key). If.env.productionis already committed, rungit rm --cached .env.productionand rotate every secret in it..env.teststays committed, so it must never hold real credentials.At most one "account exists" mail per address and hour (security: abuse). Without it anyone can flood an owner's inbox through the public sign-up form of an app with private registration. Copy
jobs/SendAccountExistsMailJob.ts(it takes aRateLimiter, keys on the hash of the stored address and clears the window if mailing throws). The sign-up answer does not change.The remember-me mail (text and mails only). The owner is now told about every old or altered remember-me cookie, not only about the validator replaced just before. Reword
mail/SignInMail.tsand the matching keys inlang/en.tsandlang/de.tsfrom the stub.
There is no way back for the framework side; each copy is yours to take or leave. See Starter kit, Rate limiting and Configuration.
Low: Confirming a second factor can answer signed-out
Likelihood of impact: low — only apps with their own controllers for TwoFactor.confirm() or Passkeys.register(), or built from the kit before this release.
Confirming an authenticator app or registering a passkey checks, inside the transaction that stores the factor, that the session still belongs to the account. A sign-out elsewhere, a password change or a deleted account that lands first makes TwoFactor.confirm() and Passkeys.register() return the new error kind signed-out, and nothing is stored.
ConfirmErrorandRegisterErrorhave the new kind; an exhaustiveswitchover them stops compiling until it handles it.- Apps built from the kit: add the
signed-outcase toConfirmTwoFactorController(redirect toauth.login) andRegisterPasskeyController(answer 401), and letPasskeys.tsxgo to the sign-in on a 401, as inpackages/auth/stubs/react/modules/auth. - A custom
UserProviderwhoseupdateSessionKeyskips no-op writes must still returntrueforupdateSessionKey(id, k, k); a provider that answers otherwise gets an error naming the rule. TwoFactor's constructor takesConnectionsas its last parameter. Only code that builds it by hand notices; the container resolves it.
There is no way back. See Authentication.
Low: LiveStreamRequest takes accounts instead of account
Likelihood of impact: low — only code that calls LiveHub.open() itself.
A live stream is now filed under one keyed scope per key of APP_KEY and APP_PREVIOUS_KEYS, so an end announced during a key rotation closes the streams of processes on the old and on the new key alike. LiveStreamRequest.account?: string became accounts?: readonly string[]. The built-in live endpoint does this itself.
Code that calls LiveHub.open() passes accounts: LiveTokens.accountScopes(scope) instead of account: LiveTokens.accountScope(scope). TypeScript flags the old property.
The way back is none; the old property is gone. See Real-time.
Upgrading to 0.2.0 from 0.1.3
High: Every route has to say who may call it
Likelihood of impact: high — every app with routes that has not stated an access decision.
The app refuses to start (and marmeon route:types and marmeon build exit 1) while a route does not say who may call it. The
error is a RouteAccessError; it lists each route with its methods, path, name, controller and the file and line that registered it:
2 routes do not say who may call them:
GET /posts posts.index PostController modules/posts/routes.ts:4
POST /posts posts.store Closure modules/posts/routes.ts:5
Say it with one of these:
- can(Policy, 'ability', 'param') as the request's `authorize`, or on its registrar: Route.authorize(can(…))
- a check of your own: Route.authorize((ctx) => …) or `authorize` in defineRequest()
- everyone, last: Route.authorize(everyone) says anyone its middleware lets through may call it — nothing else about it is checked
See docs/authorization.md#every-route-decides.Start the app, then decide each route listed:
can(Policy, 'ability', 'param')wherever the route reaches a record that belongs to someone, as the request'sauthorizeor on the registrar:Route.authorize(can(…)).everyonewhere the route's middleware is the whole decision:Route.middleware(authenticate()).authorize(everyone), ordefineRequest({ authorize: everyone }).- A route file that decides once for all its routes:
const Route = Root.authorize(everyone). That is the old behaviour, now written down.
A route that is open to everyone and loads a record from the URL without scopedBy is refused as well. Give it a policy, scope the
binding (bind('child', Binder, { scopedBy: 'parent' })), or, for a route that only reads (GET/HEAD) and whose records are really public,
mark the binding bind('param', Binder, { public: true }). A write under everyone is never excused by public.
With tableRoutes(…) under a registrar that only says everyone, give every action, bulk action and export its own .authorize(…).
Router.dispatch refuses undecided routes and open unscoped bindings too, so tests that dispatch a route need a decision as well.
FRAMEWORK_ROUTES is no longer exported from @marmeon/http or @marmeon/router, and without that marker load() throws for any path
under /_marmeon/; a package that used it moves its routes to a prefix of its own and decides them like an app does. Routes are registered synchronously now: the root registrar is sealed once the route files have loaded, so a defineRoutes(async …)
callback, or a registrar kept and used after loading, fails at load. Move the await out of the route file.
A request's authorize that returns a truthy value other than true (possible from untyped code
only) now answers 403.
There is no way back to routes without a decision. See Authorization.
Medium: Auth.attempt() and Auth.login() can wait for a second factor
Likelihood of impact: medium — only when an account has a second factor (TwoFactorState bound); an app that does not bind two-factor authentication never sees the new case.
attempt() can now fail with { kind: 'two-factor-required', factors } after a right password, and login() returns
'signed-in' | 'two-factor-required' instead of void. In that case nobody is signed in: no Login event, no remember-me cookie.
A caller that ignores the new case leaves the user signed out.
Before:
const signedIn = await auth.attempt(email, password);
if (!signedIn.ok) throw new ValidationError({ email: ['These credentials do not match.'] });
await auth.login(newUser);
return redirect('/dashboard');After:
const signedIn = await auth.attempt(email, password);
if (!signedIn.ok) {
if (signedIn.error.kind === 'two-factor-required') return redirect('/two-factor-challenge');
throw new ValidationError({ email: ['These credentials do not match.'] });
}
if ((await auth.login(newUser)) === 'two-factor-required') return redirect('/two-factor-challenge');
return redirect('/dashboard');A switch over error.kind that is exhaustive fails to compile until it handles the new kind; the starter kit's login page and the
make:auth stub do. The way back is not to bind two-factor authentication: the case never occurs without it. See
Two-factor authentication.
Low: A custom RememberTokenStore has to return createdAt
Likelihood of impact: low — only apps with their own RememberTokenStore; the database store of @marmeon/auth already does.
consume() now returns createdAt next to userId, cookie and expiresAt: when the token was first made, kept across rotation,
written with the app's clock and a time zone. It must be the token's original creation time as a valid Date: never the time of
consume(), never new Date(). Two-factor authentication refuses a remember-me token whose createdAt is not after the factor was
turned on, so a wrong value lets tokens from before the factor through. TypeScript points to the store that lacks the field.
Before:
return ok({ userId: row.user_id, cookie, expiresAt });After:
return ok({ userId: row.user_id, cookie, expiresAt, createdAt: new Date(row.created_at) });There is no way back; the interface requires the field whether or not two-factor authentication is bound (at runtime it is read only with a TwoFactorState bound).
Low: LoginVia has a fourth member, 'passkey'
Likelihood of impact: low — only code that switches exhaustively over Login.via.
A sign-in with a passkey alone reports via: 'passkey' next to 'attempt', 'login' and 'remember'. A switch over
event.via that must be exhaustive fails to compile until it handles the new value; nothing changes at runtime for an app that does not
bind passkeys.