Skip to content

1.0.21

Choose a tag to compare

@github-actions github-actions released this 12 Aug 18:10
· 1 commit to master since this release
9c97e4d
Make GitHub trending parser resilient to per-row parse failures (#39)

parseTrendingItem() never actually returned null despite being called
via mapNotNull — any exception from a single malformed repo card
(unusual href structure, missing star/fork markup, non-numeric count
text) propagated straight out of parse() and failed the whole trending
fetch, surfacing as the generic "Something went wrong" error for the
entire tab even when most rows were parseable.

Wrap the per-item parsing in try/catch so a bad row is skipped and
logged instead of taking down the whole list, and use toIntOrNull
instead of toInt so a non-numeric star/fork count no longer throws.
Also stop crashing on a missing star count (previously counts[0])
now that GithubTrendingResponseItem.stars is properly optional, and
fix the "likes" text showing a literal "★ null" when it's absent.

Co-authored-by: Claude <noreply@anthropic.com>