You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note how the data.reblog.media_attachments[0].description is indeed null.
Even when I request the statuses endpoint directly for this post, i.e., curl -H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" $MASTODON_API_URLstatuses/110672863357802426, I got the same payload as above, with description set to null.
But curiously, after a few minutes of experimenting, I noticed in the browser that hitting that same endpoint now returns JSON with the "description": "Time-lapse video of a …",! Therefore, if I unboost and reboost the same toot, the bot doesn't warn me.
Here's what I think is going on. Hypothesis: when a user boosts a toot, botsin.space doesn't get the contents of the toot at the time of the boost but a "smaller" payload with just the toot ID. Botsin.space has already seen that toot ID—it's in its cache—so it doesn't look for any edits. When someone that PleaseCaption bot follows boosts the toot, botsin.space gives the bot the old cached copy. But later, if I search for the toot while on botsin.space, then it will go out to the original instance and look for edits.
Hypothesis 2: hitting the context or search endpoints makes botsin.space search the original server for any edits.
After the warns me (incorrectly) for boosting another edited-to-add-alt-text toot, when I search for that toot in the botsin.space Mastodon web client, the search endpoint returns the edited toot, so if I unboost and reboost it, the bot is happy. So search is probably checking for edits. Edit confirmed hitting the api/v2/search endpoint with resolve=true and the query as the boosted toot URL directly yields the toot status with the updated image description.
hitting context or history endpoints do NOT result in botsin.space finding the edited toot.
Therefore we may have to hit the search?resolve=true endpoint (with limit=1 and type=statuses to minimize the workload) when we find a boosted toot without image captions in order to detect edits…
@zactopus do you know of any details about how edits are propagated server-to-server and if there's any alternative to the search proposal above?
(Background aside: I know I've boosted toots after alt text were added, and the bot didn't complain, e.g., https://mastodon.social/@Manigarm/110576935488724453. I don't think the author of the original toot follows the bot, so her edit wouldn't have directly flowed to botsin.space. So there's some mechanism by which some/many edits make it to the instance. I'd like to know more about how that happens.)
The text was updated successfully, but these errors were encountered:
I think your approach makes sense, I am a bit worried about hitting rate limits with additional calls. Maybe it's time to write a queue system finally lol.
fasiha
added a commit
to fasiha/please-caption-mastodon-backup
that referenced
this issue
Aug 29, 2023
Example: when boosting https://mastodon.social/@cacheflowe/110672863305088428 the bot receives the following message (with
account
sections elided):Note how the
data.reblog.media_attachments[0].description
is indeed null.Even when I request the
statuses
endpoint directly for this post, i.e.,curl -H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" $MASTODON_API_URLstatuses/110672863357802426
, I got the same payload as above, withdescription
set tonull
.But curiously, after a few minutes of experimenting, I noticed in the browser that hitting that same endpoint now returns JSON with the
"description": "Time-lapse video of a …",
! Therefore, if I unboost and reboost the same toot, the bot doesn't warn me.Here's what I think is going on. Hypothesis: when a user boosts a toot, botsin.space doesn't get the contents of the toot at the time of the boost but a "smaller" payload with just the toot ID. Botsin.space has already seen that toot ID—it's in its cache—so it doesn't look for any edits. When someone that PleaseCaption bot follows boosts the toot, botsin.space gives the bot the old cached copy. But later, if I search for the toot while on botsin.space, then it will go out to the original instance and look for edits.
Hypothesis 2: hitting the
orcontext
search
endpoints makes botsin.space search the original server for any edits.search
endpoint returns the edited toot, so if I unboost and reboost it, the bot is happy. Sosearch
is probably checking for edits. Edit confirmed hitting theapi/v2/search
endpoint withresolve=true
and the query as the boosted toot URL directly yields the toot status with the updated image description.context
orhistory
endpoints do NOT result in botsin.space finding the edited toot.Therefore we may have to hit the
search?resolve=true
endpoint (withlimit=1
andtype=statuses
to minimize the workload) when we find a boosted toot without image captions in order to detect edits…@zactopus do you know of any details about how edits are propagated server-to-server and if there's any alternative to the
search
proposal above?(Background aside: I know I've boosted toots after alt text were added, and the bot didn't complain, e.g., https://mastodon.social/@Manigarm/110576935488724453. I don't think the author of the original toot follows the bot, so her edit wouldn't have directly flowed to botsin.space. So there's some mechanism by which some/many edits make it to the instance. I'd like to know more about how that happens.)
The text was updated successfully, but these errors were encountered: