mirror of
https://github.com/penpot/penpot.git
synced 2026-11-19 08:30:42 +00:00
3867 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b7df44cad0
|
Merge remote-tracking branch 'origin/develop' into iop-vc-preview
Conflicts resolved as in git-cascade candidate ab64912569, with the design review migrations 0809 to 0814 kept after develop's 0158 and 0159. Fixes for develop's changes that merged without conflict: - files_branch.clj reads main FOR UPDATE: develop's get-file* refuses :lock-for-share? on a data read. - sidebar.cljs passes the scroll-store prop in review mode: develop removed the local scroll-store* atom. - The snapshot rename guard tests pass :file-id, now required by update-file-snapshot, and the branch import test expects develop's :not-supported refusal of every in-place import. AI-assisted-by: claude-opus-5-5 Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro> |
||
|
|
ea61730f61
|
✨ Add review mode, review comments and tasks to design reviews (#12939)
* ✨ Add review mode, review comments and tasks to design reviews A design review now opens a read-only review mode. The left panel shows the pages and layers with the View only badge, the toolbar offers the review tools (move, comment, comment an area, create a task, show the changes) and the right panel holds the inspect of the selection, the comments of the review and its tasks. A bar at the bottom names the review, shows the progress of its tasks and opens its details. Comments can point at a spot, a layer or an area, and a comment written in a review says so with its own mark, wherever the file is open. The layers panel counts the open comments of each layer. Tasks are new: work on a file, assigned to someone and tied to a layer or to a spot of the canvas. A comment can become a task and stays attached to it. A task moves through open, done, verified, reopened and won't do; anybody may move it, and each move is an event that records who made it. Deleting a layer with open tasks moves them to its board and offers to undo the deletion or to mark them done; a task can then be linked to another layer or get its layer back. Assignees are told by email. Merging a branch moves its tasks and their threads into main: the open ones keep going, the closed ones stay as its history, and the merge dialog lists them and can tell their assignees. The details of a review show its overview, its tasks and its activity: what the saves of the branch did to each layer since the review opened, by person and day, with the values before and after. The changes can be shown on the canvas one after another. The backend adds the review fields of a comment thread, the task and task event tables, the activity of a review (recorded by each save of a branch under review) and the commands of the tasks. * ♻️ Bring the design review styles and components up to the DS Move what the review UI repeated into the design system: layer-chip*, progress-bar*, comment-card*, link-button* and textarea*, each with its story and docs. The screens keep the look they had: the same review states compare equal, pixel by pixel, before and after. The stylesheets follow the rules of the UI guide: local variables for the colors that change by state, the right tokens, no unused imports and fewer element and nested selectors. What has no DS token or typography says so in a TODO. The aliases left in comments.scss resolve to their tokens. The components get complete schemas and a single owner for the copyright. Translations take literal keys and templates instead of dynamic keys and glued strings, and comments.cljs no longer depends on the review tasks: the workspace passes it what a thread shows about its task. Fix three bugs of the review: - The inspect took the width of a narrower panel and its height from the window, so it looked squeezed and cut its last rows. It now fills the panel that holds it. - Enter on the menu of a task opened the task. The row now reacts only to keys on itself, and the menu keeps Enter from the workspace shortcuts. - The resolved and lost marks ignored the pointer: hover now wins over the state of a mark. * ✨ Turn each review message into a task and restore the filter dropdown Each message of a thread can now become a task, so one thread can hold several. The new file_task.comment_id column records the message, the migration fills it with the first message of the thread for existing tasks, and the backend rejects a message from another thread or one that already has a task. Comments and tasks of a review behave like normal ones. The canvas marks show a short preview on hover and there is one mark per task. A blue label marks what belongs to a review, in the thread and in the sidebar, and a selected card takes a blue border there and the primary color elsewhere. The new review-label* component holds the label. The sidebar and the review panel go back to a filter dropdown in place of the chips. Comments offer the views all, yours and mentions, with an option to hide the resolved ones. Tasks offer all, yours, open and to verify, with an option to hide the closed ones. Resolved comments now show by default. "New task" outside a review now arms the task tool: it shows the task cursor and the next click opens the task form, not a comment. Then the comment tool returns, and Esc leaves the tool. The details modal shows changed properties in the format of the compare dialogs, and showing a task on the canvas syncs the WASM viewport. The sidebar cards put the layer chip on the line of the replies, and task states lose the dot and take a color each. Fix these bugs: - The hover card of the activity tab crashed on a change with no token. - The assignee and reviewer dropdowns came out cut. The select now portals into the closest dialog, because the modal makes the rest of the page inert. - The review label cut the header of the thread. It now sits below it. * ✨ Group overlapping review marks and let tasks change assignee Comments and tasks of a review that fall on the same spot now show as one mark with a counter in a white bubble. A click fans them out, as the comment bubbles do, and the user picks one. They group on the same layer and, by proximity, at a low zoom. The card of the mark lists up to five items. Hovering a mark outlines its layer, or its board when the layer is gone. The WASM viewport draws no outlines under the comments tool, so it now draws the highlighted ones there. Opening a comment from a mark closes the open task. A task can change assignee from the selector in its state and from "Assign to" in its menu, which holds the team in the same popover. The change shows right away and goes to the history of the task. A closed task keeps its assignee. Deleting a task or a comment now asks first, with the usual confirmation. A task deleted from the details of a review brings the dialog back on its tab. The state of a task takes two rows, in its panel and in a thread: state and layer, then assignee and the review it comes from, which a review omits. The text of tasks and comments sits in a box. The history no longer says that the task was created. * ✨ Keep the branch bar and the palettes at one level on a branch The open branch bar covered the horizontal scroll of the canvas. It now sits as far from the bottom as the review bar. Folded, it stays flush. On a branch the palettes no longer lift over the branch bar: both sit at the same level and work as a toggle. Opening one folds the other, also through the palette shortcuts, and both can stay folded. The new `:bottom-bar` state says which one is open. It exists only while the branch bar does, so a file that is not a branch keeps the palettes on their layout flags and at their usual place, and what happens on a branch does not reach them. The branch bar comes open on a branch and centers on the canvas, not on the window, so that it clears the folded palettes at usual widths. The room it published for the palettes goes away with the lifting. * ✨ Give every task a thread and tidy the design review screens Every task now lives in a message of a comment thread, so anyone can go on commenting on it. A task made from scratch gets a thread whose first message is its title, on its layer and in its review, created in the same transaction. A comment turned into a task keeps its thread, as before. The panel of a task with no thread is gone: a task always opens as its thread. Migration 0814 gives a thread to the tasks that had none. Deleting a thread deletes its tasks, after a confirmation that says so. The anchor of a task was a plain map, not a point, so a thread on a layer refused replies. It is now a point. The details of a review filter the tasks by state with the chips of the activity, in the colour of each state, and show how many are closed on the right. The "New task" button leaves the dialog. Descriptions look the same everywhere: the box of the branch info dialog, an "Edit" button and a dashed box when empty. Read, they grow up to 400px and scroll inside; edited, the textarea starts at 400px. The text of a review in the sidebar does the same once unfolded. In the review bar, the author gets a "Publish latest changes" button when the branch moved past the review, with a hint that approvals must be renewed. The others keep a badge, now "Unpublished changes", with a hint. The bar refreshes once the publish lands. Smaller changes: the resolve checkbox lines up with the task button and has a tooltip, messages sit in a filled box, task events take an outline, and the change navigator sits right above the review bar. * 💄 Sort the test runner requires that cljfmt rejects The Frontend Tests lint step fails on runner.cljs: the requires for workspace-tasks-test, review-details-test and review-markers-test sat out of alphabetical order. This is the output of cljfmt fix. AI-assisted-by: claude-opus-5-5 Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro> * 🐛 Test the design review mode in the pull request spec The review bar replaced the branch banner, so four tests still drove the branch bar: a visible Compare button, the rectangle tool and the Review button. They now drive the design review instead. * Opening a file with a pr-id enters the review: the bar names the review, the header trades the file name for the review title, and comparing, merging and cancelling sit in the bar's options menu. * The compare dialog opens from that menu. * The review is read-only rather than an editable file: the review toolbar offers its five tools, the drawing tools are gone, the sidebar says View only, and the right panel is the review's own Inspect, Comments and Tasks tabs. * The verdict comes from the bar's Submit review button and the dialog it opens, scoped by role so the bar action and the dialog action do not collide. The tests also reach the review bar by its region label instead of walking up three parents from the Reviewing the design review text, which broke as soon as the bar's markup changed. AI-assisted-by: claude-opus-5-5 Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro> * 🐛 Count only the test thread's acquisitions in the climit test acquires-the-command-own-limits-before-the-root-limits failed on CI with an extra "root/global" ahead of the expected order. The test records metrics through with-redefs, which is global, so a call of another thread of the test JVM, such as an RPC an earlier test left running, can take a root limiter inside the window and land in the same atom. Record the thread with each metrics call and keep, in acquired-in-order, only the acquisitions of the calling thread. Both tests that read it acquire their limiters on the test thread. The same class of flake was fixed on develop for the waiting-count test (12d73d0f63); this one is still open there. AI-assisted-by: claude-opus-5-5 Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro> * 📚 Describe the task moves the server allows in the table comment The comment on file_task said a task is reopened only from done and that editors move tasks. files_task.clj::transitions also reopens a verified or won't-do task, and set-task-status lets anybody who can read the file move one. Say the same in the schema. AI-assisted-by: claude-opus-5-5 Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro> --------- Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro> Co-authored-by: Álvaro Tejero Cantero <alvorithm@teje.ro> |
||
|
|
78cfe7fa58 | Merge remote-tracking branch 'origin/staging' into develop | ||
|
|
114ce6ec03
|
✨ Make legacy-db file data read-only (#13102)
legacy-db is no longer a write backend: fdata/upsert! rejects it (:legacy-backend-read-only), handle-persistence stops writing file.data and file_change.data, and the update-params schema of fdata no longer accepts it. Reading old payloads keeps working, and the file-data-backend default stays db. The configuration guide, the backend config (a startup warning reads PENPOT_FILE_DATA_BACKEND=legacy-db as db instead of failing every save) and the storage memories say so, with the upgrade note for deployments that still set the variable. AI-assisted-by: deepseek-v4.1-flash AI-assisted-by: inkling-2-small-free |
||
|
|
d97972c81d
|
🐛 Build the SSO redirect target on the server (#12952)
* 🐛 Build the SSO redirect target on the server The organization SSO flow took the destination URL from the client and redirected to it after the identity provider round-trip, so any authenticated profile could point that redirect at another domain: the server never checked where the URL came from. The RPC now takes the route token of the client (?screen=...¶ms) and the server builds the destination out of it: the public URI plus the query string, parsed and rendered back. The destination can no longer leave the public URI, and the callback checks it again before redirecting, which covers the state tokens minted before the change. The state token also carries the profile that started the flow, so only that session is granted the organization SSO entry: a state prepared by someone else cannot mark the session of the one that completes it. Whenever the RPC receives an organization id (it always comes from the client), it also checks that the profile is a member of the organization or its owner, instead of letting any profile start a flow for an organization it does not belong to. Tests cover the destination builder, a callback that ignores a destination outside the public URI, a state that does not grant the SSO entry to another session, and the organization access check. AI-assisted-by: minimax-m3.1-flash * 🐛 Check the SSO redirect target against the public URI The callback compared the destination with a string prefix, so the two bypasses the advisory documents (a userinfo prefix and a look-alike host) were closed only by the trailing slash of the public URI. The check now compares the parsed origin (scheme, host case-insensitive, port with the default made explicit) and requires the path to be under the base path of the public URI, so neither bypass passes. The client sent `location.search`, the history token, whose leading `?` is URL syntax and no part of a query string. It sends the query string proper now (`screen=…¶ms`) through `rt/get-current-query-string`, and `rt/token->query-string` is the single bridge between the two shapes: every other consumer concatenates the token over the base path. The server puts the separator back when it joins the destination, and trims one that still arrives, so a browser holding the previous bundle keeps its destination while the new one rolls out. Building the destination can no longer break the flow: it catches its own errors and lands on the public URI, which matters in the deployments where the browser origin differs from the configured one. A value that is not a route is ignored with a warning, decided by the keys it parses into (a URL becomes a single key holding the whole URL), and a route with no `screen`, like the root params of the application (`template=…`), stays a usable destination. The organization membership lookup is now shared by the check that gates the SSO flow and the one that raises, so the two cannot drift apart, and the docstring of the RPC lists `:no-organization-access` next to `:no-team-access`. `rt/nav-raw` returns its `:href`/`:uri` through `@event`, as its sibling `rt/navigate` already did. Nothing in the app listens to `::rt/nav-raw`, so the callers behave the same; the SSO test now reads the destination from the event instead of intercepting the helper. Tests cover the two bypasses and the base-path rule, the RPC with an unusable destination, the value that is not a route, the request that carries both ids, an organization that does not exist, the query string the frontend sends, and the two router helpers. AI-assisted-by: minimax-m3.1-flash * ♻️ Deduplicate SSO destination URL building The backend had an unreachable blank check and a one-line wrapper around the URI helper in build-dest-url. On the client, the SSO retry and error flows each assembled the destination from public-uri and the route params. Flatten build-dest-url with a cond and call u/query-string->map directly. Add rt/token->url as the single client helper for absolute route URLs, with tests for both token shapes and for a blank token. Update the routing memory with the new helper contract. AI-assisted-by: hy4-flash-free |
||
|
|
0fda857426
|
🐛 Invalidate all sessions on password recovery (#12967)
* 🐛 Invalidate all sessions on password recovery recover-profile validated the recovery token and updated the password, but never deleted the existing server-side sessions in http_session_v2. A previously captured auth-token kept working after the victim "recovered" the account (GHSA-3j2p-qr45-q365, CWE-613). The command now calls session/invalidate-all for the recovered profile. The command already runs with ::db/transaction true, so the delete joins the same transaction as the password UPDATE: both commit or roll back together. There is no current session to preserve — the RPC is unauthenticated — which is the same contract the profile deletion path uses. Tests in rpc_auth_test.clj pin the behavior: the victim's sessions die, other profiles' sessions survive, and a failed recovery is a no-op. Both invalidation tests failed before the fix. AI-assisted-by: inkling-2-small-free * 🐛 Pin recovery-transaction atomicity after review Review of 92a65f544b found the tests pinned the end state but not the rollback guarantee the fix relies on: the session DELETE joins the password UPDATE in one transaction. Add recover-profile-rollback-keeps-password-and-sessions: send-template throws after the update, so the command must fail with password and sessions both untouched. recover-profile-failure-keeps-sessions now also asserts the password, matching its docstring. The invalidate-all docstring mentions the recovery caller. Addresses review findings M1, M2 and M3. AI-assisted-by: inkling-2-small-free * 🔥 Drop recovery test that never reached the fix The failure test used a token with the :authentication issuer, so tokens/verify rejected it before any write. It passed with or without the invalidation fix and exercised no new code. The rollback test already covers that a failed recovery leaves no partial effects. AI-assisted-by: hy4-flash-free |
||
|
|
c0f746ee34
|
🐛 Apply the invite policy to pending invitations (#13080)
* 🐛 Apply the invite policy to pending invitations * 📎 Code review |
||
|
|
ba0eab57ab
|
🐛 Hide team plan from every member when owner has Enterprise (#13079) | ||
|
|
99497d3b7c
|
⬆️ Update dependency pnpm to v12.21.0 (#13063)
- pnpm 12.21.0 (docker/images/Dockerfile.media-processor) - pnpm 12.21.0 (docker/images/Dockerfile.mcp) - pnpm 12.21.0 (docker/images/Dockerfile.exporter) - pnpm 12.21.0 (docker/devenv/Dockerfile) - pnpm 12.21.0 (render-wasm/package.json) - pnpm 12.21.0 (plugins/package.json) - pnpm 12.21.0 (plugins/libs/plugins-styles/package.json) - pnpm 12.21.0 (plugins/libs/plugins-runtime/package.json) - pnpm 12.21.0 (plugins/libs/plugin-types/package.json) - pnpm 12.21.0 (plugins/apps/table-plugin/package.json) - pnpm 12.21.0 (plugins/apps/rename-layers-plugin/package.json) - pnpm 12.21.0 (plugins/apps/poc-tokens-plugin/package.json) - pnpm 12.21.0 (plugins/apps/poc-state-plugin/package.json) - pnpm 12.21.0 (plugins/apps/plugin-api-test-suite/package.json) - pnpm 12.21.0 (plugins/apps/lorem-ipsum-plugin/package.json) - pnpm 12.21.0 (plugins/apps/icons-plugin/package.json) - pnpm 12.21.0 (plugins/apps/example-styles/package.json) - pnpm 12.21.0 (plugins/apps/e2e/package.json) - pnpm 12.21.0 (plugins/apps/create-palette-plugin/package.json) - pnpm 12.21.0 (plugins/apps/contrast-plugin/package.json) - pnpm 12.21.0 (plugins/apps/composable-test-suite/package.json) - pnpm 12.21.0 (plugins/apps/colors-to-tokens-plugin/package.json) - pnpm 12.21.0 (package.json) - pnpm 12.21.0 (media-processor/package.json) - pnpm 12.21.0 (mcp/packages/server/package.json) - pnpm 12.21.0 (mcp/packages/plugin/package.json) - pnpm 12.21.0 (mcp/packages/common/package.json) - pnpm 12.21.0 (mcp/packages/browser-extension/package.json) - pnpm 12.21.0 (mcp/package.json) - pnpm 12.21.0 (library/package.json) - pnpm 12.21.0 (frontend/text-editor/package.json) - pnpm 12.21.0 (frontend/packages/ui/package.json) - pnpm 12.21.0 (frontend/packages/mousetrap/package.json) - pnpm 12.21.0 (frontend/packages/draft-js/package.json) - pnpm 12.21.0 (frontend/package.json) - pnpm 12.21.0 (exporter/package.json) - pnpm 12.21.0 (docs/package.json) - pnpm 12.21.0 (common/package.json) - pnpm 12.21.0 (backend/package.json) Signed-off-by: penpot-renovate[bot] <338182062+penpot-renovate[bot]@users.noreply.github.com> |
||
|
|
27784f70ac
|
🐛 Fix custom CJK fonts losing glyphs when converted to TTF (#13074)
FontForge opens a CID-keyed OpenType font as several sub-fonts, and Generate() writes only the active one. Most CJK fonts use this layout, so the TTF used by the render-wasm renderer kept only a few hundred glyphs (the Latin sub-font) and lost its family name. Merge the sub-fonts with CIDFlatten() before generating, both in the backend and in the media-processor. The call is guarded because it fails on fonts that are not CID-keyed. Add a small synthetic CID-keyed font with two sub-fonts as a fixture and check that the converted TTF keeps all its glyphs. Closes #10976 AI-assisted-by: claude-opus-5-5 |
||
|
|
e95007a93b |
🐛 Retry the publish of the websocket delivery assertions
The subscription to the bus reaches redis through an asynchronous agent action, so a message published right after the connection opens can be lost before redis knows the subscription. The delivery assertions of the websocket tests published once and bet on winning that race, which fails on a loaded CI runner. `poll-published!` publishes, drains a window and publishes again only when the window saw nothing, up to three attempts. The assertion still proves that the client receives a message it published, and the negative assertions keep the single drained window they need. A test pins the retry so it does not go back to a single publish. AI-assisted-by: deepseek-v4.1-flash |
||
|
|
86eb0bf805 | Merge remote-tracking branch 'origin/staging' into develop | ||
|
|
7ef8c1cf36 | Merge remote-tracking branch 'origin/staging-2.19.x' into staging | ||
|
|
861bb5bb37 |
🐛 Fix database pool min-size falling back to max-size (#13052)
* 🐛 Fix database pool min-size falling back to max-size Since 2.16 the pool minimum defaults to the maximum (60), so an idle backend opens and holds 60 connections at startup. Restore the pre-2.16 default of 0 so the pool grows with load and idle connections expire. Closes #12622 Signed-off-by: Usama Sadiq <usama7274@gmail.com> * 📚 Document database connection pool settings Describe PENPOT_DATABASE_MIN_POOL_SIZE and PENPOT_DATABASE_MAX_POOL_SIZE, their defaults, and sizing on a PostgreSQL shared with other apps. Signed-off-by: Usama Sadiq <usama7274@gmail.com> --------- Signed-off-by: Usama Sadiq <usama7274@gmail.com> |
||
|
|
e23ca02aa2
|
✨ Reference the file data storage object with a foreign key (#12769)
* ✨ Reference the file data storage object with a foreign key The file data pointer lived in `file_data.metadata.storage-ref-id`, a JSON key. The storage GC parsed it to find live references, and nothing stopped it from physically deleting an object a live row still pointed at: a failure in that scan lost the blob. Migration 0159 moves the pointer to a nullable `storage_object_id` column on `file_data`, backfills it from the metadata key, removes the key from the rows it backfills, indexes the column and rebuilds the foreign key to `storage_object(id)` as `NO ACTION DEFERRABLE INITIALLY IMMEDIATE`. `INITIALLY IMMEDIATE` is deliberate: the GC catches the violation inside the chunk transaction, while a deferred check would fire at commit, outside it, and the sweep would never move past the blocked chunk. The column is the only source of truth. The `storage-ref-id` entry is gone from the file metadata schema, and the single point that serializes the metadata drops it, so no write can resurrect it. `upsert!` does not query the row: the pointer of the row being replaced travels in its params, and the object is touched before the row is written. Fragments and snapshots pass nil because a modified pointer always gets a new id; the offload passes its own row; `insert-file!` drops it, since an INSERT never replaces a persisted object. `update-file!` takes the file map read from the database plus the fields to change and merges them, so the pointer comes from the read map and no caller can lose it by building a partial map. A map without `:data` raises `:missing-file-data`: it is not `assert`, which is compiled out in the deployed binary. The params cannot override the pointer or retarget the write with `:id`/`:file-id`. `bfc/file->response` strips the pointer from every response (`get-file`, `create-file`, `duplicate-file`, the view-only bundle, the team access request, the comments read, the library summary, the snapshot read and the debug download). A `file-data` object is authentication-only, so a leaked id would let any logged-in profile fetch the blob from `/assets/by-id`. `get-file-fragment` resolves through the file data backend, so a fragment on cold storage no longer hands nil to `blob/decode`, and answers only the keys of its result schema. The storage GC reference scan, the restore union and `objects-gc` read the column. The offload reads `SELECT fd.*`, so its rows go through a `decode-row` that decodes jsonb metadata and drops a JSON null, which the row schema rejected; a row without a readable object raises `:missing-storage-object` with the file and row ids. A chunk blocked by the foreign key (SQLState 23503) is a real anomaly, since the reference scan should have frozen the object: it stays an error with its own hint and the chunk is retried on the next run until the reference is fixed. The release is a coordinated restart, not a rolling deploy, and not rollback-safe for the rows it writes: the previous code writes and scans the metadata pointer, so a key it writes misses the backfill and removing it loses the reference. `operations/2.20.0-file-data-storage-object-id.md` builds the column, the index and the foreign key online and runs the backfill with every instance stopped, then marks the step as applied; a fresh or small instance does the whole job in the migration. The runbook keeps the validation scan out of the stopped window and adds a lock timeout and retry to the online statements. Tests cover the foreign key shape, the backfill and its corrupt and orphan guards, the rebuild of a missing index and of a wrong, non-deferrable or deferred constraint, the deletion refused by a live reference, the metadata cleanup, the offload row normalizations, the touched objects of the unshare and the restore, the response stripping on every call site and the chunk blocked by the foreign key. The backend memories and the developer guide document the pointer, the GC behavior and the two migration paths. Closes #12768 AI-assisted-by: deepseek-v4.1-flash AI-assisted-by: inkling-2-small-free * 🐛 Hold the file row lock across the migration write `get-file` applies the pending migrations in memory and, when it finds any, persists the result. That write read the row without a lock and `update-file!` is an unconditional UPDATE, so a save that committed in between was overwritten: the saved content, `revn` and `modified-at` went back, the next save from that client failed with `:revn-conflict` and the object the save left became an orphan the storage GC cannot revisit once it is frozen. The read now runs in a transaction of its own (`get-file` calls `get-file*` inside `db/tx-run!` and accepts a cfg map only), so the `file` row lock covers the re-check and the write. `get-file*` reads the row once (`sql:get-file` plus `resolve-applied-migrations`) and completes it with `attach-file-data`; only when a migration is pending it reads the file again under `FOR UPDATE`, re-checks `need-migration?` on that fresh map and persists it (`migrate-file`). The common case stays at one row read and one migrations resolution, the migration case keeps a single decoded copy in the heap, and a row that changed in between is not overwritten. A migration found on the unlocked read is applied in memory only, for the next read to persist. `migrate-file` returns the reattached map when it persists, with the `:storage-object-id` of the row the write left, and the realized map when it does not; `:realize?` is what returns the read fully plain. `fdata/upsert!` answers `{:written ... :storage-object-id ...}` instead of a boolean, `update-file!` propagates it and the migrating read puts it back in the map it returns, so a caller that persists again touches the current object instead of the replaced one. `insert-file!` keeps nil: an INSERT never replaces a persisted object. The write also compares the stored pointer with the caller's value (`IS NOT DISTINCT FROM`) and raises `:stale-file-data-pointer` when it affects no row. Every writer holds the `file` row lock, so a pointer that no longer matches is a protocol violation, not a race to retry. The expected pointer is a separate argument because the storage branch replaces `:storage-object-id` before the upsert, and the check lives in `upsert-in-database`: the `legacy-db` branches do not use that SQL and their count can legitimately be zero. The save, snapshot and restore-backup reads take `FOR UPDATE` instead of `FOR SHARE`: they inherit the lock, and the migration branch asks for the exclusive one in the same transaction, so a shared lock that upgrades deadlocks two concurrent readers. A data read rejects `:lock-for-share?` for the same reason; only row-only reads accept it. `sql:get-file-without-data` is a plain select now, not a CTE, which makes locking legal without loading the data. Realization has a single owner: `attach-file-data` only resolves and decodes, and `get-file*` realizes once per path. The applied migrations no longer travel in the `get-file-with-summary` response, cache hit and cache miss alike. `embed-assets` reads each library without `:realize?`, so its `:components` is an unloaded pointer map; `absorb-assets` walks it with `vals`, `PointerMap.seq` calls `load!` and that raised with no loader bound, so every export with `:merge-libraries` of a library with components failed. The absorb runs under the library's own loader now. The in-place binfile import (`import-file-and-overwrite*`, `::overwrite`, `::bfc/file-id`) had no product caller and cannot carry the previous `storage_object_id`, so overwriting a storage-backed row would leave its object unreclaimed. `import-files!` rejects a cfg with `::bfc/file-id` (`:not-supported`) and the helpers only that path used go with it (`invalidate-thumbnails`, `*reference-file*`, the `::overwrite` id branch of `index-object` and of `save-file!`, the `on-conflict-do-nothing?` flag of the media insert). Tests: a new `file-migration-read-test` pins the single read, the locked re-read, the concurrent save interleaving, the double migration and the read-only path; the upsert tests cover the return shape and the stale pointer; the SQL recorder they share lives in `backend-tests.helpers`, and the save, snapshot, restore and summary sequences follow the new reads. The backend memories document the read contract and the pointer. AI-assisted-by: deepseek-v4.1-flash * 🐛 Harden the get-file guard and skip its read-only transaction The cfg guard of `get-file` was an `assert`, which `app.config` elides when `:backend-asserts` is off, so a deployed binary accepted a bare pool or connection while the docstring promised it raises. It throws `IllegalArgumentException` now, the class the option guards of the same namespace already use, and the existing test expects it instead of `AssertionError`. A read with `:read-only?` applies the pending migrations in memory and writes nothing, so the transaction the migration write needs only costs two round trips there. `get-file` runs it with `db/run!` instead: with a cfg that carries a connection it still joins the caller's transaction, and only the reads that would have opened their own skip it. A lock option needs a read-write transaction from the caller, because PostgreSQL rejects row locks in a read-only one; the docstring states that. Tests: the guard test expects the new class; a cfg marked `::db/read-only` reads a pending migration without persisting it (the config flag that fills that key is legacy, but the key is set by hand); and a read-only read is pinned as not opening a transaction while the same call without the option does. The backend memory documents the split and the guard. AI-assisted-by: deepseek-v4.1-flash |
||
|
|
dc340f74af
|
🐛 Fix database pool min-size falling back to max-size (#13052)
* 🐛 Fix database pool min-size falling back to max-size Since 2.16 the pool minimum defaults to the maximum (60), so an idle backend opens and holds 60 connections at startup. Restore the pre-2.16 default of 0 so the pool grows with load and idle connections expire. Closes #12622 Signed-off-by: Usama Sadiq <usama7274@gmail.com> * 📚 Document database connection pool settings Describe PENPOT_DATABASE_MIN_POOL_SIZE and PENPOT_DATABASE_MAX_POOL_SIZE, their defaults, and sizing on a PostgreSQL shared with other apps. Signed-off-by: Usama Sadiq <usama7274@gmail.com> --------- Signed-off-by: Usama Sadiq <usama7274@gmail.com> |
||
|
|
9c5260314a
|
🐛 Revoke websocket subscriptions when access is revoked (#12189)
* 🐛 Revoke websocket subscriptions when access is revoked GHSA-m53j-2766-6jqw. A websocket subscription was authorized once, when it opened, and that decision was trusted for the rest of the connection's life, so a member whose access was revoked kept receiving live file content as long as the tab stayed open. The revocation travels over the message bus instead of closing the socket from the mutation: the connection registry is local to one backend instance, while the RPC that revokes access runs on whichever instance received the request. Every instance re-verifies the subscriptions it owns with the same `has-read-permissions?` predicates that `:subscribe-file` and `:subscribe-team` authorize with, so a downgrade to viewer keeps its subscription and a non-member organization owner keeps read-only access. Two mechanisms cover each other: - Access-changing mutations announce after the write. delete-team- member, leave-team, update-team-member-role, delete-file, delete-project, move-files, move-project and delete-team announce. delete-share-link is deliberately excluded: a share-link visitor never passes the subscribe permission check, so there is no subscription to revoke. Team-wide changes publish one event per team; the watcher resolves the members itself, and both publishers defer through `db/after-commit` so the watcher never decides from pre-commit state. - Every relay re-checks access every 5 minutes by default (`subscription-revalidation-interval`), driven from the relay loop with `alts!` over the subscription channel and a one-shot tick channel, so a steady stream of edits cannot push the check away forever. Supporting changes: - The registry holds `:connections` and `:by-profile` in one atom, kept consistent by register/unregister in a single swap!; a profile lookup is one map access, and a profile whose last connection leaves is dropped from the index. - `close-file-subscription` and `close-team-subscription` announce the :leave-* message, close the relay channel and purge the bus subscription, and are idempotent. Closing the channel ends the relay loop and its re-check task. - The permission query the re-check uses filters soft-deleted files, projects and teams, matching its sibling queries. - A transient database error fails open: it logs and keeps the subscription; the next tick retries. - The revocation watcher's params schema declared the nitrate client as a bare keyword inside [:map ...], which malli resolved as a registry lookup and which took the whole system build down under enable-backend-asserts. It is now an explicit pair, optional because init-key yields nil with the admin-console flag off. The tests reproduce the leak against the real message bus, including the negative control for the interval re-check. The written records live in mem:backend/websocket-subscriptions. Closes #12155 AI-assisted-by: space-bunny-free AI-assisted-by: muse-spark-1.3-contributor * 🐛 Mirror the subscribe gates in the revocation re-checks Addresses the second review round on PR #12189 (pabloalba). The re-checks only asked whether the profile could read. The membership legs of sql:file-permissions filter soft-deleted rows since the F2 fix, but the organization-owner fallback grants read-only access over HTTP without looking at deleted_at, so a soft-deleted file or team kept an expelled org owner subscribed indefinitely. The re-checks now gate on existence as well: file-readable? and team-readable? require a live row (db/get*, non-throwing, soft-deleted rows excluded) plus the read permission, mirroring the :subscribe-file gates and extending them to teams. Both relays and revalidate-profile-subscriptions use them; the subscribe handlers keep their exact behavior. Also from the same review: - watcher-consumes-revocation-events-from-the-bus no longer races the command's after-commit announcement: it takes access away with a direct row delete and drives the watcher with a synthetic bus event, instead of deleting through the command and publishing a second notify-* that would mask a broken command announcement. - moving-a-project-closes-source-team-subscriptions pins the move-project e2e: the file subscription drops, the source-team subscription survives (membership unchanged). - soft-deleted-file/team-closes-org-owner-subscription cover the new gate with red-before/green-after tests. mem:backend/websocket-subscriptions updated. Closes #12155 AI-assisted-by: inkling-2-small-free * 🐛 Refuse dead teams in resolve-team-id (PR #12189 review) Second review round on PR #12189 (pabloalba). The file re-check added in 87ca7aca53 stops at the file row, but the organization-owner fallback grants read-only access to non-member org owners via Nitrate over HTTP, which knows nothing about Penpot soft-deletion. resolve-team-id resolved the team from unfiltered SQL, so an expelled org owner kept the file subscription open for an indefinitely soft-deleted file, project or team. Now both SQL lookups filter deleted_at, and resolve-team-id checks the team row itself (db/get*, which filters soft-deleted rows) for every caller — teams, projects and files alike. Also from the same review: - file-readable? now uses the same sql:get-minimal-file as the subscribe gate (non-throwing via throw-if-not-exists false), and team-readable? projects id and deleted-at, so db/get* can filter. - The test suite extracts the thrice-duplicated raw delete into delete-team-membership!; a sibling of the fail-open pin now redefs the existence probe to throw; memory and docstring aligned with the code. - docs/technical-guide/developer/architecture/backend.md attributed the websocket to notifications.clj; it now names app.http.websocket as the owner and notifications.clj as the revocation publisher. - mem:backend/auth-permissions-product-domains documents the fallback mechanism and the resolve-team-id contract. Closes #12155 AI-assisted-by: inkling-2-small-free * 🐛 Test resolve-team-id refusal and tidy review findings Third pass over PR #12189 after review-code on 225eb98de2. resolve-team-id now has a direct test: all three branches resolve while rows are live, and file, project and team soft-deletes each refuse their branch — the two new SQL predicates and the final team-row check are all pinned by it. From the same review: - failing-existence-check-keeps-the-subscription and the sibling a-failing-check-keeps-the-subscription are deleted: they could not distinguish a live relay from a dead one. The fail-open policy remains documented in the docstring and the memory; the memory no longer claims the pins exist. - team-readable? projects ::sql/columns like the rest of the backend; the fully-qualified keyword went away with the new alias. - The dead when-not guard in get-organization-owner-viewer-team is removed (resolve-team-id guarantees the row live); the let binding in resolve-team-id no longer shadows the destructured team-id. - docs/technical-guide names rpc/notifications.clj as the publisher and the tree lists the real top-level modules. Closes #12155 AI-assisted-by: inkling-2-small-free * 🐛 Make the revocation tests deterministic Third review round on PR #12189 (pabloalba). Both tests took access away through a command that announces, so the live watcher could close the subscriptions before the test looked: - revocation-closes-subscriptions-that-are-no-longer-authorized asserted an exact count of 2 closes after delete-team-member, and that count reads 0 whenever the watcher got there first. It now removes the member with delete-team-membership!, the raw row delete that publishes nothing, and asserts both subscriptions are still open before calling revalidate-profile-subscriptions. - team-event-closes-every-member-subscription ran delete-team and then published a second notify-team-permissions-changed, so a missing announcement in delete-team still passed. It now soft-deletes the team row (sql:team-members joins team_profile_rel and profile only, so the watcher still resolves every member), asserts nothing closed, and drives one synthetic team event. The command paths stay covered by the announce and end-to-end tests for delete-team-member and delete-team. The file split the reviewer suggested stays the optional follow-up, tracked outside this PR and waiting for the merge. Closes #12155 AI-assisted-by: deepseek-v4.1-flash |
||
|
|
f3c1230b79
|
🐛 Allow OIDC registration with password login disabled (#12974)
* 🐛 Allow OIDC registration with password login disabled The register-profile command rejected every registration without the login-with-password flag, including SSO ones, while the OIDC callback already allowed :oidc-registration as an alternative, so new OIDC users were stuck at the register screen with a 400 registration-disabled error. The gate now branches on the verified token backend: password tokens keep the previous checks, SSO tokens only require :registration or :oidc-registration through a predicate shared with the callback, so the two gates cannot drift apart again. Flags and invitation checks are split into single-responsibility helpers, and tokens without a backend claim are rejected loudly by schema instead of defaulting silently. Covered by regression tests for the SSO matrix, canceled invitations, the missing-backend case and the no-password-fallback, plus a configuration doc note. Closes #12964 AI-assisted-by: Muse Spark 1.3 Contributor * 🐛 Gate SSO registration by provider type, accept invitations Follow up the review on #12974. The SSO registration gate now treats a team invitation token as a substitute for :registration / :oidc-registration, in both the OIDC callback and register-profile, mirroring the password flow: the callback redirects to the register screen when an invitation is present, and register-profile revalidates the invitation row under a row lock before creating the profile when no SSO flag is set, raising :invalid-token instead of creating an account that cannot join a team. The SSO branch is restricted to OIDC-typed backends (oidc-provider-types); a prepared-register token carrying any other backend is rejected with :invalid-token instead of silently taking the SSO rules. The flags and invitation checks are shared by one check-registration helper in register-profile; the prepare command runs flags, then the email-mismatch restriction, then the invitation row lookup, so the password login flag fails closed first. The schema defs are private, the create-profile default uses penpot-backend, the OIDC callback test decodes the redirect token to assert the :prepared-register claims, and the docs and the auth memory state the invitation path for SSO registration. Regression tests cover invitation-only registration, canceled invitations with and without SSO flags, unknown backends, and the double-fault precedence in prepare-register. AI-assisted-by: inkling-2-small-free * 🐛 Require invitation email match for SSO registration Close the hole left by treating any invitation token as a substitute for the SSO registration flags. register-profile now requires the invitation member-email to match the prepared-register email, raising :email-does-not-match-invitation otherwise, mirroring the password flow. The OIDC callback verifies the team-invitation JWT and the email before redirecting to register instead of trusting raw presence. Covered by the requested mismatch regression test plus callback tests for mismatch and garbage tokens. AI-assisted-by: Muse Spark 1.3 Contributor * ♻️ Share registration gate between prepare and register-profile After the email-match fix, check-registration runs flags, email and invitation row in the same order as validate-register-attempt!. The prepare command now calls the shared helper instead of inlining the trio, and the stale docstring rationale is gone, so future invitation rule changes land in one place. AI-assisted-by: Muse Spark 1.3 Contributor |
||
|
|
bb4556b705
|
🐛 Persist promotional banner collapse (#13040) | ||
|
|
8715450f53 | Merge remote-tracking branch 'origin/staging' into develop | ||
|
|
679e70e48c |
🐛 Keep file_change kind nullable so rollback keeps writing
Migration 0158 created file_change with kind NOT NULL, which blocks any emergency rollback to the previous version: the old code inserts without kind and every save would fail. kind is still a reserve (reads use label IS NOT NULL), so it stays nullable until the rollback window closes; the NOT NULL comes in a later migration. The runbook keeps parity, the schema and migration tests cover the nullable column and the rollback insert, and the storage memory records the decision. AI-assisted-by: muse-spark-1.3-contributor |
||
|
|
5c45c8ddaf | Merge remote-tracking branch 'origin/staging' into develop | ||
|
|
92c478b0e2 | Merge remote-tracking branch 'origin/merge-staging' into staging | ||
|
|
dc38eaa843
|
🐛 Fix font upload crash and preserve font metadata (#11951)
* 🐛 Fix font upload crash and preserve variant metadata opentype.js 2.0.0 returns no fontSubfamily name for fonts whose Macintosh name table only holds custom records. That made parse-font-weight/parse-font-style call re-seq on nil and crash the upload. A nil or blank variant is now treated as no match in app.common.media, defaulting to weight 400 and style normal. The variant parsing also accepts oblique as italic, and the new parse-font-family helper derives the family from a filename by stripping the known weight/style tokens, separating a style token glued to a weight token ("Roboto-BoldItalic" -> "Roboto"). first-nonblank-string returns the first nonblank candidate, so a blank preferredFamily/preferredSubfamily no longer shadows a valid fontFamily/fontSubfamily. app.main.data.fonts gains resolve-font-metadata and prepare-font-entry. opentype.js values win per field; any missing value falls back to the filename-derived family, weight and style. The parsed and woff2 branches share the same helper, so metadata is preserved instead of collapsing every face to weight 400, and fonts with missing vertical-metric tables upload with no height warning instead of failing. process-upload reports per-file failures (unknown signature, unparseable file, preparation error) with a single bad-font notification instead of silently dropping them, and never errors for per-file failures. The upload now sends :variant-name to create-font-variant, which accepts it as an optional param (ships in 2.20), so the foundry name survives the upload. Closes #10436 AI-assisted-by: deepseek-v4.1-flash AI-assisted-by: muse-spark-1.3-contributor Signed-off-by: CHOI JUNSOO <junsoo1172@gmail.com> * 🐛 Parse glued font style tokens in the font parsers EvaMarco's review on #11951: parse-font-family and parse-font-weight handled glued tokens like "BoldItalic", but parse-font-style did not. For names such as "opensans-bolditalic-webfont.woff2" the three parsers disagreed: the italic face resolved to style normal and collided with the bold-only file on the (family, weight, style) join key. One binary silently overwrote the other during upload, losing one font face without any warning. A new private normalize-font-name helper is applied by all three parsers. It splits a style token glued to a weight token, now with a lookahead boundary so "LightItalic_v2" splits too, and strips a trailing technical suffix (-VF or _v<number>). parse-font-family, parse-font-weight and parse-font-style now interpret the name consistently. Tests cover the three cases from the review, the bold-only control case, and an end-to-end process-upload check that a bold and a bold-italic WOFF2 survive as two variants. Relates to #10436 and PR #11951. AI-assisted-by: inkling-2-small-free * Remove duplicate frontend test registration --------- Signed-off-by: CHOI JUNSOO <junsoo1172@gmail.com> |
||
|
|
a35dd49b6a | Merge branch 'staging-2.19.x' into staging | ||
|
|
12d73d0f63 |
🐛 Fix flaky assertion in climit waiting-count test
The test expected exactly one publication of the :rpc-climit-waiting gauge inside the with-redefs window. The republisher daemon thread, started at component init with no delay and rescheduling every 15 s, publishes the same counter and can land inside that window, so the recorded sequence could be [0 0] and the assertion failed with actual [0 +0] (Backend Tests job in #12979). Assert on the last published value instead of the whole sequence, the contract waiting-last documents and the sibling tests use. AI-assisted-by: inkling-2-small-free |
||
|
|
4cb0e452ff
|
Merge branch 'develop' into iop-vc-preview
Bring iop-vc-preview up to develop b438676d6c. Conflicts: - migrations.clj: develop's 0157-migrate-legacy-file-data and 0158-del-forbidden-file-library-rels keep develop's order, and the branch's 0800-0808 follow them. No file names collide, so nothing is renumbered. - files_update.clj: develop's save-path rewrite wins (commit-by-commit rejection, page-scoped validation, the file carrying ::changes and ::rejected). The branch's op-log save is ported onto it instead of the earlier [file op-changes media-index] triple: process-changes-and-validate attaches the media fix-up remap as ::media-index, and update-file* builds the op-log vector from the accepted changes (remapped) behind the repair changes. A branch save persists only when develop's saved? holds, and its audit and log outcome is "rejected" when the first commit is refused. The tpoint threading, persist-branch-file!, the public invalidate-caches!, and the branch audit props are kept. - Repair and validation timing tests: take develop's calls, since process-changes-and-validate returns a file again. - binfile_test.clj: keep the branch import-overwrite test and develop's library relation tests. - dashboard.cljs, dashboard_test.cljs: union of requires and tests. - viewer.cljs: develop's optional page-id plus the branch's pr-id. - left_header.cljs: develop's raw-svg logo, recent-files href and project link, inside the branch's wrapper with the review badge, branch title and branch bar. The unused deprecated-icon require and nav-to-project go. - en.po, es.po: three-way merge by msgid. Every entry of both sides is kept, develop's removals of a duplicate errors.save-retrying and of integrations.mcp-server.title.beta stand, and labels.retry carries develop's references plus the branch's. Adaptations to develop: - email.clj, files_pull_request.clj: the review request email joins develop's template registry and goes through send-template, as the comment emails it mirrors now do. The registry coverage test lists it, and the rollback test of the pull request commands injects its failure into send-template, the function the create path now calls. - rpc_file_pull_request_test.clj: pr-flags is read at test time instead of at namespace load. The loaded value held the production defaults, which now enable the admin console (#12475), and it replaced th/state-init's test flags, so creating a profile called nitrate and failed with :nitrate-not-configured. AI-assisted-by: claude-opus-5-5 Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro> |
||
|
|
bcac14a4a8
|
🐛 Skip circular library links on binfile import (#12062)
* 🐛 Skip circular library links on binfile import File import recreated circular library references that the link-file-to-library command already rejects. The v3 importer now skips manifest relations that would close a cycle, or link a file to itself, and logs each skipped link. Closes #12052. AI-assisted-by: muse-spark-1.3-contributor-free 🐛 Address review findings on circular import guard F1 extracts the cycle check into bfc/library-link-status and reuses it in link-file-to-library and v3 import, keeping UI errors intact. F3 orders get-files-rels and manifest relations so the first edge wins deterministically, and documents it. F2 adds a three-node transitive cycle test; F4 asserts file_library_sync has no orphan rows for skipped links and matches rels otherwise. AI-assisted-by: muse-spark-1.3-contributor 🐛 Pass team-id in binfile v3 circular library tests The four circular library relation tests (import-skips-circular, import-skips-transitive-cycle, import-skips-self-referencing, import-keeps-acyclic) called v3/import-files! without ::bfc/team-id. resolve-and-link-libraries asserts (uuid? team-id), so with enable-backend-asserts the tests errored instead of running. Add (assoc ::bfc/team-id (:default-team-id profile)) to each test, mirroring the production RPC import path and the earlier fix in a36193e54b for the other binfile v3 import tests. Verified: 1338 tests, 6910 assertions, 0 failures. AI-assisted-by: mistral-large-4 * 🐛 Guard the v1 import and restore the RPC check order The version 1 importer recreated the circular library references that the version 3 importer already skips, and a user reaches it through `import-binfile` and the import job. It now asks `bfc/library-link-status` before inserting each relation, so a self link or an edge that would close a cycle is skipped and logged, and it processes the relations in sorted order like v3 does. Closes #12052. The version 2 importer stays out on purpose: only the developer REPL reaches it, and a note in the code records the gap. `link-file-to-library` keeps the shared helper but restores the order of the base commit: the self link guard, then the edition permission and team ownership checks, and only then the cycle check. A caller without permission gets `not-found` again instead of the circular error, and a rejected request no longer runs the recursive library query first. Tests: a v1 import that recreates a cycle, the self link error of the command, and the permission check running before the cycle check. AI-assisted-by: deepseek-v4.1-flash * 🐛 Tolerate repeated file entries in the v1 binfile import The v1 exporter unioned the requested files with their libraries without deduplicating, so a package exported from a file inside a library cycle (see #12052) lists that file twice in the metadata. The v1 import created one file per entry, so the second insert hit the primary key of `file` and aborted the whole import with "file already exists". The importer now reads the pair of objects of every entry to keep the stream in sync but imports the first occurrence only, warns about the repeats, and answers with one id per imported file. The v1 export keeps its behavior: it has no caller in the product, and only the tests and the developer REPL use it. Tests: a package with a repeated entry, built with the v1 export from a cyclic library pair, imports the file once and leaves no duplicated rows. AI-assisted-by: deepseek-v4.1-flash |
||
|
|
34c702bc80
|
✨ Add table partitioning for file-change (#12417)
* ✨ Partition file_change by file_id Partition `file_change` by `HASH (file_id)` in 16 partitions, with the same bounds as `file_data`, so a join between them is resolved partition by partition. The primary key becomes `(file_id, id)`, which a partitioned table needs, and every access filters by `file_id`. The new table carries a `kind` column (1 snapshot, 2 revision) as a reserve: the queries still tell them apart by the label, and `kind` takes over when they are rewritten. The payload of a snapshot stays in `file_data`; the `data` column is kept for reading old `legacy-db` payloads. The four snapshot commands require `file-id`, because it prunes the partition. The objects GC locks and deletes by the pair, in batches. The old table is kept as `file_change_legacy` as the way back. The automatic migration refuses to run above 10 GiB or 2M rows and points to the runbook; big instances partition online with that runbook, which copies by id, follows the `updated_at` watermark in delta passes and checks that no row of the source is missing from the target. Closes #12416 AI-assisted-by: deepseek-v4.1-flash * 🐛 Address the review of the file_change partition The production runbook promised a rollback it did not have: the section was a sketch, and its statements could write to the table about to be dropped. The rollback is removed, and so is every comment that described it. `file_change_legacy` stays as a frozen copy of the previous layout. The cutover check now aborts the transaction when a row of the old table is missing in the new one, instead of leaving the decision to the operator. The five secondary indexes of the new table are built after the last delta pass: the bulk and the delta passes only need the primary key, so the batches no longer maintain them. The copy of 0158 is now replayed in a test against the pre-0158 shape with a labelled and an unlabelled row, plus an empty instance that must leave no legacy table behind. The updated_at assertion of the snapshot mutations is bounded by the test clock, and the repair revision stops writing the `features` of the file, like the normal save. AI-assisted-by: deepseek-v4.1-flash * 📎 Fix linter issues * 🐛 Fix stale helper call in rpc_file_snapshot_test The suite does not load: `th/run-pending-tasks!` does not exist in backend-tests.helpers. The pending jobs runner is `run-pending-jobs` (no arguments), the name every other call site of the suite uses. AI-assisted-by: inkling-2-small-free * 📚 Align the partition change with the 2.20.0 milestone 2.19.0 is already shipped; this work targets 2.20.0. The operations file of the partition procedure carries the 2.20.0 prefix, the references that point at it (the migration, the runbook table and the memory) follow, and the RPC doc/changes tags of the snapshot commands record 2.20 as the release that makes `file-id` required. AI-assisted-by: inkling-2-small-free * 🐛 Fix review findings on the partition rebase The 0157 legacy test was missed by the rebase and inserted file_change rows without the new mandatory `kind` column, so the backend suite fails against the migrated schema. The inserts now carry `:kind` (snapshot-kind for the labelled rows, revision-kind for the rest). The post-cutover verification block of the runbook terminates the first query with a semicolon so the block pastes into psql without a syntax error. The guard message of the migration names the step (0158-partition-file-change) instead of "0158", ambiguous since two migrations share that number. Closes #12416 AI-assisted-by: inkling-2-small-free * 🐛 Fix the stale label in the snapshot restore test The rename block of snapshots-crud runs before the restore block, so the restored version is already named "label1-updated" when the restore publishes its message. The command names the version by the label the row has at that moment, not by the one it had when it was created, so the test was asserting a stale value. Assert the current label, and say why in the comment. AI-assisted-by: deepseek-v4.1-flash * ♻️ Split the version event tests into one test per command The workspace version events and the plugin proxy send the file-id of the open file on every snapshot command, because the command needs it to prune the partition of file_change. Both tests checked that with a doseq and t/testing blocks, so a failure named the whole group and not the command that broke. Give each command its own test. The workspace ones share a helper that runs the event and returns the command and params it sends; the plugin ones keep their own mock of rp/cmd!. AI-assisted-by: deepseek-v4.1-flash |
||
|
|
671ff4a05f | Merge remote-tracking branch 'origin/staging' into develop | ||
|
|
e4fcc663c0 | Merge remote-tracking branch 'origin/staging-2.19.x' into staging | ||
|
|
1db1487c7f
|
🐛 Require thread access when marking threads as read (#12894)
* 🐛 Require thread access when marking threads as read mark-all-threads-as-read took any list of thread ids and wrote the read status of the caller on each of them, without checking that the caller can access the file that owns the thread. It was the only comment mutation that did not check permissions, and it took the ids as an unbounded array, so a single request could keep a database connection and a transaction open for a long time. The rpc now resolves the threads in one query and checks the comment permissions of every distinct file, answering not-found when a thread does not exist or is not accessible. Both cases answer the same error on purpose, so the response cannot be used to tell existing threads apart. The status rows are now written with a single insert, keeping the modified-at date one second in the future that makes the thread count as read. Repeated ids are deduped, the command returns nil again like the sibling commands with no result, and the schema limits the number of threads per call to 500 while the dashboard sends the ids in batches of that size. Tests cover access rejection, unknown threads, mixed batches that write nothing, repeated ids, empty lists, marking twice, and the frontend batch split. Relates to GHSA-j4vc-cmf6-jhr7 AI-assisted-by: minimax-m3.1-flash * 🐛 Refresh the unread list when a batch fails The dashboard sends the thread ids in batches of 500 and each batch commits on the server. A failure in a later batch left the unread list stale: the re-read only ran when every batch succeeded, so the threads already marked as read stayed visible as unread. The re-read now runs in both paths. On failure the event is emitted before the error is propagated, so the error toast still shows and the success toast stays limited to a full success. The backend also answers an empty list without opening a transaction, since there is nothing to check and nothing to write. Relates to GHSA-j4vc-cmf6-jhr7 AI-assisted-by: deepseek-v4.1-flash |
||
|
|
8510daef52
|
🐛 Restrict the team invitation token and list to admins (#12892)
* 🐛 Restrict the team invitation token and list to admins The token of a team invitation is a bearer credential: whoever holds it accepts the invitation with the role of the invitation row. The RPC that mints it only required edition permissions, while the rest of the invitation commands require admin, so a team editor could get the token of any pending invitation, including the ones that grant the owner role. The token now requires admin, and the token of an owner invitation is restricted to the team owner: an admin cannot create nor promote an owner invitation, so it cannot keep its token either. It reuses the error code already used for that rule. Minting the token now leaves an audit event named as an action, carrying the granted role and the id of the invitation, so the extraction does not go unnoticed. The list of pending invitations is admin only as well: it carries the email of the invited person and the role offered, and the dashboard was painting those emails to any member. The frontend catches the permission error and shows the permission notice instead, and the copy action is not offered for an owner invitation, which the backend rejects for an admin. The five invitation commands now answer with the same permission error, so they speak one language. Relates to GHSA-4mmc-j8rh-74pf AI-assisted-by: minimax-m3.1-flash * 🐛 Clear the cached invitations and gate the list on team admin The pending invitations are a team admin only list. The dashboard still offered the entry to every member and keyed the section on the invite policy of the organization, so a team admin blocked by that policy saw the no-permission notice although the backend lets them list. - `fetch-invitations` answers a denied refetch with an `invitations-fetched` event carrying an empty list, so a demoted admin does not keep the cached emails and the header no longer paints the invite button from a stale list. - The header tabs and the team options dropdown hide the invitations entry without `:is-admin`, which already includes the team owner. - `invitations-section-content` keys the section on `:is-admin`, and the invite policy only gates the invite actions: resending keeps the `can-invite?` check, deleting and row selection only need team admin. AI-assisted-by: deepseek-v4.1-flash |
||
|
|
0420db1ca9
|
🐛 Apply the share-link page scope to the comment queries and writes (#12888)
* 🐛 Apply the share-link page scope to the comment queries and writes A share link can be restricted to a subset of the pages of a file, and the comment queries enforced that scope. But the RPC that resolves the profiles of the commenters authorized the request with check-comment-permissions! and dropped the returned perms, so its query filtered only by file id. The holder of a page scoped link got the id, email, fullname and photo of every profile that commented on any page of the file, including the pages the owner left out of the link. The query now takes the pages of the share link and only selects the authors of the threads on them. The profile of the caller is still added, so the viewer keeps its own avatar. The scope was missing as well on the comment writes that take a page id or a thread id: create-comment-thread accepted a page outside the link, create-comment accepted a thread of an unshared page, and update-comment-thread, update-comment-thread-position and update-comment-thread-frame accepted a thread of an unshared page. They now raise not-found, the same way the comment queries already did. Replying to a thread of an unshared page also sent the emails to the thread participants. The page scope rule now lives in one place: share-link-pages returns the pages granted by a share link and check-page-scope raises not-found when a page is outside of it, so get-comment-threads reuses the helper instead of checking the pages inline. The docstring of get-profiles-for-file-comments said that it returns the participants of all the comment threads of the file, which is not true anymore for a share link. The docs are public, so the text and the changes list are updated. The tests of the share link page scope are hardened: the setup asserts that the comment threads are created, the membership case has a second commenter so it can no longer pass for the wrong reason, and the link without pages, the allowed paths of the thread updates and the who-comment=team denial are covered. Relates to GHSA-89cq-3wv7-987r AI-assisted-by: minimax-m3.1-flash * 🐛 Enforce the share-link page scope on the remaining comment writes Check the page scope of the share link before mutating in the four comment writes that still skipped it: update-comment-thread-status, update-comment, delete-comment-thread and delete-comment. The check runs before the ownership checks, so an out-of-scope write fails with not-found and the response does not reveal that the comment or thread exists. Load the file in create-comment only after the permissions and page scope checks, matching create-comment-thread, so a rejected reply does not load the file data. Cover the denial and the in-scope paths of the four commands, and the fail-closed case of a link without pages on the comment reads. Move the outsider thread creation after the profiles assertion so the caller-union assertion fails when the union is removed. Document the page scope invariant in the backend permissions memory. AI-assisted-by: deepseek-v4.1-flash |
||
|
|
4874da450f
|
🐛 Escape SVG values and sanitize every SVG upload (#12887)
* 🐛 Escape SVG values and sanitize every SVG upload The SVG sanitizer removed dangerous elements and attributes by name and then wrote the tree back with clojure.xml/emit, which escapes nothing. A payload hidden in an attribute value or in a text node became live markup again: an id of "x' onload='alert(1)'" was stored as a real onload handler, and an entity encoded script tag was stored as a real script element. Write the filtered tree with a serializer that escapes text and attribute values, and route every path that stores an uploaded SVG through it. The thumbnail writers (create-file-object-thumbnail and create-file-thumbnail) and the organization logo stored the upload untouched, so they could plant live markup in a public bucket. The filter only knows about SVG elements, so it also accepted documents that are not SVG at all: a page with an iframe or a meta refresh was stored as an image. The sanitizer now rejects any document whose root is not an svg element in the SVG namespace, and it compares the scheme of an url the way the browser does, so a scheme split with a tab or a line break no longer slips through the javascript: filter. The attributes are written sorted by name, because the parser hands them over in the reverse order of the document and the output changed on every sanitization. The profile picture of an identity provider is not stored either when it is an SVG: the avatar is always rendered as an image, so an SVG would only add the risk of keeping live markup in the storage. The dimensions of an SVG are now read from its local name, so an SVG with a namespace prefix can be uploaded like any other. The logo had no size limit and the sanitizer reads the whole file, so it now honors the media max file size. The output shape changes with it: no line breaks, double quotes, and the single quote of an attribute value escaped as an entity. The hash of every stored SVG object changes with it. The media tests use cuerdas.core instead of clojure.string, as the rest of the codebase does. Relates to GHSA-qwhj-rchj-58mg AI-assisted-by: minimax-m3.1-flash * 🐛 Drop non-SVG namespace subtrees in the SVG sanitizer The sanitizer only checked the namespace of the root, so a child could rebind xmlns to XHTML and smuggle live HTML (iframe/srcdoc/meta) past the blocklist. The serializer escapes attribute values, but the browser decodes them again, so srcdoc stays live. Track the namespace bindings through the recursion and drop any element that is not in the SVG namespace, with its subtree. The root is validated up front with the same model, so a document that is not an svg document is rejected with an honest hint instead of a misleading one. The default namespace is stored under a namespaced key, because a prefix literally named `default` collided with the internal key and re-opened the same hole through a prefixed binding. The attribute filter now keeps `xmlns`/`xmlns:*` declarations, which are not event handlers, so a prefix named like one does not end up undeclared in the output. The blocklist also drops HTML-only elements written in the svg namespace (iframe, meta, embed, link, base). Add regression tests for the child rebinding, for the prefixed variants, for the `default` prefix, for the root local name, for the create-file-media-object-from-url path (mocked download), and for the HTML-only tags. Assert double-quoted attributes in the clean content test. Relates to GHSA-qwhj-rchj-58mg AI-assisted-by: longcat-2.5-free |
||
|
|
c39e3e8301
|
✨ Strictly validate uploads against file bytes on disk (#12801)
* ✨ Strictly validate uploads against file bytes on disk Sniff the real content type of every upload with simplemagic magic bytes instead of trusting the client-supplied mtype header. Declared types outside the allowlist keep the not-allowed code; allowed declarations whose bytes differ are rejected as mismatch. Covers SVG by probing its root tag over leading bytes (magic never matches XML text), TTF/OTF by magic name and WOFF/WOFF2 by four-cc. Read the real file size from disk instead of trusting the declared :size. Files over the limit are rejected even when the declared size lies downwards, and small files pass even when it lies upwards. Run the path check first everywhere so forged server paths keep the params-validation code. Recheck from-url downloads after the write, with a declared-only fast fail at header time. Thread the assembled path through font validation. Refresh the affected tests around real and sparse fixture files, including a PNG-as-font chunked-upload rejection case. Closes #12796 AI-assisted-by: muse-spark-1.3-contributor * 🐛 Accept BOM-prefixed SVG uploads and cover WOFF/WOFF2/OTF/WEBP Address review comments on #12801: - SVG files saved with a UTF-8 BOM were rejected as :media-type-mismatch: read-head kept U+FEFF and the <svg probe never ran. A leading BOM is now stripped before the probe, and a generic XML sniff (application/xml, text/xml) is treated as "no magic evidence" for declared image/svg+xml, so the root-tag probe decides whether the file opens with an <svg root. - sniff-match?/svg-file? docstrings claimed the magic database never matches SVG; simplemagic 1.17 does match an SVG with an XML prolog as image/svg+xml. Reworded to match reality. - Added matching-pass tests for WOFF, WOFF2, OTF and WEBP (they hit the read-four-cc, magic-name and direct magic branches) and three BOM SVG regression cases. AI-assisted-by: inkling-2-small-free |
||
|
|
e1f924cf00 |
🐛 Send organization invitations to unregistered emails (#12937)
send-template drops nil values before enqueuing the mail job, but the invite-to-organization schema required the :user-name key. Inviting an email with no Penpot account left :user-name nil, the key was dropped and the job failed its schema check, so the invitation email was never sent. :user-name is now optional in invite-to-organization and in renewal-notice, which has the same shape. New test renders both templates through the queue with a nil :user-name. AI-assisted-by: claude-opus-5-5 |
||
|
|
4e8f05171e
|
🐛 Forward attribute deletion events to admin console (#12932) | ||
|
|
ae24118caf
|
🐛 Send organization invitations to unregistered emails (#12937)
send-template drops nil values before enqueuing the mail job, but the invite-to-organization schema required the :user-name key. Inviting an email with no Penpot account left :user-name nil, the key was dropped and the job failed its schema check, so the invitation email was never sent. :user-name is now optional in invite-to-organization and in renewal-notice, which has the same shape. New test renders both templates through the queue with a nil :user-name. AI-assisted-by: claude-opus-5-5 |
||
|
|
3de7e62aa9
|
⚡ Don't send file data contents back from duplicate-file (#12911)
The client calls the duplicate-file command in two places, the dashboard and in the plugin API. In both places the :data is dropped via `(dissoc file :data)`, so the client never uses that field. However the file data takes a while to send over the wire and decode. When duplicating penpot-app there's a roughly 1s freeze whenever the response is returned from the server with the file data. We can avoid it by dropping the data from the response. I also did a quick check and neither the MCP server nor any public client of the API on GitHub seem to use the :data field. Co-authored-by: Andrey Antukh <niwi@niwi.nz> |
||
|
|
1df2941576 | Merge remote-tracking branch 'origin/staging' into develop | ||
|
|
0ea6d166f0
|
✨ Add a session origin model to auth events (#12856)
* 🐛 Return the full profile from the LDAP invitation branch The invitation branch responded with only {:invitation-token token}, so the session start received a map without id or auth-backend. With the new auth-origin vocabulary that map fails validation and the login breaks in development and tests; in production the event would be emitted without a channel. Return the profile plus the token, like the regular branch, and cover both branches with RPC-level tests. Closes #12849 AI-assisted-by: deepseek-v4.1-flash * 🐛 Mint an auth token in the OIDC callback with the invitation inside The callback used the invitation JWE as the session token, so the frontend landed directly on token verification and never ran the regular session start: no signin event, no teams, no host hook. Always mint an :auth token and carry the invitation in its claims. Token verification returns the claims verbatim, so login-from-token attaches the invitation to the profile and logged-in does the rest, the same pattern the verify-email token already uses. Closes #12849 AI-assisted-by: deepseek-v4.1-flash * ✨ Keep the session origin in the telemetry shadow rows The anonymisation filter drops every string unless it is on a short allowlist. Add source and activation next to lang and auth-backend so the shadow copy keeps them; the email and the full name are still dropped and the email domain is still derived from the email. The filter keeps its two bindings: the transducer discards everything that is not a UUID, a boolean or a number, so the allowlist is applied on the filtered map, never on the raw props. Closes #12849 AI-assisted-by: deepseek-v4.1-flash * ✨ Describe the signup outcome with activation, not with action The three success branches of register-profile labelled a new account as "login", "email-verification" or "accept-invitation", so the event contradicted its own name and the value only lived in context, where the analytics consumers never read it. Add activation to the event props and drop action from those branches: the name already says it is a signup, and a constant action would only add noise. The retry branches keep their action in context because there it distinguishes four different outcomes. Closes #12849 AI-assisted-by: deepseek-v4.1-flash * ✨ Describe the session origin in the signin event The event carried the profile but never said why the session started: the only field that tried was frontend metadata that never leaves the browser, and several flows filled it with the wrong value. Add a small closed vocabulary (source, auth-backend, activation, from-invitation) and compose it from the profile when signin is emitted. The assertion fails in development and tests and is elided in the release build, so a bad value cannot break a real login. Closes #12849 AI-assisted-by: deepseek-v4.1-flash * ✨ Emit the session origin from every login entry point The four emitters stamped a free-form string as metadata, so the session event could not rely on it: two flows that were signups wrote the same value as a login. Route them through origin-meta: password and LDAP logins declare source login, register declares source register with activation immediate, and login-from-token derives both from the token issuer: :auth for a login and :verify-email for a signup that needed the email confirmation. Closes #12849 AI-assisted-by: deepseek-v4.1-flash * 🐛 Send the invitation signups through the regular session start Registering from a team invitation link navigated by hand to token verification, so the session start never ran: no signin event, no teams, no host hook. The same navigation was copied in four places. Teach login-from-register to carry an optional invitation token, extract the profile decoration into with-register-origin, and call it from the four sites instead of the hand-written navigation. Closes #12849 AI-assisted-by: deepseek-v4.1-flash * 🐛 Resolve the invitation without waiting for the teams Registering from an invitation link now goes through the session start, and that start only navigates after the teams request completes. fetch-teams has no error handling, so a network failure there would leave the invitation unaccepted and the user on the signup screen with a session already minted. Move the invitation navigation out of the teams path: it emits as soon as the profile carries a token, and the teams path emits nothing for an invited profile so it cannot move the user away from the token verification screen. Closes #12849 AI-assisted-by: deepseek-v4.1-flash * 📚 Document the session origin vocabulary and the invitation flow Add a focused memory with the four fields, where each value comes from, the table of flows, the LDAP exception and the invitation path through logged-in, and link it from the frontend routing. Update the audit-log memory: source and activation are now on the telemetry allowlist, activation lives in props and action only exists on the retry rows. Closes #12849 AI-assisted-by: deepseek-v4.1-flash * 📎 Cover the invitation session start and fix the auth memories The invitation flows and the token decoration in login-from-token were only covered by helper tests, so removing the guard that keeps the teams path from navigating, or the token attach, broke the behaviour silently. Run the events through ptk/watch with a teams-fetched event as input: an invited profile navigates to the token verification screen and never to the dashboard, and the signin keeps from-invitation. Add the login-from-token cases with and without the token, and fix the memory statements about action, the flow table and from-invitation. Closes #12849 AI-assisted-by: deepseek-v4.1-flash |
||
|
|
75b3da5290
|
⬆️ Update dependency pnpm to v12.18.0 (#12876)
- pnpm 12.18.0 (docker/images/Dockerfile.media-processor) - pnpm 12.18.0 (docker/images/Dockerfile.mcp) - pnpm 12.18.0 (docker/images/Dockerfile.exporter) - pnpm 12.18.0 (docker/devenv/Dockerfile) - pnpm 12.18.0 (render-wasm/package.json) - pnpm 12.18.0 (plugins/package.json) - pnpm 12.18.0 (plugins/libs/plugins-styles/package.json) - pnpm 12.18.0 (plugins/libs/plugins-runtime/package.json) - pnpm 12.18.0 (plugins/libs/plugin-types/package.json) - pnpm 12.18.0 (plugins/apps/table-plugin/package.json) - pnpm 12.18.0 (plugins/apps/rename-layers-plugin/package.json) - pnpm 12.18.0 (plugins/apps/poc-tokens-plugin/package.json) - pnpm 12.18.0 (plugins/apps/poc-state-plugin/package.json) - pnpm 12.18.0 (plugins/apps/plugin-api-test-suite/package.json) - pnpm 12.18.0 (plugins/apps/lorem-ipsum-plugin/package.json) - pnpm 12.18.0 (plugins/apps/icons-plugin/package.json) - pnpm 12.18.0 (plugins/apps/example-styles/package.json) - pnpm 12.18.0 (plugins/apps/e2e/package.json) - pnpm 12.18.0 (plugins/apps/create-palette-plugin/package.json) - pnpm 12.18.0 (plugins/apps/contrast-plugin/package.json) - pnpm 12.18.0 (plugins/apps/composable-test-suite/package.json) - pnpm 12.18.0 (plugins/apps/colors-to-tokens-plugin/package.json) - pnpm 12.18.0 (package.json) - pnpm 12.18.0 (media-processor/package.json) - pnpm 12.18.0 (mcp/packages/server/package.json) - pnpm 12.18.0 (mcp/packages/plugin/package.json) - pnpm 12.18.0 (mcp/packages/common/package.json) - pnpm 12.18.0 (mcp/packages/browser-extension/package.json) - pnpm 12.18.0 (mcp/package.json) - pnpm 12.18.0 (library/package.json) - pnpm 12.18.0 (frontend/text-editor/package.json) - pnpm 12.18.0 (frontend/packages/ui/package.json) - pnpm 12.18.0 (frontend/packages/mousetrap/package.json) - pnpm 12.18.0 (frontend/packages/draft-js/package.json) - pnpm 12.18.0 (frontend/package.json) - pnpm 12.18.0 (exporter/package.json) - pnpm 12.18.0 (docs/package.json) - pnpm 12.18.0 (common/package.json) - pnpm 12.18.0 (backend/package.json) Signed-off-by: penpot-renovate[bot] <338182062+penpot-renovate[bot]@users.noreply.github.com> |
||
|
|
988cde3c9d
|
✨ Make WebGL the default renderer for new accounts (#12880)
New profiles now store renderer `wasm` in their props at creation, so every signup path (email, OIDC, LDAP, Nitrate, demo, CLI) starts on WebGL. A renderer passed by the caller still wins. Existing profiles without a stored renderer keep the frontend fallback to SVG, so no backfill or version check is needed to leave them as they are. The `register-profile` audit event gains `renderer-default` when the profile is created in that call, so signups before and after this change can be told apart. Closes #11855 AI-assisted-by: claude-opus-5-5 |
||
|
|
a77cb2608e
|
🐛 Normalize stored SVG attribute keys to kebab-case (#12006)
* 🐛 Normalize stored SVG attribute keys to kebab-case The v3 reader already emits kebab-case keys, but birth stored the camelCase React prop names, so import and export never converged: fill rules painted wrongly and filter defs lost their blur. Birth now normalizes every stored attribute key to kebab-case through the `svg-props` whitelist (`attrs->kebab-props`), applied on all element paths of the svg importer, on the file builder and on defs. svg-raw `:content` is kebab-ized in spelling only and keeps unknown keys, because the sidebar reads them. Non-spec attrs Penpot must keep live in `penpot-extra-attrs`, seeded with `:stroke-style`. Render boundaries translate back to camelCase for React and for the wasm props, and the shape schema declares the closed kebab contract derived from that same whitelist, so birth and validation cannot drift. Migration `0035-fix-shape-svg-attrs-and-defs` converts old files once with the birth transforms, and carries back the svg-viewbox rect normalization the withdrawn `0021` had. That old id leaves `available-migrations`, so files recording it migrate again through this one, and the binfile cleaner drops its own svg repair. Review fixes included here: `setup-opacity` and the blend mode read the stored keys, gradient stops accept `:style` as a CSS string or a map, `inherit-attributes` reads `:style` so a child's inline style beats the inherited group attr per CSS, and the svg-attrs menu shows spec spelling (`viewBox`, `class`) through `stored-attr-display-name`. Tests cover the migration, the closed svg-attr schemas and the import/export round trip; the svg-content schema test pins its sample seed, which dealt no svg-raw shape on unlucky runs. Closes #11947 AI-assisted-by: muse-spark-1.3-contributor * 🐛 Keep legacy svg node tags and transforms valid in migration 0035 The closed svg node schemas require keyword tags and map attrs, but stored files hold def and svg-raw content tags as strings, and some node `:attrs` as nil. Migration 0035 left them as they were, so the file data check that runs after migrating rejected those files and they could not be opened. `normalize-node-tree` now turns string tags into keywords and nil attrs into an empty map, at birth and in 0035. With keyword tags, the svg defs renderer applies the shape transform to user-space defs. Legacy `:svg-transform` values are plain maps, which multiply into NaN matrices. `gmt/coerce` turns them into matrices, in 0035 and in the binfile cleaner, because every v3 import decodes the transform as a plain map again. Legacy masks and gradients now render as designed in the svg renderer. The binfile test helper calls `export-files!` with the current config keys. AI-assisted-by: claude-opus-5-5 --------- |
||
|
|
2df4d10bd5
|
✨ Enforce attribute-based organization permissions (#12868)
* ✨ Enforce attribute-based organization permissions * 📎 Code review |
||
|
|
6a1b58c310 | Merge remote-tracking branch 'origin/staging' into develop | ||
|
|
0b8a428d6b
|
🐛 Validate binfile library relations against the package (#12862)
Ignore imported library relations that point outside the package or self-link a file on the v3 import path. Delete leftover cross-team and self relations from file_library_rel and their matching file_library_sync rows with migration 0158, sync rows first. Move the get-files-rels SQL to a var, without behaviour change. Cover the write-side invariants with state-based tests: tampered manifests, package containment, self links and the migration cleanup. AI-assisted-by: deepseek-v4.1-flash AI-assisted-by: muse-spark-1.3-contributor |
||
|
|
eadd1cce70 |
🐛 Keep a copy linked when the repair finds its component's main
A component whose :main-instance-id points to a missing shape fails validation on its copies with :ref-shape-not-found. A repair scoped to the copy's page never sees the main's own error, so it detached the copy, even when the main was still on the component's page. The repair of :ref-shape-not-found now looks for the component's main on its page first and points :main-instance-id back to it, which keeps the copy linked. A copy is still detached when no main is found. |
||
|
|
61bf66342b |
✨ Tell repairs, damaged data and other files apart in save notices
The notice of a rejected save always said the same thing. It did not name the file when the user had moved to another one, gave no hint when the page held data that was already invalid, and replaced the notice of a backend repair still on screen, since the store holds one toast. The backend flags a rejection whose first commit touches pages or components that failed validation before it (:preexisting-damage). The rejection notice names a file other than the open one, says when the data was damaged before, and folds into a repair notice still on screen; a later repair notice folds a rejection notice in the same way. The notice says that the latest changes were undone, no longer that the rest of the work is saved. |