@ricsam/r5d-worker 0.0.109 → 0.0.110
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/cjs/main.cjs +35 -12
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/main.mjs +35 -12
- package/dist/mjs/package.json +1 -1
- package/package.json +1 -1
package/dist/cjs/main.cjs
CHANGED
|
@@ -5840,18 +5840,13 @@ async function startWorker(options, projectRuntime = {
|
|
|
5840
5840
|
const refreshesDeferredConfiguration = deferredWorkspaceConfiguration !== null && activeWorkspaceIncidentId === null && message.deferWorkspaceSyncForIncidentId === void 0;
|
|
5841
5841
|
const digest = (0, import_recovery_store.workerOperationDigest)(message);
|
|
5842
5842
|
const cached = projectRuntime.configuration;
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
workspaceConfigured = true;
|
|
5848
|
-
activeWorkspaceIncidentId = cached.incidentId;
|
|
5849
|
-
deferredWorkspaceConfiguration = cached.deferred;
|
|
5843
|
+
const canReuseConfiguration = cached?.digest === digest && cached.workspaceSync?.remoteUrl === message.workspaceRemoteUrl && Boolean(cached.workspaceSync.credentialHelper) && cached.workspaceSync.credentialUsername === workerCredentialUsername && cached.workspaceSync.gitIdentity?.name === message.gitIdentity.name && cached.workspaceSync.gitIdentity?.email === message.gitIdentity.email && !unsafeWorkspaceSyncBouncePending && credentialGenerationFingerprint({ ...message, workerBaseUrl: baseUrl, workerAuthHeader: bearerAuthHeader }) === configuredCredentialGenerationFingerprint;
|
|
5844
|
+
if (!canReuseConfiguration) {
|
|
5845
|
+
advanceWorkerAdmissionGeneration();
|
|
5846
|
+
projectRuntime.configuration = void 0;
|
|
5850
5847
|
}
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
if (configured.result.outcome !== "failed") unsafeWorkspaceSyncRecoveryAttempts = 0;
|
|
5854
|
-
sendWorkerMessageFromCurrentSource(ws, {
|
|
5848
|
+
const configured = canReuseConfiguration ? cached.configured : await configureWorkerWorkspace(message, receiptGeneration);
|
|
5849
|
+
const sendConfigured = () => sendWorkerMessageFromCurrentSource(ws, {
|
|
5855
5850
|
type: "workspace_configured",
|
|
5856
5851
|
requestId: message.requestId,
|
|
5857
5852
|
result: configured.result,
|
|
@@ -5859,6 +5854,34 @@ async function startWorker(options, projectRuntime = {
|
|
|
5859
5854
|
aheadOfOriginBranches: configured.aheadOfOriginBranches,
|
|
5860
5855
|
...configured.deferredWorkspaceSyncForIncidentId ? { deferredWorkspaceSyncForIncidentId: configured.deferredWorkspaceSyncForIncidentId } : {}
|
|
5861
5856
|
});
|
|
5857
|
+
if (receiptGeneration !== workspaceConfigurationReceiptGeneration || currentWorkerSocket !== ws || ws.readyState !== WebSocket.OPEN) {
|
|
5858
|
+
sendConfigured();
|
|
5859
|
+
return;
|
|
5860
|
+
}
|
|
5861
|
+
if (canReuseConfiguration && configured.result.outcome !== "failed") {
|
|
5862
|
+
workspaceRemoteUrl = cached.workspaceSync.remoteUrl;
|
|
5863
|
+
workspaceCredentialHelper = cached.workspaceSync.credentialHelper;
|
|
5864
|
+
workspaceCredentialUsername = cached.workspaceSync.credentialUsername;
|
|
5865
|
+
workspaceGitIdentity = cached.workspaceSync.gitIdentity;
|
|
5866
|
+
workspaceConfigured = true;
|
|
5867
|
+
activeWorkspaceIncidentId = cached.incidentId;
|
|
5868
|
+
deferredWorkspaceConfiguration = cached.deferred;
|
|
5869
|
+
}
|
|
5870
|
+
projectRuntime.configuration = configured.result.outcome !== "failed" && workspaceRemoteUrl && workspaceCredentialHelper && workspaceCredentialUsername && workspaceGitIdentity ? {
|
|
5871
|
+
digest,
|
|
5872
|
+
workspaceSync: {
|
|
5873
|
+
remoteUrl: workspaceRemoteUrl,
|
|
5874
|
+
credentialHelper: workspaceCredentialHelper,
|
|
5875
|
+
credentialUsername: workspaceCredentialUsername,
|
|
5876
|
+
gitIdentity: workspaceGitIdentity
|
|
5877
|
+
},
|
|
5878
|
+
configured,
|
|
5879
|
+
incidentId: activeWorkspaceIncidentId,
|
|
5880
|
+
deferred: deferredWorkspaceConfiguration
|
|
5881
|
+
} : void 0;
|
|
5882
|
+
unsafeWorkspaceSyncBouncePending = false;
|
|
5883
|
+
if (configured.result.outcome !== "failed") unsafeWorkspaceSyncRecoveryAttempts = 0;
|
|
5884
|
+
sendConfigured();
|
|
5862
5885
|
sendLifecycleProgress(
|
|
5863
5886
|
configured.result.outcome === "failed" ? {
|
|
5864
5887
|
phase: "failed",
|
|
@@ -6701,7 +6724,7 @@ async function startWorker(options, projectRuntime = {
|
|
|
6701
6724
|
clearInterval(terminalReplayTimer);
|
|
6702
6725
|
terminalReplayTimer = void 0;
|
|
6703
6726
|
}
|
|
6704
|
-
if (projectRuntime.configuration) {
|
|
6727
|
+
if (currentWorkerSocket === ws && projectRuntime.configuration) {
|
|
6705
6728
|
projectRuntime.configuration.incidentId = activeWorkspaceIncidentId;
|
|
6706
6729
|
projectRuntime.configuration.deferred = deferredWorkspaceConfiguration;
|
|
6707
6730
|
}
|
package/dist/cjs/package.json
CHANGED
package/dist/mjs/main.mjs
CHANGED
|
@@ -5854,18 +5854,13 @@ async function startWorker(options, projectRuntime = {
|
|
|
5854
5854
|
const refreshesDeferredConfiguration = deferredWorkspaceConfiguration !== null && activeWorkspaceIncidentId === null && message.deferWorkspaceSyncForIncidentId === void 0;
|
|
5855
5855
|
const digest = workerOperationDigest(message);
|
|
5856
5856
|
const cached = projectRuntime.configuration;
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
workspaceConfigured = true;
|
|
5862
|
-
activeWorkspaceIncidentId = cached.incidentId;
|
|
5863
|
-
deferredWorkspaceConfiguration = cached.deferred;
|
|
5857
|
+
const canReuseConfiguration = cached?.digest === digest && cached.workspaceSync?.remoteUrl === message.workspaceRemoteUrl && Boolean(cached.workspaceSync.credentialHelper) && cached.workspaceSync.credentialUsername === workerCredentialUsername && cached.workspaceSync.gitIdentity?.name === message.gitIdentity.name && cached.workspaceSync.gitIdentity?.email === message.gitIdentity.email && !unsafeWorkspaceSyncBouncePending && credentialGenerationFingerprint({ ...message, workerBaseUrl: baseUrl, workerAuthHeader: bearerAuthHeader }) === configuredCredentialGenerationFingerprint;
|
|
5858
|
+
if (!canReuseConfiguration) {
|
|
5859
|
+
advanceWorkerAdmissionGeneration();
|
|
5860
|
+
projectRuntime.configuration = void 0;
|
|
5864
5861
|
}
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
if (configured.result.outcome !== "failed") unsafeWorkspaceSyncRecoveryAttempts = 0;
|
|
5868
|
-
sendWorkerMessageFromCurrentSource(ws, {
|
|
5862
|
+
const configured = canReuseConfiguration ? cached.configured : await configureWorkerWorkspace(message, receiptGeneration);
|
|
5863
|
+
const sendConfigured = () => sendWorkerMessageFromCurrentSource(ws, {
|
|
5869
5864
|
type: "workspace_configured",
|
|
5870
5865
|
requestId: message.requestId,
|
|
5871
5866
|
result: configured.result,
|
|
@@ -5873,6 +5868,34 @@ async function startWorker(options, projectRuntime = {
|
|
|
5873
5868
|
aheadOfOriginBranches: configured.aheadOfOriginBranches,
|
|
5874
5869
|
...configured.deferredWorkspaceSyncForIncidentId ? { deferredWorkspaceSyncForIncidentId: configured.deferredWorkspaceSyncForIncidentId } : {}
|
|
5875
5870
|
});
|
|
5871
|
+
if (receiptGeneration !== workspaceConfigurationReceiptGeneration || currentWorkerSocket !== ws || ws.readyState !== WebSocket.OPEN) {
|
|
5872
|
+
sendConfigured();
|
|
5873
|
+
return;
|
|
5874
|
+
}
|
|
5875
|
+
if (canReuseConfiguration && configured.result.outcome !== "failed") {
|
|
5876
|
+
workspaceRemoteUrl = cached.workspaceSync.remoteUrl;
|
|
5877
|
+
workspaceCredentialHelper = cached.workspaceSync.credentialHelper;
|
|
5878
|
+
workspaceCredentialUsername = cached.workspaceSync.credentialUsername;
|
|
5879
|
+
workspaceGitIdentity = cached.workspaceSync.gitIdentity;
|
|
5880
|
+
workspaceConfigured = true;
|
|
5881
|
+
activeWorkspaceIncidentId = cached.incidentId;
|
|
5882
|
+
deferredWorkspaceConfiguration = cached.deferred;
|
|
5883
|
+
}
|
|
5884
|
+
projectRuntime.configuration = configured.result.outcome !== "failed" && workspaceRemoteUrl && workspaceCredentialHelper && workspaceCredentialUsername && workspaceGitIdentity ? {
|
|
5885
|
+
digest,
|
|
5886
|
+
workspaceSync: {
|
|
5887
|
+
remoteUrl: workspaceRemoteUrl,
|
|
5888
|
+
credentialHelper: workspaceCredentialHelper,
|
|
5889
|
+
credentialUsername: workspaceCredentialUsername,
|
|
5890
|
+
gitIdentity: workspaceGitIdentity
|
|
5891
|
+
},
|
|
5892
|
+
configured,
|
|
5893
|
+
incidentId: activeWorkspaceIncidentId,
|
|
5894
|
+
deferred: deferredWorkspaceConfiguration
|
|
5895
|
+
} : void 0;
|
|
5896
|
+
unsafeWorkspaceSyncBouncePending = false;
|
|
5897
|
+
if (configured.result.outcome !== "failed") unsafeWorkspaceSyncRecoveryAttempts = 0;
|
|
5898
|
+
sendConfigured();
|
|
5876
5899
|
sendLifecycleProgress(
|
|
5877
5900
|
configured.result.outcome === "failed" ? {
|
|
5878
5901
|
phase: "failed",
|
|
@@ -6715,7 +6738,7 @@ async function startWorker(options, projectRuntime = {
|
|
|
6715
6738
|
clearInterval(terminalReplayTimer);
|
|
6716
6739
|
terminalReplayTimer = void 0;
|
|
6717
6740
|
}
|
|
6718
|
-
if (projectRuntime.configuration) {
|
|
6741
|
+
if (currentWorkerSocket === ws && projectRuntime.configuration) {
|
|
6719
6742
|
projectRuntime.configuration.incidentId = activeWorkspaceIncidentId;
|
|
6720
6743
|
projectRuntime.configuration.deferred = deferredWorkspaceConfiguration;
|
|
6721
6744
|
}
|
package/dist/mjs/package.json
CHANGED