Add timeout + error resilience to function retrieve calls#126
Merged
Conversation
One failing Functions.retrieve() call (deleted repo, etc.) no longer crashes the entire functions list or landing page. Each call is wrapped in try/catch so failing functions are skipped instead of breaking Promise.all. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevents the landing page and functions list from hanging indefinitely if a single Functions.retrieve() call is slow or unresponsive. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
Author
Collaborator
|
I inspected network traffic and the deployed code already uses the This PR should be amended with the following:
|
Instead of waiting for all Functions.retrieve() calls to complete before rendering anything, fire all fetches concurrently and update state as each resolves. This means: - First card appears in ~500ms instead of waiting 5s+ for slowest - 3 functions that timeout at 5s no longer block the other 17 - Skeleton cards shown during initial list fetch - Landing page slots fill in progressively (skeleton → real card) - Pagination independent of detail loading state - Empty state only shown after all fetches have settled Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… loading Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
Author
|
Updated to address all 4 points:
Live API test: 17/20 functions load in ~500-690ms, 3 timeout at 5s. Old behavior showed nothing for 5s+. New behavior shows first card at ~500ms. Also merged main to resolve conflicts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause — live site loading skeletons
The API now requires
remoteas a path segment:/functions/github/{owner}/{repo}/{commit}.Without it, the owner is interpreted as the remote parameter:
PR #123 (already merged to
main) addedremote: "github"to all SDK call sites. The live site needs to be redeployed frommainto pick up that change.Functions.list()works withoutremote, so the list loads but everyFunctions.retrieve()detail fetch returns 400 — causing endless skeletons.What this PR adds (on top of PR #123)
Two defensive improvements to
page.tsxandfunctions/page.tsx:Functions.retrieve()call — prevents indefinite hangs if a single call is slow or unresponsivePromise.all— one failing retrieve no longer crashes the entire page; it's skipped and the rest still renderFiles changed
objectiveai-web/app/page.tsx— landing page featured functionsobjectiveai-web/app/functions/page.tsx— functions browse page🤖 Generated with Claude Code