`getAllowedUsers` function incorrectly rejects usernames containing the digit '0'

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

Nobody has claimed this yet.

Assessment

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

Research direction

Start by locating getAllowedUsers in the @devvit/kit code and tracing how it parses or validates the allowedUsers setting. Reproduce the reported case with zom-bizzle0 alongside the accepted examples. Done when usernames containing 0 are accepted without allowing unintended partial matches.

Written by the indexing model from the issue text.

Description

Issue Summary:
The getAllowedUsers function from @devvit/kit appears to have a parsing or validation issue that incorrectly rejects usernames containing the digit 0, while accepting partial usernames that don't contain 0.

(User string can only contain spaces, letters, numbers, "-", and "_")

Steps to Reproduce:

  1. Set the allowedUsers setting with usernames containing 0:
  2. Test access with different usernames:
    • ✅ zombizzle - Works
    • ✅ zombizzle2 - Works
    • ✅ zom-bizzle3 - Works
    • ❌ zom-bizzle0 - Fails (contains 0)

Expected Behavior:
All usernames should be accepted regardless of whether they contain the digit 0.

Actual Behavior:
Usernames containing the digit 0 are rejected, while partial usernames without 0 are accepted.

Impact:

  • Users with usernames containing 0 cannot access admin features
  • Partial username matching works, suggesting a parsing issue
  • Affects dev toolbar access control functionality

Workaround:
Users can work around this by using partial usernames or contacting support, but this is not ideal for production use.

Additional Notes:
This appears to be a specific issue with the getAllowedUsers function's parsing logic, as the same usernames work fine when used in other contexts (like Redis storage or direct settings access).

Dominant language
TypeScript
Stars
36
Forks
14
Avg merge
15m
Merged PRs (30d)
1

Getting set up

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-kit

All issues in reddit/devvit-kit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.