develop #70

Merged
eliott merged 12 commits from develop into main 2026-10-16 17:41:53 +02:00
Owner
No description provided.
refactor(sync): split push and pull services for the complexity gate
All checks were successful
tests / test (pull_request) Successful in 3m15s
774583c25a
Split every function the Fallow new-only gate flagged (CRAP >= 30) into
helpers with cyclomatic complexity of at most 4, without changing
behaviour. Pure decisions (error-to-outcome mapping, insert and update
values, frame renumbering outcome, validation message, date revival,
unique candidate, resync edge, page splitting) move to sync-rules.ts with
unit tests; the DB steps become small private methods. The per-op
transaction and the shoot locking order are unchanged. The convergence
spec's pullAll helper is split into per-entity, per-row and tombstone
helpers.

Claude-Session: https://claude.ai/code/session_013Ew5mX388EkuWC6ytSKkdc
Reviewed-on: #68
Merge main into develop: sync support on the 1.0.0 refactors
Some checks failed
tests / test (pull_request) Failing after 1m1s
ea5326ea55
Re-applies the sync feature (feat/sync-support, 0.11.0) on top of main's
refactors and release 1.0.0:

- Schemas: a shared syncColumns() helper (updatedAt and syncedAt, both
  timestamp(3)) in db/audit-columns.ts, used by catalogAuditColumns and by
  shoot, frame, folder and frame_location; sync pull indexes on every synced
  table. Fixes the film_format sync index, which paged on updatedAt.
- Migration: the sync migration is regenerated as 0030 after main's 0028
  and 0029. It truncates updatedAt to the millisecond (as 0029 did for
  published_at) and starts syncedAt from the last known edit. Tested by
  test/int/migration-0030.int-spec.ts.
- Services: tombstones are recorded through main's ownedRow/assertOwnedRow
  helpers; ownedCrudModule imports SyncModule for the catalog services.
- Sync: the 409 texts come from common/duplicate-messages like the REST
  endpoints', film formats are unique per owner on push too, the DTOs
  follow strict mode and @nestjs/swagger's mapped types.
- OpenAPI: the four sync routes are documented with response DTOs, synced
  rows are open objects (additionalProperties) in the contract test, and
  the contract test exercises a sync cycle. syncedAt is documented on the
  catalog, folder, frame and frame-location responses.
- Tests: DELETE answers 204 and PATCH /frame-location answers the row.
- Dependencies: @better-auth/expo pinned to the better-auth version
  (1.6.12). Version 1.1.0.
eliott merged commit 33c3a908c8 into main 2026-10-16 17:41:53 +02:00
Sign in to join this conversation.
No reviewers
No labels
run-ci
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
RollNote/rollnote-api!70
No description provided.