Skip to content

Fix PATCH authorization, data correctness, attachments, and invitations - #147

Merged
rrrodzilla merged 8 commits into
mainfrom
fix/remaining-open-issues
Sep 9, 2026
Merged

Fix PATCH authorization, data correctness, attachments, and invitations#147
rrrodzilla merged 8 commits into
mainfrom
fix/remaining-open-issues

Conversation

@rrrodzilla

@rrrodzilla rrrodzilla commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

This PR fixes PATCH writes that returned success without saving field-authorized changes, together with six issues across queries, migrations, attachments, CEL verification, and generated invitations.

  • Authorize PATCH deltas against the complete post-patch resource, preserving required attributes for strict Cedar validation. Authorization evaluation errors return 403, and conditional writes retain baseline authorization and stale-revision protection.
  • Preserve enum values when adding or reordering variants. Narrowing affects only removed variants and fails safely for required fields.
  • Make null equality/inequality consistent across PostgreSQL, SurrealDB, and SQL Server, including returned counts.
  • Give paginated queries a deterministic ID tie-breaker and preserve descending order and ID filters through the HTTP API.
  • Add an authorized, audited file-detach endpoint and entity file clear, retaining object bytes under storage lifecycle rules and rejecting required fields.
  • Prove the CEL scalar core with Kani in a separate CI job and document the assurance boundaries.
  • Add invitation creation and public acceptance to the current generated React site, filter tenant choices by write permission, and exclude hidden fields from generated forms.

The new atomic field API defaults to an unsupported error for custom backends until they implement it; upload confirmation, scan completion, and clearing use it to avoid overwriting concurrent changes. Package versions are aligned for these API changes, including CLI 0.41.0. The invitation implementation targets the current generated React site, which replaced the old generated admin UI.

Validation: 2,459 workspace tests passed, with eight marked integration tests skipped in that run. The #148 regression reproduced the pre-fix 200-without-persistence bug. Nine live PostgreSQL HTTP tests passed, including conditional JSON PATCH read-back and stale-revision rejection; authorization-error tests verify 403 with an unchanged delta. The shared PostgreSQL live and SurrealDB tests passed separately, including changed enum defaults and concurrent attachment writes. All 28 Kani harnesses passed locally and in CI. Generated-site build, lint, and four invitation browser tests passed. All-target Clippy passed with warnings denied for the default, PostgreSQL, and SQL Server configurations. All six PR checks passed: Kani, Windows MSSQL build, PostgreSQL authorization/concurrency, site E2E, and SQL Server 2019/2022.

Closes #140
Closes #141
Closes #142
Closes #120
Closes #115
Closes #81

Closes #148

Resolve enum widening data loss, portable null equality and inequality, stable offset ordering, descending JSON sort directions, and id range filters. Add one shared storage contract across PostgreSQL, SurrealDB, and SQL Server.
Add a default-unsupported conditional field update to all storage adapters and the dynamic bridge. Preserve unrelated fields and PostgreSQL revisions, reject stale snapshots and normalize missing file state. Exercise concurrent clears, replacement rejection, stale completion and first uploads through the shared backend contract.
Exercise narrowing an enum while replacing its removed default on all storage adapters. Removed values must become null while retained values stay unchanged.
@rrrodzilla
rrrodzilla marked this pull request as ready for review September 9, 2026 22:08
@rrrodzilla rrrodzilla changed the title Fix data correctness, attachment lifecycle, CEL verification, and invitations Fix PATCH authorization, data correctness, attachments, and invitations Sep 9, 2026
@rrrodzilla
rrrodzilla merged commit abc475a into main Sep 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment