@peopl-health/nexus 5.56.0-dev.8633 → 5.56.1

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.
@@ -99,8 +99,10 @@ async function writeUnresolvedRequest({ code, trace, question, details, resoluti
99
99
  const fingerprint = createHash('sha1')
100
100
  .update(JSON.stringify([code, category || null, question || null, urgency || null, Boolean(forDoctorOffice)]))
101
101
  .digest('hex');
102
- let recordId = null;
103
- const duplicate = !replacesClosedTask && await recentUnresolvedCache.get(code) === fingerprint;
102
+ const cached = await recentUnresolvedCache.get(code);
103
+ const open = typeof cached === 'string' ? { fingerprint: cached, recordId: null } : cached;
104
+ const duplicate = !replacesClosedTask && open?.fingerprint === fingerprint;
105
+ let recordId = duplicate ? open.recordId ?? null : null;
104
106
  const written = await auditedWrite({
105
107
  trace,
106
108
  code,
@@ -123,7 +125,7 @@ async function writeUnresolvedRequest({ code, trace, question, details, resoluti
123
125
  return created;
124
126
  },
125
127
  });
126
- if (written) await recentUnresolvedCache.set(code, fingerprint);
128
+ if (written) await recentUnresolvedCache.set(code, { fingerprint, recordId });
127
129
  return { written, recordId, duplicate };
128
130
  }
129
131
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "5.56.0-dev.8633",
3
+ "version": "5.56.1",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",