sferik / x-ruby

A Ruby interface to the X API.
MIT License
68 stars 13 forks source link

Forbidden: You are not allowed to create a Tweet with duplicate content. #24

Closed corey-schneider closed 2 months ago

corey-schneider commented 3 months ago

I'm getting this error any time I post: X::Forbidden (Forbidden: You are not allowed to create a Tweet with duplicate content.)

The post will succeed, but I get a 500 error on my server.

Changing the tweet text to "i am some testing text, using words i don't use", still seeing the same error.

sferik commented 3 months ago

I’m not able to reproduce this, so I'm going to need more details. Can you share the relevant snippet of code that causing a 500 error? My guess is that you're attempting to post in a loop or a method that gets invoked multiple times. I don’t believe this is an issue with this library, but I invite you to try to prove otherwise.

corey-schneider commented 2 months ago

My apologies, you are right, it's not a problem with the gem. I should've looked a bit deeper before posting. It's a quirk with Turbo on Rails 7.

I changed button_to "Create tweet", recipe_tweet_path(@recipe), method: :get to link_to recipe_tweet_path(@recipe).

This will submit twice and cause that error message. Turbo wants this appended: data: { turbo_method: :get }