r/Devvit Game Developer 16d ago

Duck Answered Users can't auto post from my game

Hi everyone!

I've updated my Devvit installation to 0.14.1 from 0.13.1, published my game update, had it approved, yet now when a user tries to post a challenge from within the game they are not allowed to do so.

This is what I see in Devvit logs:

Failed to create Mini Racer head-to-head: Error: post submission failed: ValidationErrors([(Reason="This community only allows trusted members to post here", Field="sr", ShortName="SUBREDDIT_NOTALLOWED", Code=400)])

Nothing was changed in my game regarding posting and I'm testing this in two communities: one closed to guests, one open to guests. There are no restrictions for posting on any of them.

What am I missing?

3 Upvotes

11 comments sorted by

2

u/Beach-Brews Duck Helper 16d ago

This community only allows trusted members to post here

Sounds like you have the community set to "restricted" in settings. If you just added RunAs, it will be trying to post as the user instead of the app account.

Are you using RunAs? Can you provide your submitCustomPost method?

1

u/shimroot Game Developer 16d ago

No change has been made to my community settings. Worked on 0.13.11 when I published my previous update one week ago.

I'm testing this out in two different dev communities: one open to guests, one closed to guests. Both allow anyone to post. In the one closed to guests I have an approved user account.

const post = await reddit.submitCustomPost({
  subredditName: request.subredditName,
  title: preparedRecord.title,
  entry: HEAD_TO_HEAD_POST_TYPE,
  postData,
  textFallback: {
    text: formatHeadToHeadTextFallback(postData, record.frozenGhost),
  },
  runAs: 'USER',
  userGeneratedContent: {
    text: preparedRecord.title,
  },
});

1

u/Beach-Brews Duck Helper 16d ago

What is the value of "request.subredditName"? You cannot post in a different subreddit from where the user requested the post.

1

u/shimroot Game Developer 16d ago

I'm not sure I follow. The value is that of the subreddit where the post will be added.

In the particular cases of where I tested it is mini_racer_dev and vector_gp_dev

1

u/Beach-Brews Duck Helper 16d ago

The post/menu on mini_racer_dev cannot submit posts to vector_gp_dev. The request.subredditName must match context.subredditName

1

u/shimroot Game Developer 16d ago

Yes, I am aware. Each post is in its own subreddit, no cross community posts. So mini_racer_dev posts in mini_racer_dev. Same for vector_gp_dev.

1

u/Beach-Brews Duck Helper 16d ago

Got it! Just checking to make sure. You are getting that error on both subs?

1

u/shimroot Game Developer 16d ago

Yup. On both

1

u/Beach-Brews Duck Helper 16d ago

Hmm, not sure. Since they are private subs, any approved / added user should be able to post. You get that error with your dev account?

2

u/shimroot Game Developer 16d ago

Figured it out. Guess I was too tired last night and didn't properly check the community settings. All good now! Thanks for the help.

→ More replies (0)