PLhery / node-twitter-api-v2

Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.
https://www.npmjs.com/package/twitter-api-v2
Apache License 2.0
1.24k stars 174 forks source link

Upload media continues checking when it's failed. #483

Closed timb-103 closed 9 months ago

timb-103 commented 1 year ago

Describe the bug When trying to upload a media but the media is not the right format (for whatever reason) it will continuously loop and check the status. There should be a max tries limit or something perhaps, so we could pause it and say it failed after checking X times.

This is the output I get (from debugging turned on):

Request parameters: [ 'command: STATUS', 'media_id: 123' ] [GET upload.twitter.com/1.1/media/upload.json]: Request succeeds with code 200 Response body: { media_id: 123, media_id_string: '123', media_key: '123', size: 847545, processing_info: { state: 'in_progress', progress_percent: 99, error: { code: 1, name: 'InvalidMedia' } } }

As you can see, it says invalid media and it's just stuck at 99%, so it keeps checking.

alkihis commented 9 months ago

Hello, This is now fixed in 1.15.2 release if this issue is still relevant.