Commit d8cd2d0
fix(chatwoot): force state sync, fix newlines, detect phone-sent messages
Addresses three upstream issues:
- evolution-foundation#2403: Force connection state to 'close' in DB when sendMessage catches
a connection-closed error, preventing stale 'connected' state in UI
- evolution-foundation#2412/evolution-foundation#2415: Sanitize double-escaped newlines (\n → \n) and trim
trailing newlines in messages sent from Chatwoot to WhatsApp
- evolution-foundation#2446: Detect messages sent from the linked WhatsApp phone app
(fromMe=true + event=messages.upsert) and classify them as private
notes in Chatwoot with a prefix, preventing agent confusion
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 8922835 commit d8cd2d0
2 files changed
Lines changed: 62 additions & 12 deletions
File tree
- src/api/integrations
- channel/whatsapp
- chatbot/chatwoot/services
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2579 | 2579 | | |
2580 | 2580 | | |
2581 | 2581 | | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
2582 | 2611 | | |
2583 | 2612 | | |
2584 | 2613 | | |
| |||
Lines changed: 33 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1057 | 1057 | | |
1058 | 1058 | | |
1059 | 1059 | | |
| 1060 | + | |
1060 | 1061 | | |
1061 | 1062 | | |
1062 | 1063 | | |
| |||
1075 | 1076 | | |
1076 | 1077 | | |
1077 | 1078 | | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
1078 | 1083 | | |
1079 | 1084 | | |
1080 | 1085 | | |
| |||
1338 | 1343 | | |
1339 | 1344 | | |
1340 | 1345 | | |
| 1346 | + | |
| 1347 | + | |
1341 | 1348 | | |
1342 | 1349 | | |
1343 | 1350 | | |
| |||
2086 | 2093 | | |
2087 | 2094 | | |
2088 | 2095 | | |
2089 | | - | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
2090 | 2107 | | |
2091 | 2108 | | |
2092 | 2109 | | |
| |||
2140 | 2157 | | |
2141 | 2158 | | |
2142 | 2159 | | |
2143 | | - | |
| 2160 | + | |
2144 | 2161 | | |
2145 | 2162 | | |
2146 | 2163 | | |
2147 | 2164 | | |
| 2165 | + | |
2148 | 2166 | | |
2149 | 2167 | | |
2150 | 2168 | | |
| |||
2159 | 2177 | | |
2160 | 2178 | | |
2161 | 2179 | | |
2162 | | - | |
| 2180 | + | |
2163 | 2181 | | |
2164 | 2182 | | |
2165 | 2183 | | |
2166 | 2184 | | |
| 2185 | + | |
2167 | 2186 | | |
2168 | 2187 | | |
2169 | 2188 | | |
| |||
2180 | 2199 | | |
2181 | 2200 | | |
2182 | 2201 | | |
2183 | | - | |
| 2202 | + | |
2184 | 2203 | | |
2185 | | - | |
| 2204 | + | |
2186 | 2205 | | |
2187 | 2206 | | |
2188 | 2207 | | |
| |||
2227 | 2246 | | |
2228 | 2247 | | |
2229 | 2248 | | |
2230 | | - | |
| 2249 | + | |
2231 | 2250 | | |
2232 | | - | |
| 2251 | + | |
2233 | 2252 | | |
2234 | 2253 | | |
2235 | 2254 | | |
| |||
2285 | 2304 | | |
2286 | 2305 | | |
2287 | 2306 | | |
2288 | | - | |
| 2307 | + | |
2289 | 2308 | | |
2290 | 2309 | | |
2291 | 2310 | | |
| 2311 | + | |
| 2312 | + | |
2292 | 2313 | | |
2293 | 2314 | | |
2294 | 2315 | | |
| |||
2318 | 2339 | | |
2319 | 2340 | | |
2320 | 2341 | | |
2321 | | - | |
| 2342 | + | |
2322 | 2343 | | |
2323 | | - | |
| 2344 | + | |
2324 | 2345 | | |
2325 | 2346 | | |
2326 | 2347 | | |
| |||
2337 | 2358 | | |
2338 | 2359 | | |
2339 | 2360 | | |
2340 | | - | |
| 2361 | + | |
2341 | 2362 | | |
2342 | | - | |
| 2363 | + | |
2343 | 2364 | | |
2344 | 2365 | | |
2345 | 2366 | | |
| |||
0 commit comments