Gap message lookup skips boundary message and returns wrong sendTime
Author: FGadvancerCreated Sep 17, 2026Updated Sep 17, 2026
Description
When querying the message immediately before a given sequence, the document limit is calculated with seq % singleGocMsgNum. At document boundaries this produces an off-by-one limit: for example, querying around sequence 101 uses limit 1 in the new document instead of reading all 100 messages in the previous document. The lookup can therefore skip the correct preceding message and return an incorrect sendTime (or no timestamp).
Expected behavior
Calculate the in-document offset as (seq - 1) % singleGocMsgNum, consistent with document indexing and message indexing.
Source: openimsdk/open-im-server