Sync request cache serves invalid responses
The sync endpoint caches the response for multiple requests from the same device, and only allows one request to run concurrently for a given device. This cache is keyed off the user id, device id, and the since parameter of the request body.
The request body has several other parameters that influence the response and database state-changes. full_state affects the response, set_presence affects the database state-change, and filter affects both. Because the cache does not take these parameters into account, requests that should have different responses are treated interchangeably, and requests that should have side effects are skipped.
I haven't tracked down the user-visible effect of this set of bugs yet. While working on the filter implementation, it's been very obvious because I will change the filter parameters and get the same response until I restart the server. I will probably end up fixing this, at least for the filter parameter, as part of the filtering implementation.