mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-07-31 22:12:34 +02:00
Optimize jump to unread to reduce flicker on large backlog load.
This commit is contained in:
@@ -1005,6 +1005,23 @@ class TestReadStateEndpoints:
|
||||
assert result["last_read_ats"][f"channel-{chan_key}"] == 1000
|
||||
assert result["last_read_ats"][f"contact-{contact_key}"] == 1000
|
||||
|
||||
# The oldest unread message per conversation, used by the client to place
|
||||
# the unread divider without paging back through history.
|
||||
first_chan = await MessageRepository.get_by_content(
|
||||
msg_type="CHAN",
|
||||
conversation_key=chan_key,
|
||||
text="Bob: hello",
|
||||
sender_timestamp=1001,
|
||||
)
|
||||
assert result["first_unread_ids"][f"channel-{chan_key}"] == first_chan.id
|
||||
first_dm = await MessageRepository.get_by_content(
|
||||
msg_type="PRIV",
|
||||
conversation_key=contact_key,
|
||||
text="hi @[TeStUsEr] there",
|
||||
sender_timestamp=1005,
|
||||
)
|
||||
assert result["first_unread_ids"][f"contact-{contact_key}"] == first_dm.id
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_unreads_no_name_skips_mentions(self, test_db):
|
||||
"""Unreads without a radio name returns counts but no mention flags."""
|
||||
|
||||
Reference in New Issue
Block a user