Today I faced a really weird situations. I have an API built in CakePHP 3.7. That API receives requests from:
- 10 tablets using an Android Java app built by me
- A lot of info from an ERP software. I built the integration with the ERP too, in Java
This is a really concise API, consisting of 12 entities, but some of them have plenty of records. The most massive has 3.000.000 records, and the second one has 300.000. The database is a MySQL
So, a couple months ago we detected some of the records from the app didn’t upload correctly. This is a simple record, with six fields, most of them integers and one text field. So, I implemented a request-response special log and sent an update to the tablets, so next time it was detected we could know what happened.
To my surprise, when we detect the case, we can see that the API received the message, and gave a 200 OK response with a record having an ID, so it should be stored. When I went to the database, the record was missing.
Now I’ve implemented a post synch control, in order to retry the false oks. But it makes me wonder, has anyone experienced this issue, where CakePHP 3 returns a non-error entity after save but it hasn’t really persisted?
I am waiting to gain permissions to MySQL logs in order to get to know the core issue. Meanwhile, I could gather information and there are about 9.000 records missing on the 300.000 records table.