Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Notifications seen as duplicate on Twitter #20

Closed
jouir opened this issue Apr 2, 2021 · 0 comments
Closed

Notifications seen as duplicate on Twitter #20

jouir opened this issue Apr 2, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@jouir
Copy link
Owner

jouir commented Apr 2, 2021

When a product is available, a notification is sent to Twitter. When the product is sold out, the reference in the database is deleted and, eventually, a reply to the original message is sent.

Sometimes, the very same product is available again. A new notification, with the same message content, is sent. But Twitter returns the following error:

failed to create new twitter thread: twitter: 187 Status is a duplicate.

I don't see a way to check if a status is a duplicate before sending a tweet on the Twitter API.

We should create a checksum of the status content, store it in the database with the twitter ID then verify the checksum before creating a new tweet. If the checksum is detected in the database, reply to the original tweet or the reply to continue the thread (unless enable_replies is set to false).

@jouir jouir added the bug Something isn't working label Apr 2, 2021
jouir added a commit that referenced this issue Apr 15, 2021
This commit adds a hash attribute to help identify duplicate messages. Tweets
have a TweetID attribute for the initial thread identifier and a LastTweetID
attribute to keep track of the last reply to eventually continue the thread if a
duplicate is detected.

Signed-off-by: Julien Riou <julien@riou.xyz>
jouir added a commit that referenced this issue Apr 15, 2021
- Handle Twitter duplicates (#20)
- Ignore *.bak files
- Bugfix asynchronous loop
- Add tests for utils.go
- Add MySQL support (#24)
- Bugfix Twitter foreign key
- Include chromium in docker-compose

Signed-off-by: Julien Riou <julien@riou.xyz>
@jouir jouir closed this as completed Apr 15, 2021
jouir added a commit that referenced this issue Apr 15, 2021
- Bugfix typo for compilation
- Handle Twitter duplicates (#20)
- Ignore *.bak files
- Bugfix asynchronous loop
- Add tests for utils.go
- Add MySQL support (#24)
- Bugfix Twitter foreign key
- Include chromium in docker-compose

Signed-off-by: Julien Riou <julien@riou.xyz>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant