Repository navigation
Share account follow queries with React Query - #82
Conversation
PR reader API performanceResult: INCONCLUSIVE 5 inconclusive · 3 within threshold. Zero request failures across all six runs. Base Three independent runs per revision, each on a fresh GitHub-hosted ARM64 runner. 16 users, 60 seconds/run, 1,000 synthetic articles, cache off, five PgBouncer slots. Latency comparisonAll latency values are in milliseconds; lower is better. Values are medians of three runs.
Additional latency and throughput metricsEach cell shows base → PR. Latencies are in milliseconds.
Individual runs
How to interpret this reportRegressed / Improved: a p95 regression needs >20% and >20 ms increase in the medians and at least two head samples versus the base median. Improvements use the inverse threshold. Within threshold means the change did not meet both thresholds. Inconclusive: a within-revision p95 range >35% of its median and >20 ms is too noisy for a confident latency verdict. Inconclusive latency comparisons are non-blocking: the check passes without claiming an improvement. Confirmed regressions and test/report errors fail the PR gate. Throughput is descriptive: paced users do not measure maximum capacity. This uncached public API test does not establish production health, browser performance or worker capacity. Separate runners can differ in hardware or host load; repetitions and noise checks reduce but cannot eliminate that uncertainty. Full HTML/CSV reports and logs · attempt 1 |
Code Review ✅ Approved🟡 Medium risk · Account-scoped follow reads and writes now use a shared React Query lifecycle. Migrates topic and source follow management to a shared OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
Backend unit coveragePASS · minimum combined coverage 67.60%. Tests: 3007 passed, 0 failed, 0 skipped. Source files: 273.
Unit coverage includes every backend workspace. PostgreSQL/Redis integration tests run separately. Commit: bfbb484 · HTML, JSON, XML reports and job logs · attempt 1 |
|



What changes and why?
Topic and source follow providers independently managed private reads, loading/error state, request controllers, save guards, concurrent-item merges and retry handling. Both now use one
useFollowPreferenceshook backed by TanStack React Query 5.104.1. Their existing contexts, buttons, settings forms and CSRF-protected endpoints remain compatible.The shared cache deduplicates reads and duplicate item writes across consumers. Different-item writes merge acknowledged results; bulk saves are blocked while conflicting item writes are pending. Older reads are canceled before writes so they cannot overwrite saved state. A failed save retains confirmed follows and exposes the existing error message. Failed reads recover on visible-tab resume, reconnect or explicit retry, with repeated resume events coalesced.
UserProvidercreates a client inside its existing account boundary. Private queries include the account/session revision; account changes and sign-out clear the client, while credential refresh cancels old reads/writes without remounting the reader. Late responses cannot replace current-session data. Guest browsing makes no private preference requests. Private query data is kept in memory; no browser persistence or server hydration is added. Automatic retries and offline mutation replay are disabled.React Query fits this duplicated account-data lifecycle. Public feeds retain their generation-aware pagination, and the admin already centralizes reads with visibility-aware polling and authentication handling. Migrating those specialized paths would add scope without a demonstrated benefit. The adoption boundary and deliberate overrides of TanStack defaults, including cancellation, are documented in this PR rather than repository Markdown.
Validation
Updated against master after #81, preserving grid/list preferences, Trending routes, article-first rendering, options-error recovery, coordinated prompts and scoped runtime/touch fixtures.
npm ciinstalled the merged lockfile successfully and reported zero vulnerabilities.apps/web/tests/browserand remains shared with both extensions. Coverage exclusions are unchanged.CI required, all three CodeQL analyses, Sonar, dependency/secret/workflow checks, populated upgrades, real API/admin journeys, performance comparison and ARM64 image build/scan/smoke checks.Rollout notes
The dependency is pinned exactly and recorded with integrity hashes in the npm lockfile. The original implementation measured an approximately 11 KB gzip extension-entry increase from adding React Query. Current reader builds are being checked after the preceding grid/list changes; no production speed improvement is inferred from library adoption.
Existing API contracts and authentication boundaries are preserved; no database migration or configuration change is required. The change is isolated on
refactor/reader-query-follows, after Grid/List PR #81 has merged. Website deployment and browser-store publication follow the normal release process.Merge after #81 and before #83–#84, one at a time, after all current-head checks pass.
Ready for review