Commit Graph

1028 Commits

Author SHA1 Message Date
DIYgod d8835acd02 fix(desktop): route the remaining main-process requests through Chromium and keep the CLI token out of logs
After the API bridge moved to `net.fetch`, several main-process requests still used
Node's `fetch`, which ignores the app's proxy settings: the update manifest and policy,
the main-process API client, file downloads, text-to-speech, page fetching for the
reader, and the Eagle, qBittorrent and custom integration requests. They now go through
`net.fetch` as well. The readability package takes a `fetch` implementation for that;
downloads hand it to ky. Requests that manage cookies by hand pass
`credentials: "omit"`, so Chromium does not keep them too.

A failed CLI login sync used to be logged with the whole command line, token included.
The command is now described with the token redacted, and the command's output is
scrubbed the same way.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 17:40:26 +08:00
DIYgod c75533cbd2 fix: report the API as unreachable only when a probe confirms it
One request failing without a response proved little: an endpoint may be slow or
briefly broken while the API itself is fine, and the prompt appeared on every such
hiccup.

- a failed request now only schedules a probe, a cheap `/status/configs` request two
  seconds later, repeated once; the API counts as unreachable when every probe fails
  and no other request got an answer in the meantime
- while unreachable the probe repeats every fifteen seconds so the prompt goes as soon
  as the API answers; any ordinary answer lifts it as well
- the desktop probe travels the same path as its requests, through the main process;
  the mobile probe uses the app's fetch
- without a probe, three failures in a row are needed instead of one

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 16:18:30 +08:00
DIYgod 9be883a63a fix(desktop): accept bodiless responses from the main process and catch lists up on return
The staging desktop build showed "Unable to connect to the server" and a timeline that
never caught up.

- the main process hands API responses over as text, so a `204` such as the analytics
  endpoint's arrived as an empty string; `Response` refuses a body for those statuses,
  the throw looked like a failed connection, and the new prompt reported it
- a desktop window keeps its visibility when the user switches apps, so the sync engine
  never saw a "return"; window focus now counts as one, and duplicate signals within a
  few seconds share one pull
- views that received new entries during background pulls are remembered and their
  lists brought up to date on the next return, even when that pull finds nothing new
- oldest-first lists receive new entries at their end: the empty page that marked the
  end is dropped and the page after the last entry is requested again

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 15:50:01 +08:00
DIYgod 1006fb77c8 docs(store): describe KV answered polls and the shorter life of new-entry hints
The server no longer repeats entry ids in `N` actions, answers up-to-date delta polls
from KV and drops `N` rows after three days. The client never read the entry ids, so
only its type and the design document follow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 23:18:00 +08:00
DIYgod b6c50296a1 feat(store): stop requesting the session, actions, settings, wallet and push token on every launch
A launch of the web app made twelve API requests. Half of them fetched data the
sync engine can keep current, or fetched the same thing more than once.

- session: start-up fetches it through the query cache and `useSession` reuses
  it for a minute, instead of three separate requests
- action rules and settings become sync models: they are loaded in full once per
  account, stored locally, and afterwards follow the change log; unsaved rule
  edits and queued setting changes are never replaced
- sync models outside the engine register through `sync/model-registry`, with a
  one-time bootstrap and an apply step; a model whose actions went by unhandled
  is bootstrapped again
- wallet: requested when the profile menu opens, which is the only place that
  uses the answer
- web push: the token is registered again only when it changed or the change
  log shows another browser took over the channel
- the new-user guide remembers accounts that already have settings, so the
  entry list no longer requests `/settings`

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 21:32:04 +08:00
DIYgod 97e92a8ac2 feat: show a prompt when the API cannot be reached
Requests that fail without any response (DNS failure, refused or reset
connection, offline device, timeout) previously failed silently. Track
them through the SDK interceptors and surface a single prompt per outage:
a persistent toast on desktop that is dismissed once the API answers
again, and a transient toast on mobile.

The connection state lives in an atom because the first requests can fail
before the toaster is mounted.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 21:08:05 +08:00
DIYgod f69d7fe1d1 fix(store): keep the local user unless the session check returns 401
whoami() told connection failures apart from a missing session by looking
for "Failed to fetch" in the error message. Electron's IPC fetch, React
Native's fetch and SDK timeouts use different messages, so an unreachable
API cleared the local user, and on mobile redirected to the login screen.

Only a 401 (or an empty session) now clears the user. Every other failure
is rethrown so callers keep the cached user.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 21:08:01 +08:00
DIYgod b09af5f5cd feat(store): rely on the delta feed instead of full snapshots once a sync cursor exists
The sync engine added an incremental channel, but the app kept fetching full
snapshots next to it: both prefetch hooks, a recount after every pull, every
loaded page of the entry lists, and whole-list refetches after unsubscribing or
importing.

- unread counters keep confirmed counts under the local transactions; the change
  log moves them by the flips and new unread rows the server reports, and an
  acknowledged transaction drops its prediction once the engine reached its
  sync id
- usePrefetchSubscription, usePrefetchUnread, pull to refresh, the refresh
  button, OPML import, unsubscribe and the mobile background task go through the
  engine and only fall back to the full requests when it cannot help
- snapshots remain as calibration: unread hourly, subscriptions daily, plus a
  throttled recount when the list on screen disagrees after a delta pull
- new entries fetch only the first page of the lists on screen and merge it in
  front of the loaded pages; a refresh trims the infinite query to one page
- mobile refreshes subscriptions through the delta feed after an OPML import

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 19:53:09 +08:00
DIYgod b71dba08d4 feat(desktop): add a settings entry for unauthenticated users
Show a preferences button next to the login button when logged out, so
guests can open the settings modal without signing in. The modal already
supports guest mode and gates account-bound tabs behind login.

Also fix KbdCombined splitting the comma key in shortcuts like "$mod+,"
as if it were a separator between multiple shortcuts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 19:29:15 +08:00
DIYgod 0e59bd2ddd feat(store): settle transactions by sync id and sync lists and inboxes
Follow up on the sync engine:

- Transaction kinds report the `lastSyncId` their mutation returned. The
  queue releases an acknowledged transaction's overlays as soon as the sync
  engine has applied that id, instead of always waiting out the 30 s window,
  which stays as the upper bound for servers without sync ids.
- The engine applies the new `list`, `inbox` and `inbox_entry` actions and
  inbox `N` hints, so list edits, inbox changes and new mail made elsewhere
  show up without a full refetch.
- While the engine is active the unread mismatch heuristic stands down and
  the desktop blanket invalidation skips the queries the delta feed already
  keeps fresh. Both remain as the fallback for servers without `/sync`.

Also fix the Android build: `setup-android` installs the obsolete `tools`
package by default, which the SDK repository no longer serves.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 18:16:25 +08:00
DIYgod 9b890144e8 chore(deps): upgrade client sdk to 0.3.96 and use its sync module
Bump `@follow-app/client-sdk` to 0.3.96 (and `@folo-services/drizzle` to
0.1.48) and hand `followApi.sync` to the store instead of requesting the
`/sync` endpoints through `followClient.request`.

The new SDK no longer declares the frozen wallet and RSS3 writes. Keep the
existing screens and their runtime behaviour unchanged through a small
compatibility module: legacy withdraw fields and the `IS_RSS3_TESTNET`
flag get local types, and the removed `wallets.post()` is requested at the
same path with `followClient.request`. Drop an over-wide tuple annotation
in the mobile plan screen now that `PaymentFeature` keys are precise.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 14:36:00 +08:00
DIYgod 247a9294ea feat(store): add an incremental sync engine driven by server sync ids
Add `sync/sync-engine.ts`, which keeps the last applied sync id in a new
`sync_meta` SQLite table (migration 0039), bootstraps from `/sync/state`
plus the existing snapshot endpoints, and then pages through `/sync/delta`
on launch, foreground, reconnect, a 60 s interval and after the transaction
queue receives an acknowledgement. Subscription, collection and timeline
actions are applied to the stores and SQLite, pending local marks keep
precedence through the transaction queue overlays, and unread counts are
refreshed once per pull. A 404 from the sync endpoints keeps today's full
refetch behaviour for the session.

Both apps expose the endpoints through `followClient.request` until the
client SDK release with the `sync` module lands.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 13:53:47 +08:00
DIYgod 93b83f95eb feat(mobile): add reading settings, manual theme and immersive header
- add a Reading settings screen (content font, line height, text color,
  inline style, code theme) reachable from Appearance and from the entry
  "more" menu
- add a System / Light / Dark theme setting applied through
  Appearance.setColorScheme so the reader WebView follows it as well
- optionally slide the entry header away while scrolling down and keep a
  blurred status bar strip so the clock stays readable
- forward reader typography to the html renderer through a new
  setReaderStyle bridge call

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 12:50:51 +08:00
DIYgod b606f0c432 feat(store): add a persisted transaction queue with rebase
Introduce a Linear-style transaction queue for user mutations. Read marks,
unread marks, mark-all and star/unstar are applied optimistically, written to
a new `sync_transactions` outbox table, batched and sent in order, retried
while offline and rolled back only when the server rejects them. Pending and
just-acknowledged transactions expose overlays so server snapshots are rebased
on top of the local intent, which replaces the 30 s read-protection window.

Also add the sync engine design spec that covers the server change log and
delta endpoints planned for the next phase.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 23:13:42 +08:00
DIYgod 8b097abc52 fix(reader): show missing cover images above entry content 2026-09-09 13:13:09 +08:00
DIYgod 41d009a87e fix(desktop): reset masonry layout when item order changes 2026-09-06 11:07:04 +08:00
DIYgod 9787707ca3 feat(timeline): support oldest-first unread sorting 2026-09-01 20:26:14 +08:00
DIYgod f82a5dad81 fix(desktop): restore inbox secret copying 2026-09-01 20:11:40 +08:00
DIYgod a2ad2a8922 fix(mobile): preserve timeline position across switches 2026-09-01 18:28:26 +08:00
DIYgod 2034702df6 fix(styles): avoid DaisyUI border token collision 2026-07-25 20:17:55 +08:00
Tony c3e1c26194 fix(desktop): set referrerpolicy on youtube embed iframes (#5039) 2026-07-12 18:07:09 +08:00
DIYgod 1158281f59 chore(deps): update frontend dependencies (#5038)
* chore(deps): update frontend dependencies

* fix(ci): format OTA verification commands
2026-07-10 22:36:12 +08:00
DIYgod 72e289bb3e fix(tracker): sample PostHog events at five percent 2026-07-03 16:46:26 +08:00
DIYgod df8b8d0670 fix(actions): stabilize rule editor state 2026-05-29 14:00:19 +08:00
DIYgod 69202876ed fix(collection): paginate starred entries by collection time 2026-05-29 11:56:26 +08:00
DIYgod 89e7c13f13 fix: update unread count for time-limited mark-read 2026-05-29 10:50:19 +08:00
DIYgod dc43e39711 fix: retry scroll mark-read after revisiting entries 2026-05-26 20:29:52 +08:00
DIYgod 9bce34a82d fix: preserve local read state after scroll sync 2026-05-26 14:23:46 +08:00
DIYgod 07cbf35de7 fix: batch scroll mark-read requests 2026-05-26 11:55:09 +08:00
DIYgod 27b30e0d47 fix(desktop): pause scroll read on timeline changes 2026-05-22 14:15:49 +08:00
DIYgod 444f8e05a5 fix(desktop): prevent duplicate timeline page requests 2026-05-14 15:51:32 +08:00
DIYgod 174515b540 fix: handle unavailable ai summary 2026-05-12 16:16:17 +08:00
DIYgod 425e8610a3 fix: stabilize scroll mark-read footer boundary 2026-05-07 21:55:30 +08:00
DIYgod 2fa23362c3 fix: allow final entries to scroll past 2026-05-07 21:05:59 +08:00
DIYgod 88ad11a2ae fix(desktop): dedupe auth session cookies 2026-04-26 09:57:42 +08:00
DIYgod 5bcbf1707c fix(utils): align rehype tree typing in fresh installs 2026-04-14 16:53:16 +08:00
DIYgod 59fe06bd20 fix(ci): harden isolated workspace dependency resolution 2026-04-14 16:35:39 +08:00
DIYgod 1deddccf62 fix(ci): restore store build compatibility 2026-04-14 16:03:50 +08:00
DIYgod 8e0b1f5631 fix(ci): declare store runtime deps 2026-04-14 15:50:56 +08:00
DIYgod 51efb5d5a5 fix(release): repair ota and desktop update flows 2026-04-12 16:04:15 +08:00
DIYgod 33c8bb98b6 feat(ota): unify desktop updates with ota service 2026-04-12 15:39:13 +08:00
DIYgod cb037ceffc fix(ci): restore ota typing and tailwind config compatibility 2026-04-11 10:26:20 +08:00
DIYgod f77ac26541 feat(mobile): upgrade expo sdk 55 and rnfirebase 2026-04-10 22:42:21 +08:00
DIYgod 096422e034 feat(desktop): migrate tts to folo service 2026-04-10 14:38:20 +08:00
DIYgod f6cdb64186 feat: add spotlight settings across desktop and mobile 2026-04-09 13:45:05 +08:00
DIYgod e8619436c7 feat: refine spotlight settings and highlighting 2026-04-09 13:45:05 +08:00
DIYgod 4b07fefdcd fix: correct French translation language detection 2026-04-07 16:52:55 +08:00
DIYgod 79efa4ebb2 fix(desktop): improve pdf export layout and branding 2026-04-07 13:22:04 +08:00
DIYgod 1571396fb6 fix: upgrade sdk packages and align app types (#4950) 2026-04-02 09:03:57 +00:00
DIYgod ce5e91962c fix: pause scroll mark read after refresh (#4946) 2026-04-02 07:21:57 +00:00