Right, sorted! The problem was to do with the IID property I was using in the Vote model, which is why it was never able to retrieve the correct issue.
In the vote model, I changed the IID to ndb.KeyProperty(kind=Issue)
. Trying to use the integer ID from the datastore didn't work though; as I commented above, this gave a ProtocolBufferDecodeError "corrupted"
. However, passing the 64bit entitykey in the request works! So, now the API uses the entityKey helper property with Issues.