{"record":{"id":"86dfefbe027e5d1e","repo":"glanceapp/glance","slug":"w-could-not-fetch-some-hacker-news-posts","errorCode":null,"errorMessage":"%w could not fetch some hacker news posts","messagePattern":"%w could not fetch some hacker news posts","errorType":"exception","errorClass":"errPartialContent","httpStatus":null,"severity":"warning","filePath":"internal/glance/widget-hacker-news.go","lineNumber":135,"sourceCode":"\t\t}\n\n\t\tposts = append(posts, forumPost{\n\t\t\tTitle:           results[i].Title,\n\t\t\tDiscussionUrl:   commentsUrl,\n\t\t\tTargetUrl:       results[i].TargetUrl,\n\t\t\tTargetUrlDomain: extractDomainFromUrl(results[i].TargetUrl),\n\t\t\tCommentCount:    results[i].CommentCount,\n\t\t\tScore:           results[i].Score,\n\t\t\tTimePosted:      time.Unix(results[i].TimePosted, 0),\n\t\t})\n\t}\n\n\tif len(posts) == 0 {\n\t\treturn nil, errNoContent\n\t}\n\n\tif len(posts) != len(postIds) {\n\t\treturn posts, fmt.Errorf(\"%w could not fetch some hacker news posts\", errPartialContent)\n\t}\n\n\treturn posts, nil\n}\n\nfunc fetchHackerNewsPosts(sort string, limit int, commentsUrlTemplate string) (forumPostList, error) {\n\tpostIds, err := fetchHackerNewsPostIds(sort)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(postIds) > limit {\n\t\tpostIds = postIds[:limit]\n\t}\n\n\treturn fetchHackerNewsPostsFromIds(postIds, commentsUrlTemplate)\n}\n","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/widget-hacker-news.go#L117-L153","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"posts, err := fetchHackerNewsPostsFromIds(ids, tpl)\nif errors.Is(err, errPartialContent) {\n    // acceptable: render what we got, log the shortfall\n    slog.Warn(\"hacker news partial fetch\", \"got\", len(posts), \"want\", len(ids))\n    return posts, nil\n}\nif err != nil { return nil, err }","preventionTips":["Lower the widget limit to reduce parallel item fetches","Treat partial content as expected behavior, not an alert-worthy failure"],"tags":["hacker-news","partial-content","network","retry"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}