@peopl-health/nexus 5.61.0-dev.11187 → 5.61.0-dev.11232
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/lib/clinical/services/gradeSourceService.js +33 -8
- package/lib/clinical/tools/getActiveSymptomLandscapeTool.js +1 -1
- package/lib/config/lifecycle.js +2 -1
- package/lib/services/escalationReviewService.js +28 -9
- package/lib/services/reviewAlertSweepService.js +6 -4
- package/lib/services/reviewDraftSweepService.js +3 -2
- package/package.json +1 -1
|
@@ -4,20 +4,34 @@ const { objectArg } = require('../../utils/jsonUtils');
|
|
|
4
4
|
|
|
5
5
|
const EXTRACTION_TOOL = 'extractClinicalInfo';
|
|
6
6
|
const LOOKUP_TOOL = 'lookupCtcaeEntry';
|
|
7
|
+
const LANDSCAPE_TOOLS = ['getRouterContextBundle', 'getActiveSymptomLandscape'];
|
|
8
|
+
const IMPRESSION_TOOLS = ['openCondition', 'recordClinicalImpression'];
|
|
7
9
|
|
|
8
10
|
const populated = (grades) => !!grades && Object.keys(grades).length > 0;
|
|
9
11
|
|
|
10
|
-
function
|
|
11
|
-
let scale = null;
|
|
12
|
+
function catalogScale(ctcaeTerm) {
|
|
12
13
|
try {
|
|
13
|
-
scale = getCtcaeCatalog().getGradeScale(ctcaeTerm);
|
|
14
|
+
const scale = getCtcaeCatalog().getGradeScale(ctcaeTerm);
|
|
15
|
+
return populated(scale) ? scale : null;
|
|
14
16
|
} catch {
|
|
15
17
|
return null;
|
|
16
18
|
}
|
|
17
|
-
const keys = Object.keys(scale || {});
|
|
18
|
-
return keys.length ? keys : null;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
function gradesDefined(ctcaeTerm) {
|
|
22
|
+
const scale = catalogScale(ctcaeTerm);
|
|
23
|
+
return scale ? Object.keys(scale) : null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// The refusal below prints the scale after this mark, so a retry in the same turn has read it.
|
|
27
|
+
const scaleDeliveredMark = (ctcaeTerm) => `CTCAE grade_scale for '${ctcaeTerm}':`;
|
|
28
|
+
|
|
29
|
+
const landscapeCases = (payload) => {
|
|
30
|
+
const data = payload.data || payload;
|
|
31
|
+
const cases = data?.landscape?.active_cases || data?.active_cases;
|
|
32
|
+
return Array.isArray(cases) ? cases : [];
|
|
33
|
+
};
|
|
34
|
+
|
|
21
35
|
function ladderReachedModel(trace, ctcaeTerm) {
|
|
22
36
|
if (!ctcaeTerm) return false;
|
|
23
37
|
const steps = Array.isArray(trace?.steps) ? trace.steps : [];
|
|
@@ -32,6 +46,10 @@ function ladderReachedModel(trace, ctcaeTerm) {
|
|
|
32
46
|
const entry = payload.data?.entry || payload.entry;
|
|
33
47
|
if (entry?.ctcae_term === ctcaeTerm && populated(entry.grades)) return true;
|
|
34
48
|
}
|
|
49
|
+
if (LANDSCAPE_TOOLS.includes(step.tool_name)
|
|
50
|
+
&& landscapeCases(payload).some((c) => c?.ctcae_term === ctcaeTerm && populated(c?.grade_scale))) return true;
|
|
51
|
+
if (IMPRESSION_TOOLS.includes(step.tool_name)
|
|
52
|
+
&& typeof payload.error === 'string' && payload.error.includes(scaleDeliveredMark(ctcaeTerm))) return true;
|
|
35
53
|
}
|
|
36
54
|
return false;
|
|
37
55
|
}
|
|
@@ -101,9 +119,16 @@ function noCuratedRubric(ctcaeTerm) {
|
|
|
101
119
|
}
|
|
102
120
|
|
|
103
121
|
function missingLadder(ctcaeTerm) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
122
|
+
const head = `source is 'agent_adjudicated' but the ${ctcaeTerm} grade scale did not reach you this turn, so there was no rubric to adjudicate against.`;
|
|
123
|
+
const scale = catalogScale(ctcaeTerm);
|
|
124
|
+
// Without the catalog the lookup may fail too, so the ungraded record stays available as the way out.
|
|
125
|
+
if (!scale) {
|
|
126
|
+
return `${head} Call lookupCtcaeEntry for '${ctcaeTerm}' and grade from the clauses it returns. `
|
|
127
|
+
+ 'If the lookup cannot return the scale, drop best_estimate AND source together and record possible_range alone.';
|
|
128
|
+
}
|
|
129
|
+
return `${head} Here it is — ${scaleDeliveredMark(ctcaeTerm)} ${JSON.stringify(scale)}. `
|
|
130
|
+
+ 'Read what the patient reported against these clauses, set matched_grade to the clause the evidence meets, '
|
|
131
|
+
+ 'and re-issue the call with the grade that clause supports. Keep best_estimate: a graded read is what the case needs.';
|
|
107
132
|
}
|
|
108
133
|
|
|
109
134
|
module.exports = {
|
|
@@ -2,7 +2,7 @@ const { assembleLandscape } = require('../services/symptomLandscapeService');
|
|
|
2
2
|
|
|
3
3
|
const definition = {
|
|
4
4
|
name: 'getActiveSymptomLandscape',
|
|
5
|
-
description: '**Does:** Returns a snapshot of ALL the patient\'s open symptom cases (`characterizing` | `monitoring`), each fusing the Condition with its head impression, plus active clusters. Read-only.\n\n**Required inputs:** none. Optional `minimum_priority` (`low` (default) returns everything; `medium` returns high+medium; `high` returns only high).\n\n**When to call:** only for a targeted re-read of the case landscape once `getRouterContextBundle` has already loaded the turn\'s context — for example after opening a case, or to narrow with a different `minimum_priority`. The routine load at the start of routing is the bundle\'s `landscape` section, not this tool.\n\n**A case flagged `stale_no_recent_evidence` has had no new evidence for two weeks or more.** `days_since_evidence` says how long. Ask whether the symptom is still there, and close the case with `recordClinicalImpression` `close` when it is not: an open case keeps consuming the landscape and keeps the symptom reading as active on the record.\n\n**When NOT to call:** for the current turn\'s observations (use `extractClinicalInfo`) or closed-case history.\n\n**Returns:** `active_cases[]` (each: `case_id`, `ctcae_term`, `status`, `opened_at`, `current_episode_id`, `mention_ids` (the evidence already on the case — on a turn that extracts nothing new, re-cite one of these with `source: \'carried_forward\'`), `grade_estimate`, `decision_posture`, `trajectory`, derived `priority` + `attention_flags`, `last_assessed_at`, `days_since_evidence`) sorted priority desc then most-recently-opened; `active_clusters[]` (each: `cluster_id`, `label`, `hypothesis_type`, `status`, `confidence`, `clinical_significance`, `member_case_ids`, `relationship_model`); `active_contingencies[]` — the safety nets already armed (each: `plan_id`, `related_case_id`, `related_cluster_id`, `concern`, `awaiting_characterization`, `status`, `created_at`, `expires_at`, `patient_fires_after_silence_minutes`). A target that already appears here does NOT need another `setContingencyPlan` arm — a duplicate is rejected; use `action: \'rearm\'` to replace its net or `action: \'resolve\'` to stand it down.',
|
|
5
|
+
description: '**Does:** Returns a snapshot of ALL the patient\'s open symptom cases (`characterizing` | `monitoring`), each fusing the Condition with its head impression, plus active clusters. Read-only.\n\n**Required inputs:** none. Optional `minimum_priority` (`low` (default) returns everything; `medium` returns high+medium; `high` returns only high).\n\n**When to call:** only for a targeted re-read of the case landscape once `getRouterContextBundle` has already loaded the turn\'s context — for example after opening a case, or to narrow with a different `minimum_priority`. The routine load at the start of routing is the bundle\'s `landscape` section, not this tool.\n\n**A case flagged `stale_no_recent_evidence` has had no new evidence for two weeks or more.** `days_since_evidence` says how long. Ask whether the symptom is still there, and close the case with `recordClinicalImpression` `close` when it is not: an open case keeps consuming the landscape and keeps the symptom reading as active on the record.\n\n**When NOT to call:** for the current turn\'s observations (use `extractClinicalInfo`) or closed-case history.\n\n**Returns:** `active_cases[]` (each: `case_id`, `ctcae_term`, `status`, `opened_at`, `current_episode_id`, `mention_ids` (the evidence already on the case — on a turn that extracts nothing new, re-cite one of these with `source: \'carried_forward\'`), `grade_estimate`, `grade_scale` (the CTCAE clauses for the case\'s term — grade against these; they count as the rubric for an `agent_adjudicated` grade this turn), `decision_posture`, `trajectory`, derived `priority` + `attention_flags`, `last_assessed_at`, `days_since_evidence`) sorted priority desc then most-recently-opened; `active_clusters[]` (each: `cluster_id`, `label`, `hypothesis_type`, `status`, `confidence`, `clinical_significance`, `member_case_ids`, `relationship_model`); `active_contingencies[]` — the safety nets already armed (each: `plan_id`, `related_case_id`, `related_cluster_id`, `concern`, `awaiting_characterization`, `status`, `created_at`, `expires_at`, `patient_fires_after_silence_minutes`). A target that already appears here does NOT need another `setContingencyPlan` arm — a duplicate is rejected; use `action: \'rearm\'` to replace its net or `action: \'resolve\'` to stand it down.',
|
|
6
6
|
strict: false,
|
|
7
7
|
replayScope: 'turn',
|
|
8
8
|
parameters: {
|
package/lib/config/lifecycle.js
CHANGED
|
@@ -7,6 +7,7 @@ const { setPreprocessingHandler } = require('../services/preprocessingService');
|
|
|
7
7
|
const { clearTriageHistoryCache } = require('../services/triageHistoryService');
|
|
8
8
|
const { stopInboundRecoverySweep } = require('../services/inboundRecoveryService');
|
|
9
9
|
const { stopReviewDraftSweep } = require('../services/reviewDraftSweepService');
|
|
10
|
+
const { stopReviewAlertSweep } = require('../services/reviewAlertSweepService');
|
|
10
11
|
const { clearInteractiveRoutes } = require('../core/interactiveRouteService');
|
|
11
12
|
const { _resetDefaultInstance } = require('../core/NexusMessaging');
|
|
12
13
|
const { _resetSafetyNetConfig } = require('../clinical/config/safetyNetConfig');
|
|
@@ -22,7 +23,7 @@ const SWEEP_STOP_MS = 2000;
|
|
|
22
23
|
|
|
23
24
|
function stopAllSweeps({ timeoutMs = SWEEP_STOP_MS, label = '[lifecycle]' } = {}) {
|
|
24
25
|
const stopped = Promise.allSettled([
|
|
25
|
-
stopSafetyNetSweep(), stopRecommendationRecoverySweep(), stopInboundRecoverySweep(), stopReviewDraftSweep(),
|
|
26
|
+
stopSafetyNetSweep(), stopRecommendationRecoverySweep(), stopInboundRecoverySweep(), stopReviewDraftSweep(), stopReviewAlertSweep(),
|
|
26
27
|
]);
|
|
27
28
|
return withTimeout(stopped, timeoutMs, 'sweeps.stop')
|
|
28
29
|
.catch(error => logger.warn(`${label} A sweep was still running`, { error: error.message }));
|
|
@@ -43,6 +43,10 @@ const DRAFT_DEBOUNCE_MS = 60 * 1000;
|
|
|
43
43
|
const DRAFT_OPERATOR = 'bot:escalationDraft';
|
|
44
44
|
const DIRECT_CHAT_ATTEMPTS = 3;
|
|
45
45
|
const RECHECK_DELAY_MS = 60 * 1000;
|
|
46
|
+
const ALERT_RETRY_DELAY_MS = 2 * 60 * 1000;
|
|
47
|
+
// Scheduling bookkeeping is not a change to the review: it leaves updatedAt alone, so the handoff and
|
|
48
|
+
// close checks that match on updatedAt are not tripped by a sweep.
|
|
49
|
+
const BOOKKEEPING = { timestamps: false };
|
|
46
50
|
const PREVIOUS_REVIEW_WINDOW_MS = 30 * 24 * 60 * 60 * 1000;
|
|
47
51
|
const DUPLICATE_KEY_ERROR = 11000;
|
|
48
52
|
const DOCUMENTING_STATUSES = ['open', 'documenting', 'draft_ready', 'returned'];
|
|
@@ -807,6 +811,7 @@ async function scheduleDoctorAlert(review, alarm, now) {
|
|
|
807
811
|
const scheduled = await getEscalationReview().updateOne(
|
|
808
812
|
{ _id: review._id, $nor: [{ doctorAlertKind: 'initial', doctorAlertDueAt: { $gt: now } }] },
|
|
809
813
|
{ $set: { doctorAlertDueAt: now, doctorAlertKind: 'initial', doctorAlertAttempts: 0 } },
|
|
814
|
+
BOOKKEEPING,
|
|
810
815
|
);
|
|
811
816
|
if (scheduled.matchedCount) Object.assign(review, { doctorAlertDueAt: now, doctorAlertKind: 'initial' });
|
|
812
817
|
} catch (error) {
|
|
@@ -853,7 +858,7 @@ async function sendScheduledDoctorAlert({ id, kind, lease = null, now = new Date
|
|
|
853
858
|
const EscalationReview = getEscalationReview();
|
|
854
859
|
const ours = lease ? { doctorAlertDueAt: lease } : {};
|
|
855
860
|
const release = (set = { doctorAlertDueAt: null, doctorAlertKind: null, doctorAlertAttempts: 0 }) => EscalationReview
|
|
856
|
-
.updateOne({ _id: id, ...ours }, { $set: set });
|
|
861
|
+
.updateOne({ _id: id, ...ours }, { $set: set }, BOOKKEEPING);
|
|
857
862
|
|
|
858
863
|
const review = await loadReview(reviewIdOf(id));
|
|
859
864
|
// Once anything was decided, the doctor has nothing left to be alerted about.
|
|
@@ -876,7 +881,12 @@ async function sendScheduledDoctorAlert({ id, kind, lease = null, now = new Date
|
|
|
876
881
|
let delivery;
|
|
877
882
|
try {
|
|
878
883
|
const { approver, message } = await prepareDoctorAlert(review, kind, urgencyLevel);
|
|
879
|
-
|
|
884
|
+
// Preparing takes lookups; a decision or close that landed meanwhile leaves nothing to alert about.
|
|
885
|
+
const fresh = await loadReview(review._id);
|
|
886
|
+
const stillDue = kind === 'realert'
|
|
887
|
+
? realertStillDue(fresh, initial)
|
|
888
|
+
: !fresh.closedAt && PRE_DECISION_STATUSES.includes(fresh.status);
|
|
889
|
+
if (!stillDue) {
|
|
880
890
|
await release();
|
|
881
891
|
return null;
|
|
882
892
|
}
|
|
@@ -903,14 +913,19 @@ async function sendScheduledDoctorAlert({ id, kind, lease = null, now = new Date
|
|
|
903
913
|
}
|
|
904
914
|
|
|
905
915
|
const sent = { kind, urgencyLevel, transport: null, messageId: null, physicianEmail: null, error: null, ...delivery, teamAlerted, sentAt: now };
|
|
906
|
-
const updated = await EscalationReview.findOneAndUpdate({ _id: review._id }, { $push: { doctorAlerts: sent } }, { new: true }).lean();
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
:
|
|
916
|
+
const updated = await EscalationReview.findOneAndUpdate({ _id: review._id }, { $push: { doctorAlerts: sent } }, { ...BOOKKEEPING, new: true }).lean();
|
|
917
|
+
// A failed stat alert still arms the re-alert, which also alerts the team. A failed asap alert has no
|
|
918
|
+
// such backstop, so it is tried again; the sweep counts the attempts and drops it after the last.
|
|
919
|
+
if (kind === 'initial' && urgencyLevel === 'stat') {
|
|
920
|
+
await release({ doctorAlertDueAt: new Date(now.getTime() + statRealertMs()), doctorAlertKind: 'realert', doctorAlertAttempts: 0 });
|
|
921
|
+
} else if (kind === 'initial' && sent.error) {
|
|
922
|
+
await release({ doctorAlertDueAt: new Date(Date.now() + ALERT_RETRY_DELAY_MS), doctorAlertKind: 'initial' });
|
|
923
|
+
} else {
|
|
924
|
+
await release();
|
|
925
|
+
}
|
|
911
926
|
// A more urgent alarm that landed while this alert was out could not take the lease. Read after the
|
|
912
927
|
// release, so one landing later finds no lease and schedules itself.
|
|
913
|
-
if (kind === 'initial' && urgencyLevel !== 'stat') {
|
|
928
|
+
if (kind === 'initial' && urgencyLevel !== 'stat' && !sent.error) {
|
|
914
929
|
try {
|
|
915
930
|
const latest = await loadReview(review._id);
|
|
916
931
|
const topNow = topUrgencyOf(latest);
|
|
@@ -921,6 +936,7 @@ async function sendScheduledDoctorAlert({ id, kind, lease = null, now = new Date
|
|
|
921
936
|
await EscalationReview.updateOne(
|
|
922
937
|
{ _id: review._id, doctorAlertDueAt: null },
|
|
923
938
|
{ $set: { doctorAlertDueAt: new Date(Date.now() + RECHECK_DELAY_MS), doctorAlertKind: 'initial', doctorAlertAttempts: 0 } },
|
|
939
|
+
BOOKKEEPING,
|
|
924
940
|
).catch(() => {});
|
|
925
941
|
}
|
|
926
942
|
}
|
|
@@ -1425,7 +1441,8 @@ async function recordDoctorDecision({
|
|
|
1425
1441
|
$set: returnReason === 'no_requiere'
|
|
1426
1442
|
? { status: 'cancelled', closedBy: operator, closedAt: new Date(), cancellationReason: `no_requiere${comment ? `: ${comment}` : ''}` }
|
|
1427
1443
|
: { status: statusAfter(decision) },
|
|
1428
|
-
|
|
1444
|
+
// Nothing new since the draft was checked against: an update landing meanwhile refuses the decision.
|
|
1445
|
+
}, { drafts: { $size: review.drafts.length }, alarms: { $size: (review.alarms ?? []).length }, updates: { $size: (review.updates ?? []).length } });
|
|
1429
1446
|
await audit(updated, operator, requestId, {
|
|
1430
1447
|
action: 'doctor_decision', decision, source, draftNumber, ...(returnReason && { returnReason }),
|
|
1431
1448
|
});
|
|
@@ -1746,6 +1763,8 @@ async function syncEscalationReviewCase({ id, syncedBy, requestId = null } = {})
|
|
|
1746
1763
|
}
|
|
1747
1764
|
|
|
1748
1765
|
module.exports = {
|
|
1766
|
+
BOOKKEEPING,
|
|
1767
|
+
PRE_DECISION_STATUSES,
|
|
1749
1768
|
_resetEscalationReviewIndexes,
|
|
1750
1769
|
addCallLog,
|
|
1751
1770
|
addDraft,
|
|
@@ -3,7 +3,7 @@ const { createIntervalSweeper } = require('../utils/intervalSweeper');
|
|
|
3
3
|
const { withTimeout } = require('../utils/timeoutUtils');
|
|
4
4
|
const { getEscalationReview } = require('../models/escalationReviewModel');
|
|
5
5
|
|
|
6
|
-
const { sendScheduledDoctorAlert } = require('./escalationReviewService');
|
|
6
|
+
const { BOOKKEEPING, PRE_DECISION_STATUSES, sendScheduledDoctorAlert } = require('./escalationReviewService');
|
|
7
7
|
|
|
8
8
|
const SWEEP_LIMIT = 10;
|
|
9
9
|
const DEFAULT_SWEEP_INTERVAL_MS = 30 * 1000;
|
|
@@ -14,14 +14,15 @@ const MAX_ALERT_ATTEMPTS = 3;
|
|
|
14
14
|
const SELF_HEAL_WINDOW_MS = 60 * 60 * 1000;
|
|
15
15
|
const ALERTED_URGENCIES = ['stat', 'asap'];
|
|
16
16
|
|
|
17
|
-
// Due alerts, plus a recent stat/asap review that never got its first
|
|
18
|
-
// failed after the alarm was written.
|
|
17
|
+
// Due alerts, plus a recent stat/asap review still waiting on a decision that never got its first
|
|
18
|
+
// alert because scheduling it failed after the alarm was written.
|
|
19
19
|
const dueQuery = (now) => ({
|
|
20
20
|
closedAt: null,
|
|
21
21
|
$or: [
|
|
22
22
|
{ doctorAlertDueAt: { $lte: now } },
|
|
23
23
|
{
|
|
24
24
|
doctorAlertDueAt: null,
|
|
25
|
+
status: { $in: PRE_DECISION_STATUSES },
|
|
25
26
|
'doctorAlerts.0': { $exists: false },
|
|
26
27
|
alarms: { $elemMatch: { urgencyLevel: { $in: ALERTED_URGENCIES }, raisedAt: { $gte: new Date(now.getTime() - SELF_HEAL_WINDOW_MS) } } },
|
|
27
28
|
},
|
|
@@ -53,6 +54,7 @@ async function sweepDoctorAlerts({ now = new Date(), clock = () => new Date() }
|
|
|
53
54
|
$set: { doctorAlertDueAt: null, doctorAlertKind: null, doctorAlertAttempts: 0 },
|
|
54
55
|
$push: { doctorAlerts: { kind, urgencyLevel: null, error: `dropped after ${doctorAlertAttempts} attempts`, sentAt: claimedAt } },
|
|
55
56
|
},
|
|
57
|
+
BOOKKEEPING,
|
|
56
58
|
);
|
|
57
59
|
continue;
|
|
58
60
|
}
|
|
@@ -63,7 +65,7 @@ async function sweepDoctorAlerts({ now = new Date(), clock = () => new Date() }
|
|
|
63
65
|
.findOneAndUpdate(
|
|
64
66
|
{ _id: reviewId, doctorAlertDueAt },
|
|
65
67
|
{ $set: { doctorAlertDueAt: lease, doctorAlertKind: kind }, $inc: { doctorAlertAttempts: 1 } },
|
|
66
|
-
{ new: true, projection: { _id: 1 } },
|
|
68
|
+
{ ...BOOKKEEPING, new: true, projection: { _id: 1 } },
|
|
67
69
|
)
|
|
68
70
|
.lean();
|
|
69
71
|
if (!claimed) continue;
|
|
@@ -3,7 +3,7 @@ const { createIntervalSweeper } = require('../utils/intervalSweeper');
|
|
|
3
3
|
const { withTimeout } = require('../utils/timeoutUtils');
|
|
4
4
|
const { getEscalationReview } = require('../models/escalationReviewModel');
|
|
5
5
|
|
|
6
|
-
const { generateBotDraft } = require('./escalationReviewService');
|
|
6
|
+
const { BOOKKEEPING, generateBotDraft } = require('./escalationReviewService');
|
|
7
7
|
|
|
8
8
|
// One review per pass keeps a pass inside the sweeper's pass timeout, so shutdown always waits for it.
|
|
9
9
|
const SWEEP_LIMIT = 1;
|
|
@@ -19,7 +19,7 @@ async function draftReview(EscalationReview, { _id, draftDueAt, draftAttempts =
|
|
|
19
19
|
// again once the lease expires, and an alarm or update that lands meanwhile replaces the lease.
|
|
20
20
|
const lease = new Date(now.getTime() + LEASE_MS);
|
|
21
21
|
const claimed = await EscalationReview
|
|
22
|
-
.findOneAndUpdate({ _id, draftDueAt }, { $set: { draftDueAt: lease } }, { new: true, projection: { _id: 1 } })
|
|
22
|
+
.findOneAndUpdate({ _id, draftDueAt }, { $set: { draftDueAt: lease } }, { ...BOOKKEEPING, new: true, projection: { _id: 1 } })
|
|
23
23
|
.lean();
|
|
24
24
|
if (!claimed) return false;
|
|
25
25
|
|
|
@@ -44,6 +44,7 @@ async function draftReview(EscalationReview, { _id, draftDueAt, draftAttempts =
|
|
|
44
44
|
willRetry
|
|
45
45
|
? { $set: { draftDueAt: new Date(Date.now() + RETRY_DELAY_MS) }, $inc: { draftAttempts: 1 } }
|
|
46
46
|
: { $set: { draftDueAt: null } },
|
|
47
|
+
BOOKKEEPING,
|
|
47
48
|
);
|
|
48
49
|
return false;
|
|
49
50
|
}
|