System Information
- Strapi Version: 4.12.5
- Operating System: Linux (Dockerized)
- Database: PostgreSQL 14
- Node Version: 18.17.1
- NPM Version: 9.6.7
Our model includes a CollectionType (call it “Page”) that has among other properties a relation of type “Media” (call it “exportXml”).
Our application does the following:
- Create a new File by upload via the strapi api
- Grab the ID from the response
- Update an instance of Page with the ID of the newly created file via the strapi GraphQL api
- Read back this instance of Page
In ca. 90% of cases everything goes smoothly. In the other instances, the last step returns stale data.
Excerpt from the GraphQL payload for the update (step 3):
{
"PageId": "4658",
"data": {
// many more properties
"exportXML": "1769974"
}
}
The immediately following read request (byId) for the Page then yields:
{
// many more properties
"exportXML": {
"data": {
"id": "1769972",
"attributes": {
// some more properties of the file
}
}
}
}
You can see that the read request returns the old, stale id 1769972, the update has set this to 1769974.
We have captured these requests/responses by a logging middleware that logs all request and response bodies. We have also turned on knex logging by the DEBUG
environment variable. Is there anything else we can do to analyze the problem?