Skip to content

fix(channel): record last_message_at for all channels including DingTalk#134

Merged
xiami762 merged 2 commits intomainfrom
fix/channel-last-message-at
Apr 16, 2026
Merged

fix(channel): record last_message_at for all channels including DingTalk#134
xiami762 merged 2 commits intomainfrom
fix/channel-last-message-at

Conversation

@duguwanglong
Copy link
Copy Markdown
Contributor

last_message_at was always null because record_message() was never called by the inbound pipeline. This caused the "最近消息" field to permanently show "暂无" for all channels.

  • Fix timestamp source: use time.time() (unix epoch) instead of time.monotonic() so the frontend can interpret it correctly
  • Wrap the dispatcher callback in GatewayManager to automatically call record_message() on each inbound message (Feishu/WeCom/Telegram)
  • Add POST /{channel_id}/record-inbound endpoint for out-of-process bridges that bypass InboundDispatcher
  • Call record-inbound from DingTalk runner.ts on each incoming message

@duguwanglong duguwanglong requested a review from xiami762 April 16, 2026 07:53
last_message_at was always null because record_message() was never
called by the inbound pipeline. This caused the "最近消息" field to
permanently show "暂无" for all channels.

- Fix timestamp source: use time.time() (unix epoch) instead of
  time.monotonic() so the frontend can interpret it correctly
- Wrap the dispatcher callback in GatewayManager to automatically
  call record_message() on each inbound message (Feishu/WeCom/Telegram)
- Add POST /{channel_id}/record-inbound endpoint for out-of-process
  bridges that bypass InboundDispatcher
- Call record-inbound from DingTalk runner.ts on each incoming message

Made-with: Cursor
- Replace 3 direct `self._status.last_message_at = time.monotonic()`
  assignments in FeishuChannel with `self.record_message()` so all
  channels use the same epoch-second timestamp from base class
- Move DingTalk record-inbound call before session creation so the
  timestamp is recorded even when downstream API calls fail

Made-with: Cursor
@duguwanglong duguwanglong force-pushed the fix/channel-last-message-at branch from a37c4ac to f1da52d Compare April 16, 2026 08:28
@xiami762 xiami762 merged commit a282673 into main Apr 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants