You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# CHANGELOG
2
2
3
-
> Summary index — current release details are packaged in [changelogs/v2.0.7.md](./changelogs/v2.0.7.md); historical details live in the repository changelog archive.
3
+
> Summary index — current v2.0.7 release-candidate details are packaged in [changelogs/v2.0.7.md](./changelogs/v2.0.7.md); historical details live in the repository changelog archive.
4
4
> **Last updated**: 2026-06-17
5
5
6
6
---
@@ -9,7 +9,7 @@
9
9
10
10
| Version | Date | Summary | Details |
11
11
|---------|------|---------|---------|
12
-
|[v2.0.7](./changelogs/v2.0.7.md)| 2026-06-16 | Patch: release-readiness alignment plus core correctness fixes for model OCC, transaction cache invalidation, sync ordering, soft-delete reads, driver option forwarding, distributed invalidation, query bounds, and aggregate write-cache invalidation |[View](./changelogs/v2.0.7.md)|
12
+
|[v2.0.7](./changelogs/v2.0.7.md)| 2026-06-16 | Patch candidate: release-readiness alignment plus core correctness fixes for model OCC, transaction cache invalidation, sync ordering, soft-delete reads, driver option forwarding, distributed invalidation, query bounds, and aggregate write-cache invalidation |[View](./changelogs/v2.0.7.md)|
13
13
|[v2.0.6](./changelogs/v2.0.6.md)| 2026-06-15 | Patch: dependency alignment to `schema-dsl@2.0.11` so downstream frameworks inherit the ESM/CJS shared custom type registry fix |[View](./changelogs/v2.0.6.md)|
14
14
|[v2.0.5](./changelogs/v2.0.5.md)| 2026-06-13 | Patch: Model schema adapter delegates DSL type authority to `schema-dsl@2.0.10`, removing the duplicated monSQLize allowlist while preserving legacy aliases and business literals |[View](./changelogs/v2.0.5.md)|
15
15
|[v2.0.4](./changelogs/v2.0.4.md)| 2026-06-12 | Patch: production-safe Model index rollout controls, `schema-dsl@2.0.9`, capability-index wording cleanup, and documentation home refinements |[View](./changelogs/v2.0.4.md)|
Copy file name to clipboardExpand all lines: changelogs/unreleased.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# Unreleased
2
2
3
3
- Added automatic optimistic locking for versioned Model single-document writes, including automatic direct-`_id` version lookup, explicit `expectedVersion` overrides, versioned `save()` replacement guards, and configurable `updateMany` version modes.
4
+
- Forwarded transaction/read options such as `session` into automatic model OCC version pre-reads, hardened file-backed Change Stream resume tokens with atomic replacement plus strict load validation, and made unexpected Change Stream closes visible through `isRunning: false` / `lastError`.
4
5
- Awaited async query-cache reads/writes so Redis/MultiLevel cache backends no longer make first cached reads resolve to `undefined`, and made Change Stream resume-token saves strict by default with retry knobs plus explicit `strictSave: false` legacy mode.
5
6
- Fixed `findPage` cursor anchors for nested dot-path sort fields, accepted `project` as a query projection alias across read helpers, and documented process-level Model registration plus ObjectId `maxDepth` conversion boundaries.
6
7
- Fixed `incrementOne` driver-option forwarding, closed runtime-owned Redis cache adapters on `runtime.close()`, made SSH tunnels fail fast for multi-host/SRV MongoDB URIs and post-ready disconnects, enforced slow-query batch `maxBufferSize` during in-flight flushes, wired prewarmed `findPage` bookmarks into page-jump reads, and reduced redundant rebuilds in the memory-server validation matrix.
Copy file name to clipboardExpand all lines: changelogs/v2.0.7.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# monSQLize v2.0.7
2
2
3
-
> Release date: 2026-06-16
3
+
> Prepared date: 2026-06-16
4
+
> Release status: Prepared, not yet published
4
5
> Type: Patch
5
6
> Compatibility: Backward compatible
6
7
@@ -15,9 +16,10 @@ v2.0.7 closes the release-readiness gap after the v2.0.6 review and hardens the
15
16
-`npm run test:unit` now delegates to `test/run-tests.cjs unit`, matching the maintained unit suite instead of a stale hand-written file list.
16
17
- Validation ledgers now reflect the current 56 runnable TypeScript documentation examples.
17
18
-`initializeModelV1Methods()` now reports factory failures through the runtime logger when available instead of writing directly to `console.warn`.
18
-
- Versioned models now enforce true single-document optimistic concurrency control: callers must provide the expected version in the filter or `expectedVersion`, stale writes throw `WRITE_CONFLICT`, and `updateMany()` is rejected for versioned models.
19
+
- Versioned models now enforce true optimistic concurrency control for single-document writes: direct `_id` filters automatically read the current version, callers may override with `expectedVersion` / `version`, and stale writes throw `WRITE_CONFLICT`.
20
+
- Versioned `updateMany()` now supports explicit modes: `counter` for native batch version counters, `strict` for per-document conditional updates, and `off` for compatibility escape hatches.
19
21
- Transaction cache invalidations are recorded during the transaction and replayed only after a successful commit; commit retry now handles `UnknownTransactionCommitResult`.
20
-
- Change Stream sync events are processed serially so target writes and resume token persistence stay ordered.
22
+
- Change Stream sync events are processed serially so target writes and resume token persistence stay ordered; resume token files use atomic replacement, strict load validation, and backup files in file mode; unexpected stream close events now mark sync as stopped in stats.
21
23
- Soft-delete filters now cover the standard model read surface, including `findPage`, ID reads, `distinct`, `aggregate`, `stream`, and `explain`.
22
24
- MongoDB read paths now forward driver options such as `session`, `readConcern`, `readPreference`, `collation`, `hint`, `maxTimeMS`, and aggregation options instead of dropping them through a narrow whitelist.
23
25
- Query caches now avoid session-scoped reads and build stable cache keys only from result-shaping options.
|`sync.resumeToken.strictLoad`| boolean | same as `strictSave`| When true, unreadable or corrupted stored tokens stop Change Stream startup instead of starting from no token. |
840
842
|`sync.resumeToken.strictSave`| boolean |`true`| When true, token save failures stop Change Stream sync before the resume token can advance. |
841
843
|`sync.resumeToken.saveRetries`| number |`0`| Retry attempts before a strict token save fails. |
842
844
|`sync.resumeToken.saveRetryDelayMs`| number |`100`| Delay between token-save retries. |
Copy file name to clipboardExpand all lines: docs/en/release-preflight.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,12 @@ You can also manually trigger the **Release Preflight** workflow through GitHub
13
13
1. Check whether `package-lock.json` is consistent with the current `package.json` version and does not contain `file:` / `workspace:` / sibling local path residue.
14
14
2. Check whether the changelog file corresponding to the current `package.json` version exists.
15
15
3. Check whether the necessary documents for project management exist:
|`strictLoad`| boolean | ❌ | same as `strictSave`| Treat unreadable or corrupted stored tokens as fatal instead of starting from no token |
123
124
|`strictSave`| boolean | ❌ |`true`| Treat token save failures as fatal so CDC never advances without a persisted token |
124
125
|`saveRetries`| number | ❌ |`0`| Retry attempts before a strict token save fails |
125
126
|`saveRetryDelayMs`| number | ❌ |`100`| Delay between token-save retries |
126
127
127
-
Resume token persistence is strict by default. After all eligible targets apply an event successfully, monSQLize saves the event resume token; `syncedCount` advances only after that save succeeds. If token persistence fails after the configured retries, the manager records `tokenSaveErrorCount` / `lastTokenSaveError`, closes the live stream, marks `isRunning: false`, and does not process later queued events. Set `strictSave: false` only for legacy best-effort behavior, where a restart may replay already-applied events. Built-in MongoDB targets are idempotent (`replaceOne(..., { upsert: true })` / `deleteOne()`); custom `apply` targets should still deduplicate by change event `_id`.
128
+
Resume token persistence is strict by default. File storage writes to a same-directory temporary file, fsyncs it, keeps the previous token as `<path>.bak`, and then atomically renames the temporary file into place. Startup also validates the stored token: a corrupted token fails fast when `strictLoad` is true, instead of silently starting without a resume token. After all eligible targets apply an event successfully, monSQLize saves the event resume token; `syncedCount` advances only after that save succeeds. If token persistence fails after the configured retries, the manager records `tokenSaveErrorCount` / `lastTokenSaveError`, closes the live stream, marks `isRunning: false`, and does not process later queued events. Set `strictSave: false` and `strictLoad: false` only for legacy best-effort behavior, where a restart may replay already-applied events or start without the previously stored token. Built-in MongoDB targets are idempotent (`replaceOne(..., { upsert: true })` / `deleteOne()`); custom `apply` targets should still deduplicate by change event `_id`.
128
129
129
130
---
130
131
@@ -241,6 +242,9 @@ console.log(stats);
241
242
// errorCount: 4,
242
243
// startTime: 2026-01-17T...,
243
244
// lastEventTime: 2026-01-17T...,
245
+
// lastError: null,
246
+
// tokenSaveErrorCount: 0,
247
+
// lastTokenSaveError: null,
244
248
// targets: [...]
245
249
// }
246
250
```
@@ -303,13 +307,14 @@ rs.initiate()
303
307
**Automatic processing**:
304
308
- Failure of a single target does not affect other targets
305
309
- A resume-token save failure stops the sync manager before the token can advance
306
-
- Change Stream driver errors are logged and reflected in stats; monitor `isRunning` / `errorCount` and restart the manager or runtime from your supervisor when needed
310
+
- Change Stream driver errors and unexpected stream closes are logged and reflected in stats; monitor `isRunning`, `errorCount`, and `lastError`, then restart the manager or runtime from your supervisor when needed
0 commit comments