@@ -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 */
210210function 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