Skip to content

CommentMediaTypes and asCommentMediaTypes doesn't include "video" #253

@PitchforkAssistant

Description

@PitchforkAssistant

This feature has been available on some subreddits for a while, but it appears to be aiming for a broader beta soon.

Devvit apps on subreddits with this enabled will fail to fetch the current subreddit with the error: Error: invalid comment media type: video

This was recently noted on /r/Devvit and a few months ago on the Devvit Discord.

Looks like it's just a @devvit/public-api and @devvit/reddit issue, @devvit/protos defines Subreddit.allowedMediaInComments as string[]

export type CommentMediaTypes = 'giphy' | 'static' | 'animated' | 'expression';

function asCommentMediaTypes(type: string): CommentMediaTypes {
if (type === 'animated' || type === 'giphy' || type === 'static' || type === 'expression') {
return type;
}
throw new Error(`invalid comment media type: ${type}`);
}

export type CommentMediaTypes = 'giphy' | 'static' | 'animated' | 'expression';

function asCommentMediaTypes(type: string): CommentMediaTypes {
if (type === 'animated' || type === 'giphy' || type === 'static' || type === 'expression') {
return type;
}
throw new Error(`invalid comment media type: ${type}`);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions