glanceapp/glance · warning · errPartialContent
%w could not fetch some hacker news posts
Error message
%w could not fetch some hacker news posts
What it means
Partial-content error: some individual post fetches from the Hacker News API failed, so the returned list is shorter than the requested post ID list. Posts that did succeed are still returned alongside the error (errPartialContent), so the widget renders with a partial-state indicator.
Source
Thrown at internal/glance/widget-hacker-news.go:135
}
posts = append(posts, forumPost{
Title: results[i].Title,
DiscussionUrl: commentsUrl,
TargetUrl: results[i].TargetUrl,
TargetUrlDomain: extractDomainFromUrl(results[i].TargetUrl),
CommentCount: results[i].CommentCount,
Score: results[i].Score,
TimePosted: time.Unix(results[i].TimePosted, 0),
})
}
if len(posts) == 0 {
return nil, errNoContent
}
if len(posts) != len(postIds) {
return posts, fmt.Errorf("%w could not fetch some hacker news posts", errPartialContent)
}
return posts, nil
}
func fetchHackerNewsPosts(sort string, limit int, commentsUrlTemplate string) (forumPostList, error) {
postIds, err := fetchHackerNewsPostIds(sort)
if err != nil {
return nil, err
}
if len(postIds) > limit {
postIds = postIds[:limit]
}
return fetchHackerNewsPostsFromIds(postIds, commentsUrlTemplate)
}
View on GitHub (pinned to 91324e8de7)
Solutions
- Treat as transient — verify the next scheduled update succeeds
- Lower the hacker-news widget's limit to reduce concurrent item requests
- Check general connectivity to firebaseio.com if partial content persists every cycle
Defensive patterns
Strategy: fallback
Try / catch
posts, err := fetchHackerNewsPostsFromIds(ids, tpl)
if errors.Is(err, errPartialContent) {
// acceptable: render what we got, log the shortfall
slog.Warn("hacker news partial fetch", "got", len(posts), "want", len(ids))
return posts, nil
}
if err != nil { return nil, err } Prevention
- Lower the widget limit to reduce parallel item fetches
- Treat partial content as expected behavior, not an alert-worthy failure
When it happens
Trigger: One or more GET /v0/item/<id>.json requests in the worker pool fail while others succeed — typically per-item timeouts or transient errors under concurrent load.
Common situations: Slow network causing a few of the ~limit parallel item fetches to time out; Firebase rate limiting bursts of item requests; occasional deleted-item responses.
Related errors
- %w: could not fetch list of post IDs
- could not solve reddit challenge
- failed to retrieve any content
- expected status code %d, got %d
- starting server: %w
AI-assisted analysis of glanceapp/glance@91324e8de7 (2026-08-15).
Data as JSON: /api/errors/86dfefbe027e5d1e.
Report an issue: GitHub.