Skip to content

Commit fe98e7a

Browse files
committed
fix(helpscout): serialize the connector change marker structurally
1 parent 9e5780f commit fe98e7a

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

‎apps/sim/connectors/helpscout/helpscout.ts‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ function lastActivityAt(conversation: HelpScoutConversation): string | null {
204204
/**
205205
* Change marker built only from listing fields, so unchanged conversations are never re-fetched.
206206
* Thread count, preview, and the activity timestamps move with new messages; the remaining
207-
* fields keep the indexed text and tags current. Tags are sorted so list and single-conversation
208-
* responses produce the same marker.
207+
* fields keep the indexed text and tags current. Fields are serialized as JSON so free text cannot
208+
* shift across field boundaries, and tags are sorted so list and single-conversation responses match.
209209
*/
210210
function conversationChangeMarker(conversation: HelpScoutConversation): string {
211-
return [
211+
return JSON.stringify([
212212
conversation.threads ?? '',
213213
conversation.status ?? '',
214214
conversation.userUpdatedAt ?? '',
@@ -221,11 +221,8 @@ function conversationChangeMarker(conversation: HelpScoutConversation): string {
221221
conversation.assignee ? personName(conversation.assignee) : '',
222222
conversation.primaryCustomer?.email ?? '',
223223
conversation.primaryCustomer ? personName(conversation.primaryCustomer) : '',
224-
(conversation.tags ?? [])
225-
.map((tag) => tag.tag ?? '')
226-
.sort(compareStrings)
227-
.join(','),
228-
].join('|')
224+
(conversation.tags ?? []).map((tag) => tag.tag ?? '').sort(compareStrings),
225+
])
229226
}
230227

231228
/** Spam and unpublished drafts are not support history worth indexing. */

0 commit comments

Comments
 (0)