New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.update returns last tweet, not the duplicate #743

Closed
ponny opened this Issue Nov 16, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@ponny

ponny commented Nov 16, 2015

You can see the code here:
https://github.com/sferik/twitter/blob/master/lib/twitter/rest/tweets.rb#L127

In the event of a duplicate tweet, it returns the users last tweet and not the actual duplicate. This is very misleading. I suggest either throwing an error like the library used to or perferably somehow returning a reference to the tweet that the update would be a duplicate of.

@stve

This comment has been minimized.

Collaborator

stve commented Mar 23, 2016

Hi @ponny, there are actually two methods here, #update is more passive and falls back to returning the last tweet sent by the user. Unfortunately, there is no mechanism by which to determine the duplicate - it's not passed back from the API. To raise an exception, the #update! method will raise a Twitter::Error::DuplicateStatus.

@stve stve closed this Mar 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment