isamert / scli

a simple terminal user interface for signal messenger (using signal-cli)
GNU General Public License v3.0
432 stars 40 forks source link

urwid does not notify of signal-cli's DBus service start #221

Closed exquo closed 4 months ago

exquo commented 4 months ago
INFO:root:scli ?
DEBUG:root:callf: `['signal-cli', '-u', '+12345678910', '--output=json', 'daemon', '--dbus']`
DEBUG:urwid.event_loop.main_loop.MainLoop:Starting event loop 'SelectEventLoop' to manage display.
DEBUG:urwid.event_loop.select_loop.SelectEventLoop:Waiting for input: timeout=0.0
DEBUG:urwid.event_loop.select_loop.SelectEventLoop:No input in timeout, calling scheduled <bound method MainLoop.entering_idle of <urwid.event_loop.main_loop.MainLoop object at 0x7e20c2e354d0>>
DEBUG:urwid.event_loop.main_loop.MainLoop:Screen size recalculated: (281, 50)
DEBUG:urwid.display._posix_raw_display.Screen.draw_screen:Drawing screen with size (281, 50)
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.display._posix_raw_display.Screen:Undefined attribute: ''
DEBUG:urwid.event_loop.select_loop.SelectEventLoop:Processing input
DEBUG:urwid.event_loop.select_loop.SelectEventLoop:Waiting for input: timeout=0.0
DEBUG:urwid.event_loop.select_loop.SelectEventLoop:No input, entering IDLE
DEBUG:urwid.event_loop.select_loop.SelectEventLoop:Processing input
DEBUG:urwid.event_loop.select_loop.SelectEventLoop:Waiting for input: timeout
DEBUG:urwid.event_loop.select_loop.SelectEventLoop:Processing input
INFO:root:daemon_log: INFO  DaemonCommand - Starting daemon in single-account mode for +12345678910
DEBUG:urwid.event_loop.select_loop.SelectEventLoop:Waiting for input: timeout=0.0
DEBUG:urwid.event_loop.select_loop.SelectEventLoop:No input, entering IDLE
DEBUG:urwid.event_loop.select_loop.SelectEventLoop:Processing input
DEBUG:urwid.event_loop.select_loop.SelectEventLoop:Waiting for input: timeout

Originally posted by @0x09AF in https://github.com/isamert/scli/issues/220#issuecomment-1964398743

exquo commented 4 months ago

Can reproduce with urwid v2.6.x. No problem on v2.5.3 or earlier.

MareOfNights commented 4 months ago

I don't know, when this was added, but the watch_pipe function of the main_loop follows this schema:

watch_pipe(callback: Callable[[bytes], bool]) → int

If the callback function doesn't return True, it seems to be assumed false and the read end of the pipe gets closed. That's why you can see the first line being logged as normal, but nothing after that.

exquo commented 4 months ago

@MareOfNights thanks for the quick and insightful troubleshooting!

Here is the breaking commit: https://github.com/urwid/urwid/commit/1a5b18ca0b34876d6aa4937efca28751748d0f23#diff-350a967d4905ac920fdbd363bd511deffdfc3f52fe7920a384ad67ee8a13dd9b

I've asked about this upstream: https://github.com/urwid/urwid/issues/847. Let's see if they consider this a regression.