Blogging platform with advanced tools for arts and sciences.
6

Configure Feed

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

Don't treat API-level 401 as session expiry in suggestions functions.

getServiceToken already throws SessionExpiredError when the PDS rejects the service auth request, which propagates before the API call happens. If getServiceToken succeeds but the API returns 401 (wrong API_DID, clock skew, etc.), the user's PDS session is still valid — calling signOut() would revoke it unnecessarily. Surface these as generic errors instead, consistent with listPublications and listSubscriptions.

lemma (Jun 13, 2026, 9:16 PM -0500) 0a21e07e 894a15f1

-3
-3
app/lib/api-client.ts
··· 1379 1379 headers: { Authorization: `Bearer ${token}` }, 1380 1380 }) 1381 1381 if (!res.ok) { 1382 - if (res.status === 401) throw new SessionExpiredError() 1383 1382 const body = await res.text().catch(() => '') 1384 1383 throw new Error(`API error (${res.status})${body ? `: ${body}` : ''}`) 1385 1384 } ··· 1398 1397 body: JSON.stringify({ pubs }), 1399 1398 }) 1400 1399 if (!res.ok) { 1401 - if (res.status === 401) throw new SessionExpiredError() 1402 1400 const body = await res.text().catch(() => '') 1403 1401 throw new Error(`API error (${res.status})${body ? `: ${body}` : ''}`) 1404 1402 } ··· 1413 1411 headers: { Authorization: `Bearer ${token}` }, 1414 1412 }) 1415 1413 if (!res.ok) { 1416 - if (res.status === 401) throw new SessionExpiredError() 1417 1414 const body = await res.text().catch(() => '') 1418 1415 throw new Error(`API error (${res.status})${body ? `: ${body}` : ''}`) 1419 1416 }