What should "Clear"-ing a friend actually do? (Previously: "Clear"-ing a friend doesn't work( #1069
Replies: 11 comments
-
Debug logs didn't show anything that seemed relevant:
|
Beta Was this translation helpful? Give feedback.
-
Thanks - will try and sort in the next release. I should really have a test for this sort of thing. |
Beta Was this translation helpful? Give feedback.
-
Hah, yes. Looks like the clear button just publishes a If you don't have permissions on that particular topic, then it just.... does nothing. Should be a simple fix. |
Beta Was this translation helpful? Give feedback.
-
A complete tangent and I apologize, but does anyone on this thread have any context on the spammy
logcat message output? I've recently seen it in my own apps and was trying to find the source and meaning. Wondering if it was some google play library or something else.... |
Beta Was this translation helpful? Give feedback.
-
Can't say I do know. In my experience there's a lot of unexplained cruft in logcat, which doesn't help debugging things. Later versions of OT won't show the logcat output in the "Logs" section, but rather more application-specific logs. |
Beta Was this translation helpful? Give feedback.
-
Appreciate the response @growse and no worries! This log only started showing up in the logs of my app a few days ago at most which is why I thought it could be related to some sort of shared dependency/library being used in both apps. In my app logs, the log is output under my own app's package name which makes it harder to determine the source as the tag is just a vague |
Beta Was this translation helpful? Give feedback.
-
So... the fix works. It removes the friend dot. But then it comes back! I restarted my MQTT server, so I don't think the message is getting re-sent. Is there some app storage where the old dot is getting stored and re-added when the app restarts? |
Beta Was this translation helpful? Give feedback.
-
Your friend "comes back" because they published their position retained to the broker (MQTT server); restarting it doesn't do anything to clear that persistent message. You can either delete the broker's persistent database and then restart it (a bit overkill) or clear out the one friend's position. Assuming the friend has published to topic $ mosquitto_pub .... -t owntracks/friend/phone -n -r That sends a null retained payload to the topic, effectively clearing the entry. |
Beta Was this translation helpful? Give feedback.
-
This often catches people out with MQTT. You connect to a broker, and immediately there's a message! But why!? I think what's clear is that the behaviour of 'clear' in the app is not obvious. It's a very simple implementation: just forget about the cleared contact. But then the app also creates contacts when it receives messages from the endpoint, so if that contact has a retained message, then it will mysteriously re-appear. I'm torn between keeping the app behaviour as it is, which is simple but does surprising things, and something more complicated. One approach would be when clearing a contact, it stores the |
Beta Was this translation helpful? Give feedback.
-
Thanks for the info! It is a little un-intuitive, for sure. I think some extra documentation might be helpful. To be honest, it seems that clearing isn't all that useful as is. What if clearing via the app also sends a null retained message? Assuming you have the ACLs set up to allow it |
Beta Was this translation helpful? Give feedback.
-
Sending a null retained message is an interesting idea, but would have the side effect of clearing it for everyone. But maybe, if the ACLs are set up to allow it, that's ok...? After all, if you've got permissions, there's nothing stopping you sending with any other client. I suspect that most brokers might not be set up that way though, as being able to publish to a contact's topic means you could also publish anything you like (e.g. locations) to that topic. The other downside is that I don't believe the broker indicates whether or not a publish message failed because of no permissions or not, so feeding back to the user that they don't have the right permissions, and therefore a cleared contact might suddenly return would be hard. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to "clear" an extra friend dot on owntracks, but it won't disappear! In fact, it seems none of them will disappear except the one published from my own client.
Beta Was this translation helpful? Give feedback.
All reactions