fix(funnel): repair activation-path bugs found in end-to-end audit (#114)
Systematic trace of the activation funnel (store listing -> docs setup guide -> in-app onboarding -> connect flow) after #113 showed a docs 404 bug had slipped through. Fixes found in this pass: - README.md and CONTRIBUTING.md still told developers to run `npm install -g opencode` (missing -ai), the exact 404 #113 fixed everywhere else. Same package-name fix applied here. - src/lib/diagnostics.ts: the health probe reported ok:true for any resolved fetch, including 401/403/404/500 responses. A wrong password or broken server therefore classified as "Health endpoint responded - connection actually works now.", contradicting the error shown right next to it. Health now requires a real 2xx; root-reachability probe explicitly opts out (requireOk: false) to keep its existing reachability-only semantics (already encoded in diagnostics-classify.test.ts). - docs-site/vs-termux: architecture explainer described /session/{id}/events and /session/{id}/chat, neither of which exists; the app actually uses /global/event and /session/{id}/prompt_async (src/lib/sdk.ts). - docs-site/features: opencode repo link pointed at github.com/opencode-ai/opencode instead of github.com/sst/opencode, the org used everywhere else in the docs. - Stale "v0.4.3" version strings (README x3, docs-site/download x2) bumped to v0.4.7, the actual latest shipped release confirmed live on GitHub Releases and the F-Droid repo index. Fixed the associated Android min-OS contradiction (7.0 vs 8.0+) to 7.0, matching the live F-Droid manifest's minSdkVersion 24. - Dropped stale "GPT-4" model naming on 3 docs-site pages, consistent with the model-agnostic policy already applied to the Play listing in #83. See PR body for the found-not-fixed list (Play Console listing drift, GitHub Sponsors not enabled, a Cloud-vs-waitlist messaging conflict) that need a product/human decision rather than a code fix. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -36,13 +36,20 @@ export interface DiagnosticReport {
|
||||
timestamp: string
|
||||
}
|
||||
|
||||
async function timedFetch(name: string, target: string, init?: RequestInit): Promise<ProbeAttempt> {
|
||||
// requireOk: whether a non-2xx HTTP response counts as a probe failure.
|
||||
// The health probe must actually succeed (2xx) to mean "the server works" —
|
||||
// otherwise a 401/403/404/500 response was being reported as ok:true, which
|
||||
// made classify() short-circuit to "connection actually works now" even when
|
||||
// auth failed or the server errored. The root probe only checks reachability
|
||||
// (any HTTP response, even an error status, proves something is listening).
|
||||
async function timedFetch(name: string, target: string, init?: RequestInit, opts?: { requireOk?: boolean }): Promise<ProbeAttempt> {
|
||||
const requireOk = opts?.requireOk ?? true
|
||||
const start = Date.now()
|
||||
const controller = new AbortController()
|
||||
const timer = setTimeout(() => controller.abort(), PROBE_TIMEOUT_MS)
|
||||
try {
|
||||
const res = await fetch(target, { ...init, signal: controller.signal })
|
||||
return { name, target, ok: true, status: res.status, durationMs: Date.now() - start }
|
||||
return { name, target, ok: requireOk ? res.ok : true, status: res.status, durationMs: Date.now() - start }
|
||||
} catch (error: unknown) {
|
||||
const err = error as { name?: string; message?: string; cause?: unknown }
|
||||
const aborted = err?.name === "AbortError"
|
||||
@@ -80,7 +87,7 @@ export async function probeConnection(url: string, auth?: { username: string; pa
|
||||
const base = `${parsed.scheme}://${parsed.host}:${parsed.port}`
|
||||
;[health, root, internet] = await Promise.all([
|
||||
timedFetch("health", `${base}/global/health`, { headers }),
|
||||
timedFetch("server-root", `${base}/`, { headers }),
|
||||
timedFetch("server-root", `${base}/`, { headers }, { requireOk: false }),
|
||||
timedFetch("internet", INTERNET_CHECK_URL),
|
||||
])
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user