Spaces:
Sleeping
Sleeping
fix: update monitor.ts patch for upstream refactor
Browse filesUpstream OpenClaw refactored monitorWebInbox into smaller functions
(normalizeInboundMessage, enrichInboundMessage, enqueueInboundMessage).
Update the patch to match the new code structure — still moves
recordChannelActivity to after message enrichment.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
patches/web-inbound-record-activity-after-body.patch
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
|
|
|
|
|
| 1 |
--- a/src/web/inbound/monitor.ts
|
| 2 |
+++ b/src/web/inbound/monitor.ts
|
| 3 |
-
@@ -
|
| 4 |
return;
|
| 5 |
}
|
| 6 |
for (const msg of upsert.messages ?? []) {
|
|
@@ -9,19 +11,18 @@
|
|
| 9 |
- accountId: options.accountId,
|
| 10 |
- direction: "inbound",
|
| 11 |
- });
|
| 12 |
-
const
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
@@ -
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
};
|
| 20 |
+ recordChannelActivity({
|
| 21 |
+ channel: "whatsapp",
|
| 22 |
+ accountId: options.accountId,
|
| 23 |
+ direction: "inbound",
|
| 24 |
+ });
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
| 1 |
+
diff --git a/src/web/inbound/monitor.ts b/src/web/inbound/monitor.ts
|
| 2 |
+
index 6dc2ce5..982e5a5 100644
|
| 3 |
--- a/src/web/inbound/monitor.ts
|
| 4 |
+++ b/src/web/inbound/monitor.ts
|
| 5 |
+
@@ -399,11 +399,6 @@ export async function monitorWebInbox(options: {
|
| 6 |
return;
|
| 7 |
}
|
| 8 |
for (const msg of upsert.messages ?? []) {
|
|
|
|
| 11 |
- accountId: options.accountId,
|
| 12 |
- direction: "inbound",
|
| 13 |
- });
|
| 14 |
+
const inbound = await normalizeInboundMessage(msg);
|
| 15 |
+
if (!inbound) {
|
| 16 |
+
continue;
|
| 17 |
+
@@ -421,6 +416,11 @@ export async function monitorWebInbox(options: {
|
| 18 |
+
continue;
|
| 19 |
+
}
|
| 20 |
+
|
|
|
|
| 21 |
+ recordChannelActivity({
|
| 22 |
+ channel: "whatsapp",
|
| 23 |
+ accountId: options.accountId,
|
| 24 |
+ direction: "inbound",
|
| 25 |
+ });
|
| 26 |
+
await enqueueInboundMessage(msg, inbound, enriched);
|
| 27 |
+
}
|
| 28 |
+
};
|