Skip to content

Leave out an inbox answer for a Remotes tab you have left - #38

Merged
simonhamp merged 1 commit into
NativePHP:mainfrom
RaphaelFakhri:fix/remotes-answer-for-left-tab
Oct 20, 2026
Merged

simonhamp merged 1 commit into
NativePHP:mainfrom
RaphaelFakhri:fix/remotes-answer-for-left-tab

Conversation

@RaphaelFakhri

Copy link
Copy Markdown
Contributor

Problem

The Remotes inbox asks devnull for the tab you're on in the background: Open, Fetched or Stashed. The answer goes into whichever tab is showing when it lands, so a slow answer for one tab can fill another.

For example, open Remotes on a slow connection, swipe to Stashed and back to Open before the inbox loads. Stashed's answer lands on Open, so Open lists your stashed conversations until the next 15-second poll replaces them. Load more on that list then pages Open from a stashed conversation.

The Log, Notifications and profile pagers already drop an answer for a page you've left. Remotes didn't.

Fix

Each refresh in Remotes (pollInbox(), load() and revalidate()) passes the tab it asked for to takeFresh(), which ignores the answer when that tab is no longer showing, as Notifications::takeFresh() does. The answer is still kept in the cache for its own tab, so that tab opens on it next time.

Tests

A new test in tests/Feature/Screens/RemotesTest.php holds the background refreshes, opens Remotes, swipes to Stashed and back to Open, and then lets the answers land.

  • Without the change, it fails with Did not see [Grace Hopper] in the rendered tree.: Open shows the stashed conversation.
  • With the change, Open shows only its own conversation, and the full suite passes (1004 passed, 1 skipped).

I didn't run this on a device.

@simonhamp
simonhamp merged commit 6397f6a into NativePHP:main Oct 20, 2026
1 check 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