Skip to content

fix(app): avoid zero message refresh limit - #42491

Open
fancive wants to merge 2 commits into
anomalyco:devfrom
fancive:fix-desktop-messages
Open

fix(app): avoid zero message refresh limit#42491
fancive wants to merge 2 commits into
anomalyco:devfrom
fancive:fix-desktop-messages

Conversation

@fancive

@fancive fancive commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #42267

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

An empty initial message page records a cached message count of zero. A later forced refresh reused that count as the request limit, causing the desktop client to send limit=0; the server rejects that value before the newly sent message can be loaded.

This change falls back to the initial message page size whenever the cached or requested limit is zero. Positive cached limits continue to preserve the existing window size.

How did you verify your code works?

  • Added a regression test that loads an empty page and then forces a refresh
  • bun test src/context/server-session.test.ts: 75 passed
  • bun typecheck in packages/app
  • Push hook monorepo typecheck: 30/30 tasks passed

Screenshots / recordings

Not included. The fix changes the message-fetch request limit; the request sequence is covered directly by the regression test.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

desktop: sent user message not visible in chat — client sends limit=0 on message fetch, server rejects with 400

1 participant