⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.
Context
src/github/public.ts:83-133: if reposResponse.ok is false, the function degrades gracefully (repos = [], user.login/name/bio/... still returned, source: "github"). But if reposResponse.ok is true and the body fails to parse (await reposResponse.json() throws -- e.g. a truncated stream), the outer catch at line 127 discards the whole result, including the already-successfully-parsed user object, returning { login, topLanguages: [], source: "unavailable" }. test/unit/adapters.test.ts only covers the HTTP-level non-ok case (line 159), never a parse failure after a successful user fetch.
Requirements
Catch the repos-list fetch/parse separately from the user fetch, so a repos-side failure (HTTP or parse) degrades to topLanguages: [] while preserving already-fetched user fields, instead of collapsing the whole profile to unavailable.
Deliverables
All of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
src/** -- 99%+ patch coverage, branch-counted, on the new separated catch path.
Expected Outcome
A repos-list parse failure degrades the same way an HTTP-level failure already does -- preserving the successfully-fetched user profile instead of discarding it.
Links & Resources
src/github/public.ts:83-133
test/unit/adapters.test.ts:159
Context
src/github/public.ts:83-133: ifreposResponse.okisfalse, the function degrades gracefully (repos = [],user.login/name/bio/...still returned,source: "github"). But ifreposResponse.okistrueand the body fails to parse (await reposResponse.json()throws -- e.g. a truncated stream), the outer catch at line 127 discards the whole result, including the already-successfully-parseduserobject, returning{ login, topLanguages: [], source: "unavailable" }.test/unit/adapters.test.tsonly covers the HTTP-level non-ok case (line 159), never a parse failure after a successful user fetch.Requirements
Catch the repos-list fetch/parse separately from the user fetch, so a repos-side failure (HTTP or parse) degrades to
topLanguages: []while preserving already-fetched user fields, instead of collapsing the whole profile tounavailable.Deliverables
userfields, degrading onlytopLanguagesto[], matching the existing HTTP-failure degrade behaviortest/unit/adapters.test.tsasserting a parse failure after a successful user fetch still returns the real user fields, notsource: "unavailable"All of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
src/**-- 99%+ patch coverage, branch-counted, on the new separated catch path.Expected Outcome
A repos-list parse failure degrades the same way an HTTP-level failure already does -- preserving the successfully-fetched user profile instead of discarding it.
Links & Resources
src/github/public.ts:83-133test/unit/adapters.test.ts:159