Closed taimon closed 1 year ago
Thanks for reporting this!
I think your diagnosis is spot on! Looks like a race condition indeed.
I'll look into postponing the processing of incoming messages until the contacts map is filled.
(signal-cli's --receive-mode
option should have been useful here, but it seems it's only relevant to the JSON-RPC mode..)
Thanks for the fix and maintaining scli in general!
Ever since the change from #202, messages are sometimes discarded when scli starts and signal-cli fetches the newest messages. scli logs the message, the 'source' matches one of the contacts, so it should not have been dropped with the "Message from unknown contact" error.
I assume this is a race condition, because due to recent changes, scli now needs to fetch contacts via dbus, which can take a while. In the meantime, signal-cli could have already received the messages and put them in the pipe. scli does not have a valid contacts map yet, so it will error out.
I haven't debugged this fully yet and I'm not sure if all my assumptions of how things work are correct.
Not sure yet how to properly fix this. signal-cli has a parameter --receive-mode for the daemon command that could be used to defer reception of messages until after contacts are initialized. (Manual mode)