reddit / devvit

Reddit for Developers
https://developers.reddit.com
BSD 3-Clause "New" or "Revised" License
63 stars 14 forks source link

Suspended and deleted users don't return `undefined` reliably on getUserByUsername #104

Open devvit-help-bot[bot] opened 2 days ago

devvit-help-bot[bot] commented 2 days ago

Details

Expected behaviour: When calling getUserByUsername on these users, I expect to get undefined back.

Actual behaviour: Some users (e.g. SomeRedditWanker, RedheadBanjoBabe) return undefined. Others (Driver67, frankeh, heknarf, Tribyoon) throw 404 errors.

Additional info

Discord message: _There's some weird issues with suspended or deleted accounts right now. With recent-ish changes, I'd expect the getUserByUsername call to return undefined for these users, but in most (but NOT all cases), these throw an error instead. Here's a gist with example code: https://gist.github.com/fsvreddit/1b6504b7095c9b6fceaeb5acfba04bb6

Two of the users tested (/u/SomeRedditWanker, /u/RedheadBanjoBabe, both suspended) returns undefined correctly. However the rest of them all throw 404 errors._

Message author: big.wheel

Discord link: https://discord.com/channels/1050224141732687912/1242689647478308895/1293860080533377055