communication: list_messages + stamp timestamps #27

Merged
zaelgohary merged 1 commit from development_add_list_messages_and_timestamp_trigger into development 2026-04-19 09:27:32 +00:00
Member

Summary

Two communication-domain changes:

  1. Add ConversationService.list_messages(conversation_sid) -> [ChatMessage]#26
    Server-side filter sorted by created_at ascending. Removes the client-side N+1 where opening one chat meant listing every message SID in the entire domain and fetching each one individually. In the messaging UI this drops chat-open from ~51 RPCs to 3.

  2. Stamp created_at/updated_at in chatmessage_trigger_save_pre#25
    Previously a no-op, so every saved message had created_at = 0 and rendered as 00:00 / Jan 1 1970 downstream. The trigger is the right place because it catches every save path (send, reply, react, future handlers).

Generated code

*_generated.rs, openrpc.json, and the SDK client method are the output of the schema build; committed so downstream consumers (e.g. hero_archipelagos) can pick up the new method without re-running the generator.

Test plan

  • cargo check -p hero_osis_server
  • cargo clippy -p hero_osis_server — no new warnings
  • conversationservice.list_messages discoverable via rpc.discover
  • Sending a new message after deploy: resulting ChatMessage.created_at is non-zero
  • Opening the messaging UI: chat list no longer shows Jan 1970; message bubbles show real times

Unblocks the companion PR in hero_archipelagos that switches fetch_messages to this new endpoint.

## Summary Two communication-domain changes: 1. **Add `ConversationService.list_messages(conversation_sid) -> [ChatMessage]`** — #26 Server-side filter sorted by `created_at` ascending. Removes the client-side N+1 where opening one chat meant listing every message SID in the entire domain and fetching each one individually. In the messaging UI this drops chat-open from ~51 RPCs to 3. 2. **Stamp `created_at`/`updated_at` in `chatmessage_trigger_save_pre`** — #25 Previously a no-op, so every saved message had `created_at = 0` and rendered as `00:00` / `Jan 1 1970` downstream. The trigger is the right place because it catches every save path (send, reply, react, future handlers). ## Generated code `*_generated.rs`, `openrpc.json`, and the SDK client method are the output of the schema build; committed so downstream consumers (e.g. `hero_archipelagos`) can pick up the new method without re-running the generator. ## Test plan - [ ] `cargo check -p hero_osis_server` - [ ] `cargo clippy -p hero_osis_server` — no new warnings - [ ] `conversationservice.list_messages` discoverable via `rpc.discover` - [ ] Sending a new message after deploy: resulting `ChatMessage.created_at` is non-zero - [ ] Opening the messaging UI: chat list no longer shows Jan 1970; message bubbles show real times Unblocks the companion PR in `hero_archipelagos` that switches `fetch_messages` to this new endpoint.
communication: add list_messages RPC and stamp message timestamps
All checks were successful
Build and Test / build (pull_request) Successful in 5m9s
e0e02dd919
- Add `ConversationService.list_messages(conversation_sid) -> [ChatMessage]`
  so clients no longer have to list every message SID globally and fetch
  each one to render a single conversation (closes #26).

- Stamp `created_at` (when 0) and `updated_at` in the central
  `chatmessage_trigger_save_pre` trigger so every persisted ChatMessage
  carries real timestamps — one hook covers send, reply, and reactions
  (closes #25).

The generated `*_generated.rs` + `openrpc.json` + SDK client are the
output of the schema build; included so downstream consumers see the
new method without regenerating.
zaelgohary changed title from communication: add list_messages + stamp message timestamps to communication: list_messages + stamp timestamps 2026-04-19 08:32:18 +00:00
zaelgohary merged commit 1664b398ff into development 2026-04-19 09:27:32 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_osis!27
No description provided.