Skip to content

Commit

Permalink
Appview: timeout polo, fail open (#3007)
Browse files Browse the repository at this point in the history
* appview: timeout getFollowsFollowing, fail open

* build
  • Loading branch information
devinivy authored Nov 19, 2024
1 parent 2d9a2a8 commit 0f7f536
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-and-push-bsky-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- divy/timeout-polo
env:
REGISTRY: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_REGISTRY }}
USERNAME: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_USERNAME }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build-and-push-bsky-ghcr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- main
- bsky-use-native-crypto
env:
REGISTRY: ghcr.io
USERNAME: ${{ github.actor }}
Expand Down
16 changes: 11 additions & 5 deletions packages/bsky/src/hydration/actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,17 @@ export class ActorHydrator {
viewer: string | null,
): Promise<KnownFollowers> {
if (!viewer) return new HydrationMap<ProfileViewerState['knownFollowers']>()
const { results: knownFollowersResults } =
await this.dataplane.getFollowsFollowing({
actorDid: viewer,
targetDids: dids,
})
const { results: knownFollowersResults } = await this.dataplane
.getFollowsFollowing(
{
actorDid: viewer,
targetDids: dids,
},
{
signal: AbortSignal.timeout(100),
},
)
.catch(() => ({ results: [] }))
return dids.reduce((acc, did, i) => {
const result = knownFollowersResults[i]?.dids
return acc.set(
Expand Down

0 comments on commit 0f7f536

Please sign in to comment.