super-productivity/packages/sync-providers/src/file-based/webdav/webdav.const.ts
Johannes Millan 2864a39c85
fix(sync): file-based provider atomicity & conflict UX (#8960) (#9004)
* docs(plugins): add microsoft 365 calendar provider plan

* docs(plugins): add microsoft 365 calendar provider plan

* docs(ios): plan internal testflight builds

* fix(sync): prevent file-based sync data loss

Preserve post-snapshot operations and stage remote baselines until durable apply.

Use conditional writes and a resumable marker for provider concurrency and legacy migration. Report trustworthy remote timestamps and document transport limits.

Refs #8960

* fix(sync): avoid biased conflict recommendations

Highlight a side only when its timestamp or known change count is strictly greater, leaving unknown and tied metadata neutral.

* test(sync): assert options arg on split-file processRemoteOps

The split-file snapshot path now routes post-snapshot ops through
_processRemoteOpsWithStartupCleanup, which calls processRemoteOps with an
(empty) options object. Update the assertion to match the 2-arg call so the
unit suite passes.

* refactor(sync): dedupe strong-ETag regex, document snapshot-op boundary

- Extract the duplicated RFC 7232 strong-entity-tag pattern into a single
  STRONG_ETAG_RE constant with a comment noting why the char class is safe to
  interpolate into an If-Match header (no CR/LF header splitting).
- Explain why sv === undefined ops are classified as snapshot-included: they are
  legacy migration ops fully contained in the snapshot, and _validateSnapshotRef
  enforces a clock-EQUAL boundary. No behavior change.
2026-07-14 19:23:24 +02:00

42 lines
821 B
TypeScript

/**
* WebDAV HTTP status codes
*/
export const WebDavHttpStatus = {
OK: 200,
CREATED: 201,
NO_CONTENT: 204,
MULTI_STATUS: 207,
MOVED_PERMANENTLY: 301,
NOT_MODIFIED: 304,
UNAUTHORIZED: 401,
NOT_FOUND: 404,
METHOD_NOT_ALLOWED: 405,
CONFLICT: 409,
PRECONDITION_FAILED: 412,
TOO_MANY_REQUESTS: 429,
INTERNAL_SERVER_ERROR: 500,
} as const;
/**
* WebDAV HTTP methods
*/
export const WebDavHttpMethod = {
GET: 'GET',
PUT: 'PUT',
DELETE: 'DELETE',
PROPFIND: 'PROPFIND',
MKCOL: 'MKCOL',
} as const;
/**
* WebDAV HTTP headers
*/
export const WebDavHttpHeader = {
AUTHORIZATION: 'Authorization',
CACHE_CONTROL: 'Cache-Control',
CONTENT_TYPE: 'Content-Type',
CONTENT_LENGTH: 'Content-Length',
DEPTH: 'Depth',
IF_MATCH: 'If-Match',
IF_NONE_MATCH: 'If-None-Match',
} as const;