Skip to content

Preserve floor-plan backgrounds during upload and rollback failures - #700

Merged
matteius merged 5 commits into
mainfrom
fix/floor-plan-background-publication
Nov 1, 2026
Merged

matteius merged 5 commits into
mainfrom
fix/floor-plan-background-publication

Conversation

@matteius

@matteius matteius commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #701; merge the shared CI cleanup first. This branch includes that exact shared commit so its workflow changes disappear from this PR after #701 merges. Suite membership is declared beside the tests in CMake; this fix has no independent workflow edits. All three remaining fix branches merge cleanly with each other.

Replacing a floor-plan background could discard an unknown backup or overwrite a competing file during publication or database-error rollback.

Hold the original and uploaded files in a private directory, publish without replacing an intervening destination, and restore only the inspected original. If recovery cannot safely finish, preserve the files for inspection.

  • After the shared CI cleanup merges, three files: one production file, one regression suite, and its CMake registration.
  • Independently on main: 17 of 24 cases fail before the fix; all 24 pass with ASan/UBSan. Direct-handler tests use private SQLite/filesystem fixtures and cover normal upload, publication failures, substituted entries and rollback conflicts.
  • Run: ctest --test-dir build/focused-debug --output-on-failure -R '^test_floor_plan_background_publication$'.

Publication requires atomic no-replace filesystem support and fails conservatively if unavailable. Uncertain recovery artifacts are retained. Filesystem and SQLite updates are not atomic together; already-open writers, other-MIME cleanup and GET/DELETE behavior remain outside this change.

Extracted independently from #693; no foundation framework or policy exceptions. Hosted CI is required before merge.

Revalidated after updating from main and adopting the shared CI suites: focused ASan/UBSan regressions pass, and CTest labels select the existing suite plus only this PR’s regressions.

Hold original and uploaded background identities in a private directory,
publish without replacing a competing destination, and restore only
verified entries without overwriting intervening files. Preserve original,
uploaded and competing data when publication or metadata rollback cannot
safely finish. Create uploads relative to the held private directory.

Add 24 direct-handler regressions with private SQLite/filesystem fixtures
and existing CMake/integration/sanitizer registration. On origin/main
8927bc8 the suite fails 17/24; the isolated fix passes 24/24 under Debug
ASan/UBSan. No application service or shared legacy fixture was used.
Uncertain recovery artifacts are retained rather than recursively removed.
@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.42105% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/web/api_handlers_operator_floor_plans.c 93.42% 10 Missing ⚠️

📢 Thoughts on this report? Let us know!

@matteius
matteius merged commit 5a6a57c into main Nov 1, 2026
13 checks passed
@matteius
matteius deleted the fix/floor-plan-background-publication branch November 1, 2026 00:19
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.

1 participant