Fix username resolver: use www.reddit.com, not api.reddit.com

api.reddit.com/api/user_data_by_account_ids returns 404 without an
OAuth token — which is why every chat in the dashboard sat on
t2_xxx or unknown. The same path on www.reddit.com (with a .json
suffix) is served unauthenticated and returns the expected user
map. Switch the resolver to that host so enrichUsernames actually
succeeds.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
jjbruntonandClaude Opus 4.7 committed 2026-05-22 23:30:01 +01:00
1 parent 01ea8fd36b
commit cf7fc41761
2 files changed
+6 -2

No files matched your search

+3 -1
View File
@@ -208,7 +208,9 @@ export async function bootstrap(config: Config, logger: Logger): Promise<AppCont
const chunk = ids.slice(i, i + 100).join(',');
try {
const res = await fetchWithTimeout(
`https://api.reddit.com/api/user_data_by_account_ids?ids=${encodeURIComponent(chunk)}`,
// www.reddit.com serves this unauthenticated; the api.reddit.com
// host 404s the same path without an OAuth token.
`https://www.reddit.com/api/user_data_by_account_ids.json?ids=${encodeURIComponent(chunk)}`,
{ headers: { 'User-Agent': config.reddit.userAgent }, timeoutMs: 15_000 },
);
if (!res.ok) {