Repository navigation
Saving and restoring scenes - #507
Merged
Merged
Conversation
…py content only (oss-slu#451-oss-slu#456) - PUT /api/scenes/:id saves images, annotations and importLog together, with baseUpdatedAt -> 412 for stale copies and strictly increasing versions - POST /api/scenes accepts initial content (save-as-new in one request) - POST /api/scenes/:id/duplicate copies the saved version - DELETE takes the scene lock so an in-flight save can't undelete a scene - Lock timeouts return 423 instead of 409 - import-legacy no longer reads, locks or writes the stored scene; it returns images, annotations and an importLogEntry for the client's working copy Co-authored-by: Ramedan Ahmed <Remex9@users.noreply.github.com>
…ate; bone imports change only the working copy (oss-slu#451-oss-slu#456) Co-authored-by: Ramedan Ahmed <Remex9@users.noreply.github.com>
Remex9
requested review from
UcheWendy,
jacksayshi,
leandrumartin and
mudabs
as code owners
October 12, 2026 17:03
mudabs
approved these changes
Oct 12, 2026
mudabs
left a comment
Collaborator
There was a problem hiding this comment.
Approved.
The implementation is well-tested and meets the requirements for saving and restoring scenes. Automated tests, linting, and SBOM checks pass. The save workflow, conflict handling, duplicate support, import behavior, and scene locking are covered.
The PR is approved from a code-review perspective.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Summary
Closes #451, Closes #452, Closes #453, Closes #454, Closes #455, Closes #456
Related to #444
The open scene is now an in-browser working copy. Edits and imports (direct image uploads and legacy bone imports) change only that copy, and Save stores it as one versioned write. If the stored scene changed somewhere else after it was opened, the save is refused (412) and the user can overwrite it or reload the saved version. A save-status indicator, an unsaved-changes warning (switching scenes, New, Delete, Duplicate, page close), Duplicate, and recovery when the scene was deleted elsewhere are included.
PR Checklist
npx jest: 693 passed, 5 skipped;npm run lintclean)Detailed Description
Server (
boneset-api/scenes.js)PUT /api/scenes/:id: stores images, annotations and the optional import log in one locked write. A stalebaseUpdatedAtreturns 412 with the currentupdatedAt. Versions always increase.POST /api/scenesaccepts optional content, so "Save as new scene" is a single atomic request.POST /api/scenes/:id/duplicate.POST /:id/import-legacyno longer touches storage. It returns{ images, annotations, importLogEntry, imported, importedAnnotations, warnings }and places the row at the client-suppliedoriginY.DELETEtakes the scene lock, so an in-flight save can't bring a deleted scene back. A lock timeout returns 423.src, 1,000-object limits, total size, import log capped to the last 50 entries.Client (
templates/js/scenes.js,boneset.html,style.css)Tests
Known limitation: leaving the editor with Back doesn't warn. The working copy stays in memory, and closing or reloading the page does warn.