@cydm/happy-elves 0.1.0-beta.284 → 0.1.0-beta.285
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/apps/cli/package.json
CHANGED
package/apps/daemon/package.json
CHANGED
|
@@ -230,21 +230,6 @@ export function createRelayContext(options) {
|
|
|
230
230
|
.get(claim.account_id, claim.request_id);
|
|
231
231
|
if (admission && (admission.finished_at !== null || admission.terminal_status !== null))
|
|
232
232
|
return {};
|
|
233
|
-
const session = options.db
|
|
234
|
-
.prepare(`SELECT status, current_head, last_turn_id, updated_at
|
|
235
|
-
FROM sessions
|
|
236
|
-
WHERE account_id = ? AND id = ?`)
|
|
237
|
-
.get(claim.account_id, claim.session_id);
|
|
238
|
-
if (admission?.dispatch === "delivered" &&
|
|
239
|
-
session &&
|
|
240
|
-
isSettledSessionProjectionStatus(session.status) &&
|
|
241
|
-
session.updated_at > claim.created_at &&
|
|
242
|
-
(session.last_turn_id === claim.turn_id || (session.current_head !== claim.turn_id && session.last_turn_id !== claim.turn_id))) {
|
|
243
|
-
return {
|
|
244
|
-
terminalStatus: terminalStatusForSettledSessionStatus(session.status),
|
|
245
|
-
finishedAt: session.updated_at,
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
233
|
const newerTerminal = options.db
|
|
249
234
|
.prepare(`SELECT 1
|
|
250
235
|
FROM relay_admissions
|
|
@@ -259,16 +244,6 @@ export function createRelayContext(options) {
|
|
|
259
244
|
.get(claim.account_id, claim.session_id, claim.request_id, claim.created_at);
|
|
260
245
|
return newerTerminal ? {} : undefined;
|
|
261
246
|
}
|
|
262
|
-
function terminalStatusForSettledSessionStatus(status) {
|
|
263
|
-
if (status === "failed")
|
|
264
|
-
return "failed";
|
|
265
|
-
if (status === "cancelled" || status === "closed")
|
|
266
|
-
return "cancelled";
|
|
267
|
-
return "completed";
|
|
268
|
-
}
|
|
269
|
-
function isSettledSessionProjectionStatus(status) {
|
|
270
|
-
return status === "ready" || status === "completed" || status === "cancelled" || status === "closed";
|
|
271
|
-
}
|
|
272
247
|
function claimSessionTurn(params) {
|
|
273
248
|
const existing = activeSessionClaim(params.accountId, params.sessionId);
|
|
274
249
|
if (existing && existing.request_id !== params.requestId)
|