perf(messaging): batch node + reply lookups in message loading (#5149)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
James Rich 2026-04-15 10:48:26 -05:00 committed by GitHub
parent dea364dd17
commit 878905aea3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 49 additions and 18 deletions

View file

@ -309,6 +309,16 @@ interface PacketDao {
)
suspend fun getPacketByPacketId(packetId: Int): PacketEntity?
@Transaction
@Query(
"""
SELECT * FROM packet
WHERE packet_id IN (:packetIds)
AND (myNodeNum = 0 OR myNodeNum = (SELECT myNodeNum FROM my_node))
""",
)
suspend fun getPacketsByPacketIds(packetIds: List<Int>): List<PacketEntity>
@Query(
"""
SELECT * FROM packet