We are using the Google Homegraph API to implement REQUEST_SYNC functionality for our Google Home project. This has appeared te be working fine in our testing, but recently we noticed that roughly a third of requests are responded to with HTTP codes other than 200.
We have seen the following codes:
- 400 Bad Request
- 500 Internal Server Error
- 429 Too Many Requests
- 404 Not Found
429 is most likely due to some fault on our part, and we are currently looking into avoiding this. However, we are unable to determine what is causing the other codes.
In our limited ability to test, we have found that it appears to be limited to a specific user each time. Unlinking and re-linking our service seems to fix the issue (if only temporarily).
As a side note, the example here appears to contain invalid JSON, as there are quotation marks missing around agent_user_id. When testing a simple request, the omission or inclusion of the quotation marks didn't affect its success, but this may be confusing to readers.
Does anyone have advice to offer regarding these issues?
EDIT:
We are currently trying to reproduce the issues for an account by purposefully sending many REQUEST_SYNCs. This causes a number of 429 responses (and we've seen a single 500), but it has not yet caused future REQUEST_SYNCs to stop working entirely - previously we saw a user only ever receive 500 response codes until the service was relinked.
Unlinking a user did cause subsequent REQUEST_SYNCs to respond with 404, as expected. Is there a way to be notified when a user is no longer using our Google Home service so that we may stop sending them SYNC requests when they change something about their devices?