ostrya/PresencePublisher

Phone sends mqtt although not connected to configured wifi

Closed this issue · 2 comments

Hi there!

I just noticed that my home automation receives the phone's messages although I'm connected to a hotel wifi. Since I use a VPN that is to be expected on a network level, but isn't PP supposed to only send when connected to the configured wifi?

Switch "send without Wifi" is off.
Location access is granted.
Condition log says "Wifi connected: hotel wifi".
conditionContent is empty though.

Anything else that might help?

:wq

Hi, and sorry for the issue. Initially, I thought it may be related to the detection issues in #70, but after looking at the code, I think I see the issue. It seems like you uncovered a bug that has been around since the message content refactoring three years ago. If you either select a format other than PLAINTEXT or select at least one more message content other than conditionContent, the code will still send a message. I missed that because I only tested the plaintext functionality. I will fix this as soon as possible,

Hey, kudos for identifying the offending code so quickly. For me it's not a big deal since I'm on VPN anyway when not at home. But sending traffic to a local IP when connected to another network might also be a bad idea. :-D
Thank you for reacting so fast and for maintaining this useful app!