-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP message does not always include topic #558
Comments
So topic in HTTP json payload was introduced in commits: One thing I was thinking it might be, and this is just a hunch, that there are messages queued for delivery before the HTTP endpoint is configured, and that pressing the report button sends the old messages that do not contain the topic key. |
If the queued messages are not acknowledged by HTTP 200, then they will not be deleted from the fifo queue. To clear the queue re-install the app or change your connection settings back and forth |
So am I interpreting it correctly that some old messages without topic might end up in the queue before a user configures the HTTP endpoint? I did change it now to discard them by returning 200 but I wonder if we should ever deliver messages without topic to the HTTP endpoint. |
I don't know what caused the backend to return a non-200 response. The only example I see is the case when you decide to encrypt the data by the owntracks application: |
Well the Home Assistant server returned a 400 because it was expecting a topic in the message. This has been fixed now and we return a 200 to discard it (source). Interesting note about the encryption. I did not think about that. With Android we always get the user and device as headers (if they are configured). I guess we might not handle encrypted iOS payloads correctly, going to test that and will report back. |
@balloob please be aware that our Android app also has optional encryption just like on iOS. |
In Android you can also just pass the username and device as URL parameters ;) |
Alright, did some testing:
Still working on getting someone to test the iOS payloads to see if it's the encrypted message that breaks it. |
Okay, case solved, thanks all ! |
@balloob if you feel very brave, would you like to provide a small PR for our Booklet? https://github.com/owntracks/booklet/tree/master/docs |
Sure! owntracks/booklet#37 |
Thank you very much! |
We've just discussed this, and we will implement the headers in iOS as well. Reopening. |
Implementation tracked in #560 |
Release notes for 9.5.7 states:
With Home Assistant we're relying on this value and somehow we noticed that this topic is not always available. For some people it is, for some people not. Some people think it's related to setting tracker ID but we're still investigating.
I tried to look in the code but my objective-c is not good enough to figure it out where the dictionary is being created.
The text was updated successfully, but these errors were encountered: