Skip to content

fix(mam): Offset start date by one second to prevent duplicate messag… - #2204

Merged
jubalh merged 1 commit into
masterfrom
fix/2198
Aug 25, 2026
Merged

fix(mam): Offset start date by one second to prevent duplicate messag…#2204
jubalh merged 1 commit into
masterfrom
fix/2198

Conversation

@jubalh

@jubalh jubalh commented Jul 30, 2026

Copy link
Copy Markdown
Member

…e fetch

When requesting MAM, using the exact timestamp of the previously received message as the start date can lead to fetching that same message again.

Offsetting the start date by one second ensures successive MAM queries resume strictly after the last received message, avoiding duplicate entries.

Fixes: #2198

@jubalh jubalh added this to the next milestone Jul 30, 2026
@jubalh jubalh self-assigned this Jul 30, 2026
When requesting MAM catchup, using the exact timestamp of the previously
received message as the start date can lead to fetching that same
message again.

Now we use the unique `stanzaid` of the last message to initiate
the catchup with `<after>` so that MAM queries resume strictly after
the last received message.

A timestamp based offset of one second is preserved strictly as a
fallback mechanism for legacy database records that lack a stanza ID.

Ref: #2198
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
@jubalh
jubalh merged commit 45fb022 into master Aug 25, 2026
12 checks passed
@jubalh
jubalh deleted the fix/2198 branch August 25, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unread messages double history

1 participant