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

Open
#104 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
api, backend

Research direction

Start by reproducing getUserByUsername with the usernames listed in the issue and trace the TypeScript implementation that handles suspended or deleted accounts. Done means all such lookups consistently return undefined instead of throwing 404 errors, including Driver_67, frankeh, heknarf, and Tribyoon_.

Written by the indexing model from the issue text.

Description

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 (Driver_67, 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

Dominant language
TypeScript
Stars
210
Forks
88
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reddit/devvit

All issues in reddit/devvit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.