This repository has no description
0

Configure Feed

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

fix again

+21 -7
+21 -7
app/src/app/api/bluesky/profile/route.ts
··· 114 114 115 115 // Step 2: Get the PDS service endpoint from PLC directory 116 116 let serviceEndpoint = 'https://bsky.social'; // Start with bsky.social as fallback 117 - let servicePds = null; // Store the actual PDS domain for logging 117 + let servicePds: string | null = null; // Store the actual PDS domain for logging 118 118 try { 119 119 console.log(`Looking up PDS endpoint for DID: ${did}`); 120 120 const plcResponse = await fetch(`https://plc.directory/${did}/data`); ··· 203 203 ]; 204 204 205 205 // Start with the most common pattern 206 - let pdsDirectResponse = null; 206 + let pdsDirectResponse: Response | null = null; 207 207 let pdsDirectUrl = ''; 208 - let directData = null; 208 + let directData: any = null; 209 209 let succeeded = false; 210 210 211 211 for (const url of urls) { ··· 274 274 serviceEndpoint: `https://${servicePds}`, 275 275 directPds: true 276 276 }); 277 + } else if (pdsDirectResponse) { 278 + try { 279 + const errorText = await pdsDirectResponse.text(); 280 + console.warn(`PDS direct access failed: ${errorText}`); 281 + } catch (e) { 282 + console.warn(`PDS direct access failed: Could not read response text`); 283 + } 277 284 } else { 278 - console.warn(`PDS direct access failed: ${await pdsDirectResponse.text()}`); 285 + console.warn(`PDS direct access failed: No valid response`); 279 286 } 280 287 } catch (pdsErr) { 281 288 console.error(`Error with direct PDS domain access: ${pdsErr}`); ··· 294 301 `https://${domain}/com.atproto.repo.listRecords?repo=${encodeURIComponent(did)}&collection=${encodeURIComponent(FLUSHING_STATUS_NSID)}&limit=${MAX_ENTRIES}` 295 302 ]; 296 303 297 - let domainResponse = null; 298 - let domainData = null; 304 + let domainResponse: Response | null = null; 305 + let domainData: any = null; 299 306 let succeeded = false; 300 307 301 308 for (const url of urls) { ··· 363 370 serviceEndpoint: `https://${domain}`, 364 371 handleDomain: true 365 372 }); 373 + } else if (domainResponse) { 374 + try { 375 + const errorText = await domainResponse.text(); 376 + console.warn(`Handle domain access failed: ${errorText}`); 377 + } catch (e) { 378 + console.warn(`Handle domain access failed: Could not read response text`); 379 + } 366 380 } else { 367 - console.warn(`Handle domain access failed: ${await domainResponse.text()}`); 381 + console.warn(`Handle domain access failed: No valid response`); 368 382 } 369 383 } catch (domainErr) { 370 384 console.error(`Error with handle domain access: ${domainErr}`);