Skip to content

Commit 2c3ee4e

Browse files
mldangeloclaude
andcommitted
fix(msg): preserve float precision in listen polling timestamp
The listen loop truncated message timestamps to integers via ${new_ts%.*}, causing the relay's strict > comparison to re-return the same messages every polling cycle. This made msg_say fire repeatedly for already-seen messages. Keep the full float timestamp so messages are properly excluded after being displayed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5496807 commit 2c3ee4e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/crabcode

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5879,11 +5879,12 @@ msg_listen() {
58795879
msg_log "<" "$from" "$text"
58805880
msg_say "$from" "$text"
58815881
done
5882-
# Update last_ts to the latest message timestamp
5882+
# Update last_ts to the latest message timestamp (keep full float precision
5883+
# so the relay's strict > comparison excludes already-seen messages)
58835884
local new_ts
58845885
new_ts=$(echo "$response" | jq -r '.[-1].ts // 0' 2>/dev/null)
58855886
if [ -n "$new_ts" ] && [ "$new_ts" != "0" ]; then
5886-
last_ts="${new_ts%.*}"
5887+
last_ts="$new_ts"
58875888
fi
58885889
fi
58895890

0 commit comments

Comments
 (0)