fix(#211): free articles wrongly paywalled + show app version in Settings#216
Merged
Conversation
**What** — Clicking "Full text" on freely-readable articles from many sources (Wired, NYT, lttlabs, …) showed a "Paywalled article" box even though the whole article was present. **Why** — `fetchExtracted` ran `detectPaywall()` against the *raw page* HTML *before* extraction. The default detector phrase-matches the entire markup, so industry-standard "Subscribe to continue" / "Already a subscriber?" CTAs that appear in the nav, footer, or newsletter chrome of *every* page (free or gated) produced a false `phrase-match` verdict. The `body-too-short` rule, measured on the raw page, similarly mis-fired. **Fix** — Reorder to extract-first. A substantial extraction (≥600 visible chars of *extracted* content) is now the definitive "this is readable" signal and renders immediately, ignoring page chrome. Paywall heuristics run only as a fallback for thin/empty extraction, scoped to the extracted teaser (not the chrome), and a `body-too-short` verdict never overrides content we did extract — so short free posts still render. HTTP gated status (401/402/403/451) remains a first-class signal. Extracted the shared cache-and-mark-available dance into `cacheExtracted()`. **Prevention** — Two regression tests in extraction-store-paywall.test.ts: a full readable article wrapped in subscribe chrome must render with no verdict; a short free post with no gate phrases must render. The existing paywall suite (stub → prompt, 403 → prompt, authorized retry) stays green; its baseline now models reality (anonymous fetch of a gated page yields no extraction). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
**What** — The Settings menu never displayed the installed FeedZero
version, and the baked version had drifted: package.json was 0.9.0 while
the current release line is 0.11.0 (prod /api/health reported 0.9.0).
**Why** — No UI surface read the version. Separately, the 0.10.0 and
0.11.0 releases bumped the changelog/Atom feed but never bumped
package.json, the single source for both VITE_APP_VERSION (SPA) and the
inlined process.env.APP_VERSION (serverless) — so every build identified
itself as 0.9.0.
**Fix** — Add getAppVersion() (reads the build-time VITE_APP_VERSION,
"dev" fallback for non-Vite contexts like tests) and render
"FeedZero v{version}" in the Settings → Help tab, plus include it in the
support-email diagnostic context. Bump package.json to 0.11.0 so the SPA
display, /api/health, and the health-version smoke invariant all agree.
The committed api/*.ts bundles are regenerated by build:api at deploy, so
no hand-edit is needed there.
**Prevention** — help-tab.test.tsx asserts the version renders. The
existing tests/smoke/health-version.test.ts already enforces
prod /api/health == package.json version; this commit makes that the
correct number. Follow-up for the user: the /new-release flow must bump
package.json (it was skipped for 0.10/0.11).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #211. Two distinct bugs, one commit each.
1. Articles incorrectly flagged as paywalled (
c993ccd)Root cause:
extraction-store.fetchExtractedrandetectPaywall()against the raw page before extraction. The default detector substring-matches the entire markup, so industry-standard "Subscribe to continue" / "Already a subscriber?" CTAs in the nav/footer/newsletter chrome of every page (Wired, NYT, lttlabs, …) — free or gated — produced a falsephrase-matchverdict. The raw-pagebody-too-shortrule mis-fired similarly.Fix: Extract first. A substantial extraction (≥600 visible chars of extracted content) renders immediately and ignores page chrome. Paywall heuristics now run only as a fallback for thin/empty extraction, scoped to the extracted teaser, and
body-too-shortnever overrides content we did extract (short free posts still render). HTTP gated status (401/402/403/451) stays a first-class signal.Tests: two regression cases (full article wrapped in subscribe chrome → renders, no verdict; short free post → renders). Existing paywall suite (stub→prompt, 403→prompt, authorized retry) stays green; its baseline now models reality (anonymous fetch of a gated page yields no extraction).
2. Settings doesn't show the installed version + version drift (
3f318d2)Root cause: No UI surface read the version. Separately, the 0.10.0/0.11.0 releases never bumped
package.json(still 0.9.0) — the single source forVITE_APP_VERSION(SPA) and inlinedprocess.env.APP_VERSION(serverless) — so prod/api/healthreported0.9.0while the changelog said v0.11.0.Fix:
getAppVersion()accessor + "FeedZero v{version}" in Settings → Help (and in the support diagnostic context). Bumppackage.json→0.11.0so the SPA display,/api/health, and thehealth-versionsmoke invariant agree. Committedapi/*.tsbundles are regenerated bybuild:apiat deploy, so no hand-edit needed.Tests:
help-tab.test.tsxasserts the version renders; existingtests/smoke/health-version.test.tsalready enforces prod version ==package.jsonversion.Verification
npx vitest run→ 3735 passed, 35 skipped, 0 failed.tsc --noEmit(TS 6.0.3, the pinned version) → clean.🤖 Generated with Claude Code