Skip to content

fix: populate topic author in message list - #6

Merged
fengmk2 merged 1 commit into
enable-typed-dbfrom
populate-message-topic-author
Aug 6, 2026
Merged

fix: populate topic author in message list#6
fengmk2 merged 1 commit into
enable-typed-dbfrom
populate-message-topic-author

Conversation

@fengmk2

@fengmk2 fengmk2 commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

OpenSpec

  • This PR implements an OpenSpec change: <!-- change name -->
  • No OpenSpec change is needed (small doc/fix, no shipped behavior change).

Verification

  • pnpm verify passed.
  • A subset was run instead: <!-- commands --> because <!-- reason -->.

Impact Checklist

  • App code (apps/, packages/)
  • API behavior / OpenAPI contract (apps/api/src/routes/*.ts zod-openapi declarations, api/openapi.json via pnpm gen:openapi)
  • Database schema or migration (packages/db)
  • Deployment (deployment/)
  • Documentation (README.md, docs/, wiki/)
  • CI / scripts (.github/workflows/, scripts/, package.json)
  • Secret handling: no real .env, tokens, cookies, private keys, database URLs, or user data committed.

Migration / Deployment Notes

GET /messages always returned the empty placeholder for topic.author
because getMessageRelations handed back a raw topic row that has no
author relation; the messageDTOSchema contract declares a real author
and the route test mocked one, hiding the gap. Fetch the topic author
in getMessageRelations and attach it, so the web message list can show
who owns the topic.

Covered by the new message-relations test, which fails against the
previous implementation.
@fengmk2
fengmk2 force-pushed the populate-message-topic-author branch from f5c0a76 to ddca2f8 Compare August 5, 2026 07:55
@fengmk2
fengmk2 marked this pull request as ready for review August 5, 2026 08:35
@fengmk2
fengmk2 requested a review from thonatos August 5, 2026 08:36

@thonatos thonatos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: LGTM

补拉 topic.author 并挂载,路由端正确消费;测试覆盖 topic 存在/缺失两路,vi.hoisted mock 规范。

非阻塞:每条消息查询由 2 次变 3 次(原有 N+1 上加 1),消息列表页量级可接受,后续可批量 fetch 优化。

@fengmk2
fengmk2 merged commit 6987a5b into main Aug 6, 2026
2 checks passed
@fengmk2
fengmk2 deleted the populate-message-topic-author branch August 6, 2026 01:30
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