Bug: PostType strings in SubredditInfo.allAllowedPostTypes are returned in uppercase instead of lowercase

Open Beginner friendly
#276 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
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
api

Research direction

Start by locating the TypeScript definition and data path for SubredditInfo.allAllowedPostTypes and compare its PostType values with the official PostType documentation. Confirm that the returned values use lowercase strings such as "text", then add or update coverage for this field so the corrected casing is verified.

Written by the indexing model from the issue text.

Description

The official documentation shows that strings with an alias of PostType are supposed to be in lowercase, but testing reveals that in SubredditInfo.allAllowedPostTypes, they are stored in uppercase (e.g., "TEXT" instead of "text").

See the below screenshot; I simply logged all the PostType strings in SubredditInfo.allAllowedPostTypes to the console.

Image

In my code, I've worked around this by casting the PostType to a string and calling toLowerCase() on it. Nevertheless, I felt I should report this bug.

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.