🍃 fix: Amazon DocumentDB Compatibility for Pipeline-Form Updates (#14495)

* 🍃 fix: Amazon DocumentDB Compatibility for Pipeline-Form Updates

- Rewrite acceptTerms without aggregation-pipeline update + $$NOW (null-guarded first-acceptance claim preserves the original timestamp under concurrent and repeat requests)
- Rewrite decrementTagCounts clamp-at-zero decrement as ordered two-op bulkWrite (clamp before guarded $inc)
- Rewrite extendFilesTTL TTL hold as projected read + per-doc guarded $set via tenantSafeBulkWrite, preserving only-widens/ceiling/cleared-stays-permanent semantics
- Log background index-build failures via Model 'index' listeners (previously swallowed silently, e.g. partialFilterExpression rejection on DocumentDB <5.0)
- Add misc/documentdb live-compatibility harness + assessment (AWS-cited)
- Fix latent file.spec helper bug: createdAt backdating was silently stripped by mongoose immutability

Closes #14488

* 🍃 fix: Harden DocumentDB-Safe Updates Against Cross-Call Races

Addresses Codex review on #14495:
- decrementTagCounts: normalize-null / $inc / clamp-negative op triple so
  interleaved decrements of the same tag converge on max(0, ...) exactly as
  the serialized pipeline did (clamp keys on count < 0, not count < amount)
- acceptTerms: guard the repeat-acceptance fallback with a non-null timestamp
  (exact complement of the claim guard) and retry the claim when a
  config/reset-terms.js reset races between the two updates, so acceptance
  never resurrects a reset cycle without a fresh audit timestamp

* 👷 ci: Suppress Ignored-File Warnings in Changed-File ESLint Run

Changed files under config-ignored paths (packages/data-schemas/misc/**)
emit "File ignored" warnings that fail --max-warnings=0.
This commit is contained in:
Danny Avila 2026-07-28 22:14:34 -04:00 committed by GitHub
parent 6dae785e31
commit 23d1ad473d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 757 additions and 57 deletions

View file

@ -61,8 +61,11 @@ jobs:
fi
# Run ESLint
# --no-warn-ignored: changed files under config-ignored paths
# (e.g. packages/data-schemas/misc/**) must not fail --max-warnings=0
npx eslint --no-error-on-unmatched-pattern \
--config eslint.config.mjs \
--no-warn-ignored \
--max-warnings=0 \
-- "${CHANGED_FILES[@]}"