signalapp / Signal-Android

A private messenger for Android.
https://signal.org
GNU Affero General Public License v3.0
25.53k stars 6.12k forks source link

Notification to self: No audio when receiving notifications #9099

Closed andreas-amlabs closed 4 years ago

andreas-amlabs commented 4 years ago

Bug description

I use signal-cli to send messages to myself from e.g. Home Assistant. Up until recent release there has always been an audio notification. Currently there is no audio nor any icon upon received notifications

I also notice that the "conversation settings" for "notifications to self" only contains the color setting - otherwise empty

Steps to reproduce

Actual result: Describe here what happens after you run the steps above (i.e. the buggy behaviour) No audio notification No icon in icon bar

Expected result: Describe here what should happen after you run the steps above (i.e. what would be the correct behaviour) Audio and Icon notification just like any other contact

Screenshots

Device info

Device: Google Pixel 2 Android version: 10 Signal version: 4.47.7

Link to debug log

greyson-signal commented 4 years ago

We've never shown notifications for "note to self" messages -- i.e. messages sent to yourself. I don't know what version you were on previously, but it's been this way for at least 8 months or so? Ever since we introduced "note to self". At that same point, we also hid all other conversation settings in "note to self" because they weren't applicable (because you don't get notifications for messages there).

Perhaps you were previously sending to a number that somehow wasn't recognized as your own? Or perhaps your previous release was very old? I couldn't say. Either way, not having notifications in "note to self" is working as intended.

andreas-amlabs commented 4 years ago

Well I update the App frequently, so it should not have been that old. I update weekly in general

My setup, since several months, has been so that Home Assistant will monitor my cameras for motion and upon detection send me a notification via signal-cli. The notification was instant and had audio.

I use only one phone number, but I guess something could have gone upside down. Not likely though. May I ask for the reason behind not having audio and icon notifications for self messages ?

greyson-signal commented 4 years ago

Because you sent them. You don't need to be told you got a new message, because you already know :) I guess more specifically, we don't show notifications for messages that have been read, and if you sent it to yourself, then that means it was already read.

andreas-amlabs commented 4 years ago

Logical, I can accept that. But rendering my scenario useless. I sure wish you would reconsider and make such a notification optional. Anyways, thanks for the reponses

akuntsch commented 4 years ago

I would also like this feature. I use it in a similar way as @andreas-amlabs: signal-cli which is linked to my phone.

When I initially set this up (some months ago) there were definitely notifications shown on my phone when sending messages to myself from signal-cli.

Would be great if this could be an option in the settings or so.

andreas-amlabs commented 4 years ago

Thank you for confirming. Perhaps we should write something on the HA forum aswell, just to make a bunch of people report the same issue on the signal app

andreas-amlabs commented 4 years ago

@greyson-signal . No new comment reg. this? Apparently I am not the only one who had this behavior and kindly requests it to be put back. Regardless if that was a bug before

wizardofid commented 4 years ago

Just a suggestion: I'm using signal-cli for similar purposes. I wanted to keep things clearly separated. Maybe 'Note to self' wasn't available back then, too. Anyway, i registered signal-cli with my landline-number. Could be also an option in your scenario.

andreas-amlabs commented 4 years ago

Yeah, I have not had a land line since early 2001 - do not have a desire to start paying for that again

Neither can I use any of the US-free-number solution, mostly due to their ambiguous incoming call policies.

Neither can I get a new mobile number, since any number must be used at least once every 6 months

Not to mention how absurd the whole situation is - just re-add the feature / bug.

My worst scenario is that I have to use some proxy service (semi-free) and go back to whatsApp or such again - or write my own android-listen-to-a-socket-thingy, but that feels kind of error prone as my android vpn probably does 100 reconnects every day (I roam alot ... )

greyson-signal commented 4 years ago

@andreas-amlabs If you want to get a separate number that you don't have to pay for, you can grab one from Twilio using their free trial. You only need it during sign-up.

andreas-amlabs commented 4 years ago

Yeah, I wonder if they will be in business a year from now.

Anyways, this sha looks "interesting" 5a1464c0698e19419d13852c4c69d317b3250035 and could possibly explain why you and me are both correct. To test it I would need to update my Jenkins and my Android SDK - so not anytime soon (I have so many projects in the works)

Also, since your mind seems set, I will stop writing here. Take care and keep the features coming

christophschw commented 4 years ago

Any news on this? I recently encountered the same phenomena and I'm interested in possible workarounds. The only thing I'm wondering about is that on that time you wrote your post, my clients happily sent notifications. And I update my clients on a regular basis too.

Is this a signal-cli issue?

christophschw commented 4 years ago

This is indeed a signal-cli issue :tada: Going back to version 0.6.2 resolves the issue.

Could be this commit: https://github.com/AsamK/signal-cli/commit/24714454dd43fe2df8981d37c98bd5c4c1a69a45

andreas-amlabs commented 4 years ago

You are AWESOME ! Never crossed my mind to check the signal-cli, downgrading also worked for me

andreas-amlabs commented 4 years ago

FYI, driving me nuts ! signal-cli version

0.6.2 - Will get the audio feedback when testing manually and via force automation But automations will not signal without being forced (via developer gui) Noticed that received messages have different color as compared to 0.6.3

0.6.3 - No audio feedback (ever) But automations will signal ! (but wont process values properly e.g. data_template: message: Sensor {{ name }} have states('sensor.{{name}}_temperature') degrees Will send exactly that and not the expected "Sensor kitchen have 24 degrees"

0.6.5 No audio feedback Automations will not signal

All 3 versions work from command line, uses the exact same "config"-directory

I think I will setup a build of signal-cli and do some debugging - when I get some spare time

christophschw commented 4 years ago

The different colors in 0.6.2 and 0.6.3 are a result from the message handling, I guess: in .2 the message is sent "from another person" (left hand site of the chat), in .3 from you (right hand site). I think, that's the result of https://github.com/AsamK/signal-cli/commit/24714454dd43fe2df8981d37c98bd5c4c1a69a45 I guess, this triggers the notification since this is not a Signal-Android/-Desktop issue.

If you can work around your first issue in 0.6.3 (not receiving the actual values, but the variables), you could try building 0.6.3 from without the commit I mentioned. In my case, I built a bash script which resolves all variables and sends only the actual message to signal-cli, maybe you could do something similar.

Good luck!

andreas-amlabs commented 4 years ago

So for the sake of future reference, the issue starts with https://github.com/AsamK/signal-cli/commit/24714454dd43fe2df8981d37c98bd5c4c1a69a45

Revert https://github.com/AsamK/signal-cli/commit/24714454dd43fe2df8981d37c98bd5c4c1a69a45 on 0.6.5 resolves the issue reg. audio

I still have some issues left though, but they are likely specific to my env, eg. as of 0.6.5 the user "ha" can no longer send messages via signal-cli, but root can.

andreas-amlabs commented 4 years ago

Just to continue, copying .local/share/signal-cli/ from the user doing the initial registration to the HA user resolves the issue

andreas-amlabs commented 4 years ago

Also, to get HA working I had to remove signal_conf_path: from configuration.yaml or HA would not send messages at all i.e.

su ha /home/homeassistant/signal-cli-0.6.git/bin/signal-cli --config /home/homeassistant/signal-cli-0.6.git/config -u +1234 send -m "Test git HA" +1234 would not work in my env.

Guess signal-cli does a litte more than just wrapping the java library

Anyways

SoHappy! :)

l3ender commented 1 year ago

I added the same detail in the community feature request, but another use case for supporting notifications in NTS is sending delayed messages (eg reminders) to self. The messages are correctly delayed/sent but then received without any notification, making them a lot less effective.