harper 5.3.3 → 5.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/resources/DatabaseTransaction.d.ts +5 -1
- package/dist/resources/DatabaseTransaction.js +21 -5
- package/dist/resources/DatabaseTransaction.js.map +1 -1
- package/dist/resources/LMDBTransaction.d.ts +1 -1
- package/dist/resources/LMDBTransaction.js +4 -3
- package/dist/resources/LMDBTransaction.js.map +1 -1
- package/dist/resources/Table.js +85 -36
- package/dist/resources/Table.js.map +1 -1
- package/dist/server/DurableSubscriptionsSession.js +4 -7
- package/dist/server/DurableSubscriptionsSession.js.map +1 -1
- package/dist/server/mqtt.js +21 -9
- package/dist/server/mqtt.js.map +1 -1
- package/dist/server/serverHelpers/contentTypes.js +8 -2
- package/dist/server/serverHelpers/contentTypes.js.map +1 -1
- package/dist/server/serverHelpers/sharedMessageEncoding.js +3 -2
- package/dist/server/serverHelpers/sharedMessageEncoding.js.map +1 -1
- package/package.json +1 -1
- package/resources/DESIGN.md +6 -2
- package/resources/DatabaseTransaction.ts +25 -5
- package/resources/LMDBTransaction.ts +4 -3
- package/resources/Table.ts +99 -42
- package/server/DESIGN.md +7 -1
- package/server/DurableSubscriptionsSession.ts +4 -7
- package/server/mqtt.ts +18 -10
- package/server/serverHelpers/contentTypes.ts +8 -1
- package/server/serverHelpers/sharedMessageEncoding.ts +3 -2
- package/studio/web/assets/{Chat-B-Rd-ft9.js → Chat-DjZNWwwA.js} +1 -1
- package/studio/web/assets/{FloatingChat-CFypO7kh.js → FloatingChat-BWfKK_RX.js} +3 -3
- package/studio/web/assets/{SearchDialog-BRIyPiBl.js → SearchDialog-CdlNxWef.js} +1 -1
- package/studio/web/assets/{apiToken-BraYnzvC.js → apiToken-DyI8IwU3.js} +1 -1
- package/studio/web/assets/{applications-XCds8-ZP.js → applications-DgGopKJq.js} +1 -1
- package/studio/web/assets/{cssMode-BY1w91l8.js → cssMode-4ddO86ey.js} +1 -1
- package/studio/web/assets/{editor-D5mpVs1b.js → editor-DATuu7_v.js} +1 -1
- package/studio/web/assets/{html-DiXKiahz.js → html-c4OKnEF1.js} +1 -1
- package/studio/web/assets/{htmlMode-DitVJ707.js → htmlMode-yXjqUsW9.js} +1 -1
- package/studio/web/assets/{index-D8kyF6dt.js → index-CIK9Nhgo.js} +5 -5
- package/studio/web/assets/{index.lazy-DgbjUxLo.js → index.lazy-DQpKL_QQ.js} +1 -1
- package/studio/web/assets/{javascript-BBVXeMDm.js → javascript-CP1WPkLu.js} +1 -1
- package/studio/web/assets/{jsonMode-D85_j2oD.js → jsonMode-BWsIHqbb.js} +1 -1
- package/studio/web/assets/{languageServices-U3mWhpRL.js → languageServices-Ca72n4Ql.js} +1 -1
- package/studio/web/assets/{lspLanguageFeatures-CoymyM3c.js → lspLanguageFeatures-BQdsSDeh.js} +1 -1
- package/studio/web/assets/{notifications-CPgEC6ZP.js → notifications-BYgO5-yk.js} +1 -1
- package/studio/web/assets/{notifications-D_VqhHnx.js → notifications-DsGk-TnW.js} +1 -1
- package/studio/web/assets/{operations-D8aaKYty.js → operations-Dy69AlTr.js} +1 -1
- package/studio/web/assets/{profile-DM5E6Xls.js → profile-DzQvoYBF.js} +1 -1
- package/studio/web/assets/{regions-WFvXqryO.js → regions-Sv_IN7XA.js} +1 -1
- package/studio/web/assets/{register-B7DvfAGj.js → register-AM2_79FO.js} +2 -2
- package/studio/web/assets/{request-ChoMERRk.js → request-BJj8dbdU.js} +1 -1
- package/studio/web/assets/{setComponentFile-BHk22Rh6.js → setComponentFile-BCnAnxjR.js} +1 -1
- package/studio/web/assets/{setup-wNdpTrVH.js → setup-Ca4RpPzm.js} +2 -2
- package/studio/web/assets/{status-CYoonm9V.js → status-D05eZ5pQ.js} +1 -1
- package/studio/web/assets/{toggleHighContrast-CKEm-P4K.js → toggleHighContrast-JRkLfyfb.js} +1 -1
- package/studio/web/assets/{tsMode-Dv35qHmn.js → tsMode-C_-eSRVR.js} +1 -1
- package/studio/web/assets/{typescript-Bly1EW8o.js → typescript-BYXigM_n.js} +1 -1
- package/studio/web/assets/{useEntityRestURL-Cg3P0MOb.js → useEntityRestURL-HHmjsRm9.js} +1 -1
- package/studio/web/assets/{workers-DVtjrvUa.js → workers-DY0ka4Y7.js} +1 -1
- package/studio/web/assets/{xml-DjAPbgLN.js → xml-CdGINpmN.js} +1 -1
- package/studio/web/assets/{yaml-oTUyoJy1.js → yaml-DYeF07_w.js} +1 -1
- package/studio/web/index.html +1 -1
|
@@ -128,6 +128,7 @@ export type TransactionWrite = {
|
|
|
128
128
|
appendedTo?: RocksTransaction;
|
|
129
129
|
stagedIn?: DatabaseTransaction;
|
|
130
130
|
priorWrite?: TransactionWrite;
|
|
131
|
+
keyId?: unknown;
|
|
131
132
|
chainsStagedState?: boolean;
|
|
132
133
|
pendingPriorWrite?: TransactionWrite | null;
|
|
133
134
|
stagedEntry?: Partial<Entry>;
|
|
@@ -141,6 +142,8 @@ export type TransactionWrite = {
|
|
|
141
142
|
innerCommit?: MaybePromise<CommitResolution>;
|
|
142
143
|
reloadCommitBase?: boolean;
|
|
143
144
|
stagedOn?: RocksTransaction;
|
|
145
|
+
committedOn?: RocksTransaction;
|
|
146
|
+
committedRound?: number;
|
|
144
147
|
baseReadTxn?: any;
|
|
145
148
|
writeGeneration?: WriteGeneration;
|
|
146
149
|
instanceClosed?: boolean;
|
|
@@ -198,6 +201,7 @@ export declare class DatabaseTransaction implements Transaction {
|
|
|
198
201
|
readTxn: ReadTransaction;
|
|
199
202
|
readTxnRefCount: number;
|
|
200
203
|
readTxnsUsed: number;
|
|
204
|
+
readTxnGeneration: number;
|
|
201
205
|
timeout: number;
|
|
202
206
|
writeTimeout: number;
|
|
203
207
|
writeTick: number;
|
|
@@ -306,7 +310,7 @@ export declare class DatabaseTransaction implements Transaction {
|
|
|
306
310
|
*/
|
|
307
311
|
closeOwnedReadIterators(): number;
|
|
308
312
|
useReadTxn(disableSnapshot?: boolean): ReadTransaction;
|
|
309
|
-
doneReadTxn(): void;
|
|
313
|
+
doneReadTxn(generation?: number): void;
|
|
310
314
|
private releaseRetainedWriteIntents;
|
|
311
315
|
/**
|
|
312
316
|
* Force-release the retained native read handle without touching staged writes. Used by the
|
|
@@ -620,6 +620,10 @@ class DatabaseTransaction {
|
|
|
620
620
|
readTxn;
|
|
621
621
|
readTxnRefCount;
|
|
622
622
|
readTxnsUsed;
|
|
623
|
+
// Bumped each time this instance acquires a read handle, so a reference can be returned to the
|
|
624
|
+
// acquisition it came from (doneReadTxn()). Not the handle's identity: lmdb-js hands back the same
|
|
625
|
+
// read Txn object for a new snapshot.
|
|
626
|
+
readTxnGeneration = 0;
|
|
623
627
|
timeout;
|
|
624
628
|
writeTick = -1;
|
|
625
629
|
timeoutBudget = 0;
|
|
@@ -742,6 +746,7 @@ class DatabaseTransaction {
|
|
|
742
746
|
readTransactionOwners.set(transaction, this);
|
|
743
747
|
this.rangeReadActive = false;
|
|
744
748
|
this.readTxnsUsed = 1;
|
|
749
|
+
this.readTxnGeneration++;
|
|
745
750
|
this.baseReadRefConsumed = false;
|
|
746
751
|
this.handleOpenedAt = performance.now();
|
|
747
752
|
}
|
|
@@ -843,11 +848,12 @@ class DatabaseTransaction {
|
|
|
843
848
|
// is not worth doing either, so those reads stay untraced.
|
|
844
849
|
if (DEBUG_LONG_TXNS && this.stackTraces)
|
|
845
850
|
this.stackTraces.push(new StartedTransaction());
|
|
846
|
-
|
|
851
|
+
if (readTxn)
|
|
852
|
+
this.readTxnsUsed++;
|
|
847
853
|
return readTxn;
|
|
848
854
|
}
|
|
849
|
-
doneReadTxn() {
|
|
850
|
-
if (!this.transaction)
|
|
855
|
+
doneReadTxn(generation = this.readTxnGeneration) {
|
|
856
|
+
if (!this.transaction || generation !== this.readTxnGeneration)
|
|
851
857
|
return;
|
|
852
858
|
if (--this.readTxnsUsed === 0) {
|
|
853
859
|
// The native handle was only being held open for the read iterators: any writes staged
|
|
@@ -926,7 +932,7 @@ class DatabaseTransaction {
|
|
|
926
932
|
let writesForStore = (this.writesByKey ??= new Map()).get(operation.store);
|
|
927
933
|
if (!writesForStore)
|
|
928
934
|
this.writesByKey.set(operation.store, (writesForStore = new Map()));
|
|
929
|
-
const keyId = writeKeyId(operation.key);
|
|
935
|
+
const keyId = (operation.keyId = writeKeyId(operation.key));
|
|
930
936
|
const priorWrite = writesForStore.get(keyId);
|
|
931
937
|
if (priorWrite)
|
|
932
938
|
operation.priorWrite = priorWrite;
|
|
@@ -1806,6 +1812,8 @@ class DatabaseTransaction {
|
|
|
1806
1812
|
operation.trackRecordVersion = true;
|
|
1807
1813
|
if (operation.trackRecordVersion)
|
|
1808
1814
|
operation.recordVersionApplied = false;
|
|
1815
|
+
operation.committedOn = transaction;
|
|
1816
|
+
operation.committedRound = txnRetries;
|
|
1809
1817
|
try {
|
|
1810
1818
|
completion = operation.commit(writeVersion, operation.entry, (wasSaved || this.isReplay) && txnRetries > 0, transaction, this);
|
|
1811
1819
|
}
|
|
@@ -2274,11 +2282,19 @@ class DatabaseTransaction {
|
|
|
2274
2282
|
this.trackActiveCommitHandle(replayTransaction);
|
|
2275
2283
|
if (prevStagedTxnTime)
|
|
2276
2284
|
this.setHandleStagedTxnTime(replayTransaction, prevStagedTxnTime);
|
|
2285
|
+
const abandoned = transaction;
|
|
2286
|
+
const abandonedLogged = hasDurableLog(abandoned);
|
|
2277
2287
|
transaction = replayTransaction;
|
|
2278
2288
|
try {
|
|
2279
2289
|
for (const operation of this.writes) {
|
|
2280
2290
|
if (!operation?.saved)
|
|
2281
2291
|
continue;
|
|
2292
|
+
// A non-durable abandoned handle left no readable audit entry; a durable one may
|
|
2293
|
+
// have published its log and must retain the retry shield.
|
|
2294
|
+
if (operation.appendedTo === abandoned && !abandonedLogged) {
|
|
2295
|
+
operation.appendedAuditEntry = false;
|
|
2296
|
+
operation.appendedTo = undefined;
|
|
2297
|
+
}
|
|
2282
2298
|
this.save(operation, replayTransaction, true, options);
|
|
2283
2299
|
}
|
|
2284
2300
|
}
|
|
@@ -2880,7 +2896,7 @@ class DatabaseTransaction {
|
|
|
2880
2896
|
}
|
|
2881
2897
|
}
|
|
2882
2898
|
else {
|
|
2883
|
-
while (this.readTxnsUsed > 0)
|
|
2899
|
+
while (this.transaction && this.readTxnsUsed > 0)
|
|
2884
2900
|
this.doneReadTxn(); // release the read snapshot when we abort, we assume we don't need it
|
|
2885
2901
|
}
|
|
2886
2902
|
// A write-only transaction never took a read reference (getReadTxn was never called), so the
|