super-productivity/packages/shared-schema/src/migrations/project-delete-wins-barrier-v3-to-v4.ts
Johannes Millan 99f923ad6c
docs(sync): fix stale schema-compat docs, add bump policy, rescope Task 6 (#9119)
* docs(sync): fix stale schema docs, add bump policy, rescope Task 6

* docs(sync): add severity-triage and schema-bump rules to AGENTS.md

* docs(sync): fix review findings in schema compat docs
2026-07-17 15:37:06 +02:00

23 lines
1,019 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { SchemaMigration } from '../migration.types';
/**
* Compatibility barrier for delete-wins project deletions.
*
* The state shape and historical operations are unchanged. New schema-v4
* deleteProject operations carry an explicit payload marker; leaving older
* operations untouched ensures they retain their original timestamp-based LWW
* semantics after receiver-side migration.
*
* NOTE: released pre-v4 clients (v17.0.0v18.14.0) apply v4 ops unmigrated
* and treat the marker as an inert actionPayload key — they keep resolving
* project-delete conflicts by timestamp LWW. The version stamp fences only
* post-v18.14.0 receivers, which block newer-schema ops outright. See the bump
* policy in schema-version.ts.
*/
export const ProjectDeleteWinsBarrierMigration_v3v4: SchemaMigration = {
fromVersion: 3,
toVersion: 4,
description: 'Gate marked project delete-wins conflict semantics',
requiresOperationMigration: false,
migrateState: (state: unknown): unknown => state,
};