Skip to content

[Feature Request] Server may take time to process media #61

Closed
@SpriteOvO

Description

After I attached a GIF media and tried to post a new status with it, I got an error:

Api { status: 422, response: ApiError { error: "Cannot attach files that have not finished processing. Try again in a moment!", error_description: None } }

According to the API /media docs.

202: Accepted

MediaAttachment was created successfully, but the full-size file is still processing. Note that the MediaAttachment’s url will still be null, as the media is still being processed in the background. However, the preview_url should be available. Use GET /api/v1/media/:id to check the status of the media attachment.

Checking if an attachment has finished processing is impossible for now. I suggest:

  • Make Mastodon::media method returns an enum to indicate if it is still being processing.

  • Add a new method Mastodon::check_media_status to check if a media is finished processing.

  • Add a new method Mastodon::upload_media (maybe another better name) to wrap the wait process, it receives a timeout value from users.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions