alpha
Login
or
Join now
atpota.to
/
flushes.app
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
fix again
author
damedotblog
date
1 year ago
(Mar 15, 2025, 9:53 PM -0400)
commit
27ea6a77
27ea6a77f7a5b72a33ae2f9438db2e9c33c30982
parent
8299bf32
8299bf32f2b7713f11f50d24fd09017a3de439d6
+21
-7
1 changed file
Expand all
Collapse all
Unified
Split
app
src
app
api
bluesky
profile
route.ts
+21
-7
app/src/app/api/bluesky/profile/route.ts
Reviewed
···
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
117
-
let servicePds = null; // Store the actual PDS domain for logging
117
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
206
-
let pdsDirectResponse = null;
206
206
+
let pdsDirectResponse: Response | null = null;
207
207
let pdsDirectUrl = '';
208
208
-
let directData = null;
208
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
277
+
} else if (pdsDirectResponse) {
278
278
+
try {
279
279
+
const errorText = await pdsDirectResponse.text();
280
280
+
console.warn(`PDS direct access failed: ${errorText}`);
281
281
+
} catch (e) {
282
282
+
console.warn(`PDS direct access failed: Could not read response text`);
283
283
+
}
277
284
} else {
278
278
-
console.warn(`PDS direct access failed: ${await pdsDirectResponse.text()}`);
285
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
297
-
let domainResponse = null;
298
298
-
let domainData = null;
304
304
+
let domainResponse: Response | null = null;
305
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
373
+
} else if (domainResponse) {
374
374
+
try {
375
375
+
const errorText = await domainResponse.text();
376
376
+
console.warn(`Handle domain access failed: ${errorText}`);
377
377
+
} catch (e) {
378
378
+
console.warn(`Handle domain access failed: Could not read response text`);
379
379
+
}
366
380
} else {
367
367
-
console.warn(`Handle domain access failed: ${await domainResponse.text()}`);
381
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}`);