This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

test

+27 -11
+27 -11
src/components/Verifier/Verifier.js
··· 287 287 setNetworkStatusMessage("Fetching network lists (mutuals, follows)..."); 288 288 289 289 try { 290 - console.log("checkNetworkVerifications: Fetching follows (public) and mutuals (authenticated)..."); 290 + console.log("checkNetworkVerifications: Fetching follows (public) and attempting direct getKnownFollowers..."); 291 291 292 - // *** Fetch follows using direct fetch *** 292 + // Fetch follows using direct fetch 293 293 const followsUrl = `https://public.api.bsky.app/xrpc/app.bsky.graph.getFollows`; 294 294 const followsParams = { actor: session.did, limit: 100 }; 295 + const follows = await fetchAllPaginated(null, null, followsParams, true, followsUrl); 295 296 296 - // *** Fetch known followers using authenticated agent *** 297 - const knownFollowersMethod = agent.api.app.bsky.graph.getKnownFollowers.bind(agent.api.app.bsky.graph); 298 - const knownFollowersParams = { actor: session.did, limit: 100 }; 297 + // *** Fetch Known Followers Directly (First Page Only for Test) *** 298 + let mutuals = []; 299 + try { 300 + const knownFollowersResponse = await agent.api.app.bsky.graph.getKnownFollowers({ 301 + actor: session.did, 302 + limit: 100 // Fetch first page 303 + }); 304 + if (knownFollowersResponse?.data?.followers) { 305 + mutuals = knownFollowersResponse.data.followers; 306 + console.log(`Direct getKnownFollowers call successful, got ${mutuals.length} mutuals.`); 307 + } else { 308 + console.warn("Direct getKnownFollowers call returned unexpected structure:", knownFollowersResponse); 309 + } 310 + } catch (knownFollowersError) { 311 + console.error("Direct getKnownFollowers call failed:", knownFollowersError); 312 + // Set status message to indicate failure for this part 313 + setNetworkStatusMessage("Failed to fetch mutuals/known followers."); 314 + // Optionally, proceed without mutuals or stop the check 315 + // For now, let's continue with just follows if mutuals failed 316 + } 299 317 300 - const [follows, mutuals] = await Promise.all([ 301 - fetchAllPaginated(null, null, followsParams, true, followsUrl), 302 - fetchAllPaginated(agent, knownFollowersMethod, knownFollowersParams) 303 - ]); 318 + // Now mutuals contains only the first page, or is empty on error. 319 + // The rest of the logic will proceed, but mutuals data might be incomplete or missing. 304 320 305 - console.log(`checkNetworkVerifications: Fetched ${follows.length} follows, ${mutuals.length} mutuals.`); 306 - setNetworkStatusMessage(`Processing ${follows.length} follows and ${mutuals.length} mutuals...`); 321 + console.log(`checkNetworkVerifications: Fetched ${follows.length} follows, ${mutuals.length} known followers (first page).`); 322 + setNetworkStatusMessage(`Processing ${follows.length} follows and ${mutuals.length} known followers...`); 307 323 setNetworkVerifications(prev => ({ ...prev, fetchedMutualsCount: mutuals.length, fetchedFollowsCount: follows.length })); 308 324 309 325 const followsSet = new Set(follows.map(f => f.did));