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:
1 parent
01ea8fd36b
commit
cf7fc41761
2 files changed
+6
-2
No files matched your search
@@ -1066,7 +1066,8 @@ export class ChatService {
|
||||
}
|
||||
}
|
||||
|
||||
// Pass 3 — for every chat still on a raw t2 ID, call the resolver.
|
||||
// Pass 3 — for every chat still on a raw t2 ID, batch-resolve via the
|
||||
// injected resolver (www.reddit.com/api/user_data_by_account_ids.json).
|
||||
const needed: string[] = [];
|
||||
for (const chat of this.cache.get()) {
|
||||
const t2 = this.extractT2(chat);
|
||||
@@ -1078,6 +1079,7 @@ export class ChatService {
|
||||
let updated = 0;
|
||||
for (const [t2, name] of Object.entries(got)) {
|
||||
const bare = t2.replace(/^t2_/, '');
|
||||
if (!name) continue;
|
||||
this.t2ToUsername.set(bare, name);
|
||||
this.persistUsername(t2, name);
|
||||
for (const chat of this.cache.get()) {
|
||||
|
||||
Reference in new issue
Block a user