Skip to content

Fix stale-post refresh for DMs - #6281

Draft
wca4a wants to merge 1 commit into
developfrom
codex/fix-dm-stale-post-refresh
Draft

Fix stale-post refresh for DMs#6281
wca4a wants to merge 1 commit into
developfrom
codex/fix-dm-stale-post-refresh

Conversation

@wca4a

@wca4a wca4a commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Restrict stale-post refresh requests to group channel nests.
  • Keep DM and group-DM conversations on their existing subscription and sync paths.
  • Catch changed-post refresh failures, clear pending IDs, and allow a later retry instead of producing an unhandled promise rejection.
  • Add regression coverage for group channels, DMs, and group DMs.

Why

useRefreshPosts called syncUpdatedPosts for every conversation type. That reaches getChangedPosts, whose server endpoint is explicitly implemented only for group channels. Opening a DM with stale posts could therefore throw server does not implement this endpoint for non-group channels as an unhandled promise rejection and show the React Native error screen.

Impact

DMs no longer call an unsupported group-channel endpoint. Group-channel stale-post refresh remains unchanged, aside from handling transient failures cleanly and permitting retries.

Validation

  • pnpm --filter @tloncorp/shared exec vitest run src/store/useChannelPosts/queries.test.ts — 12 tests passed
  • pnpm --filter @tloncorp/shared exec tsc --noEmit — passed
  • Targeted ESLint — no new errors; two pre-existing queryRef dependency warnings remain
  • Reproduced in the iOS Simulator with ~pinser-botter-podfyl-parseb, reloaded with the fix, then reopened the exact DM without a new console error

@wca4a

wca4a commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 4949a8e728

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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