Skip to content

Vps 91/prevent last scene deletion#399

Open
rgin216 wants to merge 9 commits into
masterfrom
VPS-91/Prevent-last-scene-deletion
Open

Vps 91/prevent last scene deletion#399
rgin216 wants to merge 9 commits into
masterfrom
VPS-91/Prevent-last-scene-deletion

Conversation

@rgin216
Copy link
Copy Markdown
Contributor

@rgin216 rgin216 commented May 19, 2026

Issue

Deleting the only scene in a scenario allowed the scenario to end up with no scenes. This caused the authoring page and scenario info page to crash because both reasonably expect every scenario to have at least one scene.

Solution

Scenarios are now created with an initial Scene 1 on the backend, making the “at least one scene” invariant true from creation.

The scene delete API now rejects attempts to delete the last remaining scene with a 409 response. The reorder API also rejects empty sceneId arrays, so a scenario cannot be reordered into having no scenes.

The authoring UI now disables the delete action when only one scene remains and restores the scene list if a delete request fails.

Risk

Low. The main behaviour change is that scenarios can no longer be empty. Any existing code or tests that expected newly created scenarios to have zero scenes may need updating.

Existing database records with no scenes are not automatically backfilled by this PR.

Checklist

  • Acceptance criteria met
  • Wiki documentation is written and up to date
  • Unit tests written and passing
  • Integration tests written and passing
  • Continuous integration build passing

@linear
Copy link
Copy Markdown

linear Bot commented May 19, 2026

VPS-91

@rgin216 rgin216 requested review from harbassan and leowla May 19, 2026 03:25
Copy link
Copy Markdown
Member

@leowla leowla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎬🗑️

Comment thread backend/src/routes/api/scene.js Outdated
Comment thread backend/src/routes/api/scene.js Outdated
Comment thread backend/src/routes/api/scene.js Outdated
@rgin216 rgin216 requested a review from harbassan May 21, 2026 03:55
Copy link
Copy Markdown
Contributor

@harbassan harbassan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants