Skip to content

feat: turn Remotes on and off and change their settings from the API - #649

Merged
xHeaven merged 3 commits into
dev-null-sh:productionfrom
simonhamp:feat/api-remotes-settings
Oct 22, 2026
Merged

xHeaven merged 3 commits into
dev-null-sh:productionfrom
simonhamp:feat/api-remotes-settings

Conversation

@simonhamp

Copy link
Copy Markdown
Contributor

Lets the mobile app turn Remotes on and off and change their settings, the way the switch in Settings and the settings menu on the Remotes page do on the web. It's the first of a few small PRs that bring Remotes to the app (NativePHP/dev-null-app) on top of the signed API from #130.

Endpoints

All signed.

Request Answer
PUT /api/v1/me/remotes with enabled 200, the same body as GET /api/v1/me
PUT /api/v1/me/remote-preferences with from and pull_receipts 200, the same body as GET /api/v1/me. 404 while Remotes are off

GET /api/v1/me (and everything that answers like it) gains remotes. It's null while the user has Remotes off, the same way the web's auth.remotes is. Otherwise:

"remotes": {
  "from": "following",
  "pull_receipts": true,
  "requests": false,
  "everyone": false,
  "unread_count": 3
}

requests and everyone are the two config flags, so the app knows whether to show Fetched and whether to offer Everyone. unread_count is what the web's nav badge shows: unread messages plus fetched requests.

Rules kept from the web

  • from only takes everyone while remotes.everyone is on, using the web's rule.
  • The preferences endpoint is a 404 while Remotes are off, like the web's.
  • The preferences endpoint shares the web's conversations limiter (300 a minute). The switch only has the API's 120 a minute, as on the web.

Worth checking

  • unread_count lives inside remotes rather than next to unread_notifications_count. That way every endpoint that answers like /me gets it from the resource, without touching five controllers. It reads the signed-in user from the request, as UserResource does for lane.
  • The conversation endpoints for the app follow in their own PRs.

Testing

Everything CI runs passes on this branch locally: Pint, Rector, the JS lint, PHPStan, tsc, type coverage, the JS unit tests, and all 3,242 PHP tests at 100% coverage.

Copilot AI balanced review requested due to automatic review settings October 19, 2026 17:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@simonhamp
simonhamp marked this pull request as ready for review October 19, 2026 23:33
mybuddyandrew added a commit to mybuddyandrew/devnull-claude that referenced this pull request Oct 20, 2026
…he API

Remotes stays hidden until dev-null.sh merges its Remotes API (dev-null-sh/dev-null.sh#649, #654, #656, #657, #658, #665, #734); /api/v1/remotes answers 404 today. Not yet tested live.
@xHeaven
xHeaven merged commit 7799ad8 into dev-null-sh:production Oct 22, 2026
5 checks passed
@simonhamp
simonhamp deleted the feat/api-remotes-settings branch October 22, 2026 04:00
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.

3 participants