add list_messages RPC to remove client-side N+1 #26
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_osis#26
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Clients that want all messages for one conversation currently have to call
chatmessage.list(returns every message SID in the entire domain) and then fetch each one viachatmessage.get, discarding any whoseconversation_siddoesn't match. For a modestly-populated DB (~200 messages across ~10 chats) this is ~200 JSON-RPC round trips to open a single conversation.Proposed fix: expose a
ConversationService.list_messages(conversation_sid: str) -> [ChatMessage]RPC that filters server-side and returns messages sorted bycreated_atascending. Measured outcome in the messaging UI: chat open drops from ~51 RPCs to 3.The
ChatMessage.conversation_sidfield is already marked[index]in the schema; a later follow-up could switch the impl to a true indexed lookup instead of the current O(N) scan.zaelgohary referenced this issue2026-04-19 08:26:46 +00:00
perf: add ConversationService.list_messages(conversation_sid) to remove client-side N+1to add list_messages RPC to remove client-side N+1zaelgohary referenced this issue from lhumina_code/hero_os2026-04-19 09:26:23 +00:00