Support text on URL posts

Open
#297 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
66/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
api

Research direction

Start by reading SubmitPostOptions and the LinksAndComments.Submit SubmitRequest description in @devvit/reddit 0.15.0. Trace how reddit.submitPost builds and sends link submissions, then check the relevant type and API tests. Done when a link post accepts body text and the request carries it through, with tests covering the behavior.

Written by the indexing model from the issue text.

Description

Reddit’s public API lets a link post carry body text: POST /api/submit with kind=link, url and text. Devvit’s reddit.submitPost does not. Apps moving from PRAW or the Data API to Devvit lose this feature.

Example of a post with both: https://www.reddit.com/r/GlobalOffensive/comments/1xcxfv2/counterstrike_2_update_for_10222026/

Current behaviour (@devvit/reddit 0.15.0)

In SubmitPostOptions, the link variant is SubmitLinkOptions & { richtext?: never; text?: never; kind?: never }. TypeScript rejects any attempt to pass a body with a url.
The LinksAndComments.Submit API description (SubmitRequest) documents text and richtextJson as “Only used if kind is set to “self””. A body sent with kind: "link" therefore seems to be ignored even if the types are bypassed.

Dominant language
TypeScript
Stars
217
Forks
89
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.