Currently, users of the Wikimedia Commons action API cannot create new `MediaInfo` entity on an existing commons page through the Wikibase interface while using the page's baserevid. An investigation is required to determine how to make this possible.
**AC**:
- We know where this operation is blocked (Wikibase or WikibaseMediaInfo?).
- A way forward to implement this functionality is defined
- A ticket (or tickets) have been created to tackle this topic or, if the dev considers the fix quick enough (meaning it fits in the remaining time in timebox), fix it
**Reproduction:**
# Upload a new file (and do NOT add any structured data)
# Use `wbsetclaim` to add a statement and set the baserevid to the latest page revision
# Receive an error
**Current Behavior**:
The request results in an error:
```lang=json,counterexample
{
"errors": [
{
"code": "nosuchrevid",
"text": "Revision with ID not found.",
"data": {
"messages": [
{
"name": "wikibase-api-nosuchrevid",
"parameters": [],
"html": "Revision with ID not found."
}
]
},
"module": "main"
}
],
"docref": "See http://localhost/wiki1/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
}
```
**Expected behavior**:
The edit would be allowed, and is successful.
**Hints**:
- The issue identified in the ticket is with the `wbsetclaim` API, but this likely affects ALL APIs when used in this mode.
- Although the bug is likely in Wikibase or MediaWiki the MediaInfo extension will be greatly beneficial when debugging as it is the only entity type currently setup to work with MCR (Multi-Content Revision).
**Reading:**
- https://www.mediawiki.org/wiki/Requests_for_comment/Multi-Content_Revisions
- https://www.mediawiki.org/wiki/Extension:WikibaseMediaInfo
**Original Note:**
> In T263298 one of the issue at play is that you can't provide a baserevid to Wikibase API endpoints to create a mediainfo entity, if it didn't already exist.
>This is discovered and confirmed in T263298#6494034
>
>> When a file on commons does not get have a media info entity attached to it, you can not use a baserevid in Wikibase API calls
>> This is a small issue with the MCR integration that someone will need to tackle for the edit conflict rules to be able to work in all cases.
Timeboxed to 12 hours