Skip to content

feat(messages): keep a channel post's views - #403

Open
leemour wants to merge 1 commit into
mainfrom
chore/probe-channel-posts
Open

leemour wants to merge 1 commit into
mainfrom
chore/probe-channel-posts

Conversation

@leemour

@leemour leemour commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Task

Admin statistics, plan item 5: does MAX give channel post views, and if so, keep them.

Why

chats stats sums views where a stored post carries them; on MAX nothing did.

What

  • scripts/probe-channel-posts.ts (pnpm probe:channel-posts <chatId>): one page of history and the chat's login entry, printed as key paths and value types only — no text, names, links or ids.
  • Measured 2026-10-05 on the owner's Test Channel: every post carries stats.views: number. No comment count seen (comments are off there).
  • toMessage maps stats.views to providerMetadata.views; absent when MAX sends none.

Testing

  • map.test.ts: a post with views, a message without.
  • pnpm lint && pnpm typecheck && pnpm test: 1398 passed; 6 failed only under full-suite load and pass alone (176/176 in those files).

🤖 Generated with Claude Code

MAX sends `stats.views` with each channel post in CHAT_HISTORY (measured
2026-10-05 with the new `pnpm probe:channel-posts`, which prints key
paths and value types only). toMessage puts it into providerMetadata,
where the shared store keeps it and `chats stats` sums it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant