Repeated "MastoUnprocessableEntityError" on upgrade from masto.js 2.x to 3.x
See original GitHub issueHi, I upgraded from masto@2.5.4
to masto@3.5.1
and renamed the uploadMediaAttachment
method and response object parameters as indicated by the breaking changes in the release notes for 3.0.0, but now I’m getting a MastoUnprocessableEntityError
whenever I try to make a post with uploaded media. Previously it used to work fine.
The full error:
MastoUnprocessableEntityError: Cannot attach files that have not finished processing. Try again in a moment!
The code I was using with masto@2.5.4
, which worked fine:
// ...
const { id } = await masto.uploadMediaAttachment({
file: createReadStream(filename),
description: title
});
const { created_at, uri } = await masto.createStatus({
status: title,
visibility: "public",
media_ids: [id]
});
The code I am using with masto@3.5.1
, which throws the exception:
// ...
const { id } = await masto.createMediaAttachment({
file: createReadStream(filename),
description: title,
});
const { createdAt, uri } = await masto.createStatus({
status: title,
visibility: "public",
mediaIds: [id],
});
Is it possible this is a change in the Mastodon API behaviour introduced in 3.1.0 when using the v2/media
endpoint? If so, that seems like a breaking change.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
masto - npm
Mastodon API client for JavaScript, TypeScript, Node.js, browsers. Latest version: 4.9.1, last published: 5 days ago. Start using masto in ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As of masto@4.0.0, the polling is enabled by default. To skip waiting for the media process and access the incomplete data, you can use new
skipPolling
param available in bothmediaAttachments.create
andmediaAttachments.update
. https://neet.github.io/masto.js/interfaces/repositories_media_attachment_repository.createmediaattachmentparams.html#skippolling@lostfictions I’ve totally forgotten about that. I added a timeout handling in #305 and shipped as
v3.6.2
. You can configure by