velocious 1.0.621 → 1.0.622
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/README.md +6 -2
- package/build/database/drivers/base.js +20 -3
- package/build/database/drivers/mssql/index.js +42 -36
- package/build/environment-handlers/base.js +9 -0
- package/build/environment-handlers/node.js +16 -0
- package/build/frontend-model-controller.js +20 -10
- package/build/frontend-models/base.js +90 -25
- package/build/frontend-models/remote-request-context.js +29 -0
- package/build/http-client/websocket-client.js +32 -0
- package/build/http-server/client/websocket-session.js +4 -1
- package/build/remote-request-context.js +97 -0
- package/build/src/database/drivers/base.d.ts +8 -0
- package/build/src/database/drivers/base.d.ts.map +1 -1
- package/build/src/database/drivers/base.js +16 -4
- package/build/src/database/drivers/mssql/index.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/index.js +47 -41
- package/build/src/environment-handlers/base.d.ts +8 -0
- package/build/src/environment-handlers/base.d.ts.map +1 -1
- package/build/src/environment-handlers/base.js +9 -1
- package/build/src/environment-handlers/node.d.ts +8 -0
- package/build/src/environment-handlers/node.d.ts.map +1 -1
- package/build/src/environment-handlers/node.js +15 -1
- package/build/src/frontend-model-controller.d.ts +3 -1
- package/build/src/frontend-model-controller.d.ts.map +1 -1
- package/build/src/frontend-model-controller.js +11 -7
- package/build/src/frontend-models/base.d.ts +4 -0
- package/build/src/frontend-models/base.d.ts.map +1 -1
- package/build/src/frontend-models/base.js +78 -25
- package/build/src/frontend-models/remote-request-context.d.ts +15 -0
- package/build/src/frontend-models/remote-request-context.d.ts.map +1 -0
- package/build/src/frontend-models/remote-request-context.js +26 -0
- package/build/src/http-client/websocket-client.d.ts +8 -0
- package/build/src/http-client/websocket-client.d.ts.map +1 -1
- package/build/src/http-client/websocket-client.js +31 -1
- package/build/src/http-server/client/websocket-session.d.ts.map +1 -1
- package/build/src/http-server/client/websocket-session.js +4 -2
- package/build/src/remote-request-context.d.ts +34 -0
- package/build/src/remote-request-context.d.ts.map +1 -0
- package/build/src/remote-request-context.js +83 -0
- package/build/src/sync/sync-client-types.d.ts +10 -0
- package/build/src/sync/sync-client-types.d.ts.map +1 -1
- package/build/src/sync/sync-client-types.js +3 -1
- package/build/src/sync/sync-client.d.ts.map +1 -1
- package/build/src/sync/sync-client.js +31 -7
- package/build/src/sync/sync-realtime-bridge.d.ts.map +1 -1
- package/build/src/sync/sync-realtime-bridge.js +8 -2
- package/build/src/testing/shared-transaction-connection-coordinator.d.ts +9 -0
- package/build/src/testing/shared-transaction-connection-coordinator.d.ts.map +1 -1
- package/build/src/testing/shared-transaction-connection-coordinator.js +15 -1
- package/build/src/testing/test-runner.js +2 -2
- package/build/sync/sync-client-types.js +2 -0
- package/build/sync/sync-client.js +31 -6
- package/build/sync/sync-realtime-bridge.js +7 -1
- package/build/testing/shared-transaction-connection-coordinator.js +16 -0
- package/build/testing/test-runner.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/database/drivers/base.js +20 -3
- package/src/database/drivers/mssql/index.js +42 -36
- package/src/environment-handlers/base.js +9 -0
- package/src/environment-handlers/node.js +16 -0
- package/src/frontend-model-controller.js +20 -10
- package/src/frontend-models/base.js +90 -25
- package/src/frontend-models/remote-request-context.js +29 -0
- package/src/http-client/websocket-client.js +32 -0
- package/src/http-server/client/websocket-session.js +4 -1
- package/src/remote-request-context.js +97 -0
- package/src/sync/sync-client-types.js +2 -0
- package/src/sync/sync-client.js +31 -6
- package/src/sync/sync-realtime-bridge.js +7 -1
- package/src/testing/shared-transaction-connection-coordinator.js +16 -0
- package/src/testing/test-runner.js +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
3
|
import recordChanges from "../database/record-changes.js"
|
|
4
|
+
import {mergeRemoteRequestContext} from "../remote-request-context.js"
|
|
4
5
|
|
|
5
6
|
import SyncApiClient from "./sync-api-client.js"
|
|
6
7
|
import {VELOCIOUS_SYNC_CHANNEL} from "./sync-channel-name.js"
|
|
@@ -141,10 +142,15 @@ export default class SyncRealtimeBridge {
|
|
|
141
142
|
}
|
|
142
143
|
|
|
143
144
|
const resourceType = channelDescriptor.resourceType ?? null
|
|
145
|
+
const params = mergeRemoteRequestContext({
|
|
146
|
+
context: this.syncClient.config.requestContext,
|
|
147
|
+
label: "Sync client request context",
|
|
148
|
+
params: {...channelDescriptor.params, authenticationToken}
|
|
149
|
+
})
|
|
144
150
|
const subscription = client.subscribeChannel(channelDescriptor.channel, {
|
|
145
151
|
onMessage: (body) => this.enqueueApply({body, resourceType}),
|
|
146
152
|
onResume: () => this.schedulePull(),
|
|
147
|
-
params
|
|
153
|
+
params
|
|
148
154
|
})
|
|
149
155
|
|
|
150
156
|
channels.push({channel: channelDescriptor.channel, resourceType, subscription})
|
|
@@ -157,3 +157,19 @@ export async function coordinateSharedTransactionConnection(connection, callback
|
|
|
157
157
|
return await coordinateRootSharedTransactionConnection(connection, registration, callback)
|
|
158
158
|
}))
|
|
159
159
|
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Runs physical query work without inheriting this connection's coordinator owner.
|
|
163
|
+
* Unregistered connections have no coordinator ownership to clear.
|
|
164
|
+
* @template T
|
|
165
|
+
* @param {import("../database/drivers/base.js").default} connection - Physical connection.
|
|
166
|
+
* @param {() => Promise<T>} callback - Physical query work.
|
|
167
|
+
* @returns {Promise<T>} - Callback result.
|
|
168
|
+
*/
|
|
169
|
+
export async function runWithoutSharedTransactionCoordinatorOwner(connection, callback) {
|
|
170
|
+
if (!connectionRegistrations.has(connection)) return await callback()
|
|
171
|
+
|
|
172
|
+
const environmentHandler = connection.configuration.getEnvironmentHandler()
|
|
173
|
+
|
|
174
|
+
return await environmentHandler.runWithoutSharedTransactionCoordinatorOwner(connection, callback)
|
|
175
|
+
}
|
|
@@ -1436,7 +1436,7 @@ export default class TestRunner {
|
|
|
1436
1436
|
testSharedConnectionsActive = true
|
|
1437
1437
|
|
|
1438
1438
|
try {
|
|
1439
|
-
if (testArgs.databaseCleaning?.transaction === true) {
|
|
1439
|
+
if (testArgs.databaseCleaning?.transaction === true || testArgs.type == "request") {
|
|
1440
1440
|
sharedTransactionBrokerPreparation = await this.prepareSharedTransactionBroker()
|
|
1441
1441
|
}
|
|
1442
1442
|
|