Don't try downloading empty avatar URL
One of my CmRoomMember
's got their avatar_url
set to an empty string. This did not stop libcmatrix/chatty from attempting to save it to disk anyway.
15:44:39.3936 cm-utils[ 4708]:CRITICAL: cm_utils_save_url_to_path_async: assertion 'uri && *uri' failed
Thread 1 "chatty" received signal SIGTRAP, Trace/breakpoint trap.
_g_log_abort (breakpoint=1) at ../src/chatty-log.c:57
57 }
(gdb) bt
#0 _g_log_abort (breakpoint=1) at ../src/chatty-log.c:57
#1 0x00005555555f5b37 in chatty_log_write
(log_level=10, log_domain=0x55555569b169 "cm-utils", log_message=0x7fff900189f0 "cm_utils_save_url_to_path_async: assertion 'uri && *uri' failed", fields=0x7fffffffcbd0, n_fields=4, user_data=0x0) at ../src/chatty-log.c:309
#2 0x00005555555f5c8c in chatty_log_handler
(log_level=G_LOG_LEVEL_CRITICAL, fields=0x7fffffffcbd0, n_fields=4, user_data=0x0) at ../src/chatty-log.c:342
#3 0x00007ffff7b44091 in g_log_structured_array (n_fields=4, fields=0x7fffffffcbd0, log_level=G_LOG_LEVEL_CRITICAL)
at ../../../glib/gmessages.c:1859
#4 g_log_structured_array (log_level=G_LOG_LEVEL_CRITICAL, fields=0x7fffffffcbd0, n_fields=4)
at ../../../glib/gmessages.c:1832
#5 0x00007ffff7b44582 in g_log_default_handler
(log_domain=log_domain@entry=0x55555569b169 "cm-utils", log_level=log_level@entry=10, message=message@entry=0x7fff900189f0 "cm_utils_save_url_to_path_async: assertion 'uri && *uri' failed", unused_data=unused_data@entry=0x0)
at ../../../glib/gmessages.c:3357
#6 0x00007ffff7b447f0 in g_logv
(log_domain=0x55555569b169 "cm-utils", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffcd20) at ../../../glib/gmessages.c:1246
#7 0x00007ffff7b44aa3 in g_log (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>)
at ../../../glib/gmessages.c:1315
#8 0x000055555565b916 in cm_utils_save_url_to_path_async
(client=0x55555710ecb0 [CmClient], uri=0x55555cb79150 "", file_path=0x5555594bc880 "/home/fortysixandtwo/.local/share/chatty/cmatrix/avatars/users/.", cancellable=0x0, progress_callback=0x0, progress_user_data=0x0, callback=0x5555556672fb <user_get_avatar_cb>, user_data=0x555557d6f810) at ../subprojects/libcmatrix/src/cm-utils.c:1404
#9 0x0000555555667ac5 in cm_user_get_avatar_async
(self=0x555557246f00 [CmRoomMember], cancellable=0x0, callback=0x55555561756e <ma_buddy_get_avatar_cb>, user_data=0x555559e53d60) at ../subprojects/libcmatrix/src/users/cm-user.c:443
#10 0x00005555556177cc in chatty_ma_buddy_get_avatar (item=0x555559e53d60 [ChattyMaBuddy])
at ../src/matrix/chatty-ma-buddy.c:143
#11 0x00005555555e5b8c in chatty_item_get_avatar (self=0x555559e53d60 [ChattyMaBuddy]) at ../src/users/chatty-item.c:524
#12 0x00005555555f6fb1 in avatar_changed_cb (self=0x55555d8d64a0 [ChattyAvatar]) at ../src/chatty-avatar.c:56
#15 0x00007ffff7c5e1ce in <emit signal '0x55555568dad9 "avatar-changed"' on instance 0x555559e53d60 [ChattyMaBuddy]>
(instance=0x555559e53d60, detailed_signal=0x55555568dad9 "avatar-changed") at ../../../gobject/gsignal.c:3624
#13 0x00007ffff7c42939 in _g_closure_invoke_va
(closure=0x555557ce1c30, return_value=0x0, instance=0x555559e53d60, args=0x7fffffffd218, n_params=0, param_types=0x0)
at ../../../gobject/gclosure.c:897
#14 0x00007ffff7c5833f in signal_emit_valist_unlocked
(instance=instance@entry=0x555559e53d60, signal_id=signal_id@entry=37, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd218) at ../../../gobject/gsignal.c:3424
#16 0x00005555556179f0 in ma_buddy_changed_cb (self=0x555559e53d60 [ChattyMaBuddy]) at ../src/matrix/chatty-ma-buddy.c:201
#21 0x00007ffff7c5dfc3 in <emit signal 'changed' on instance 0x555557246f00 [CmRoomMember]>
(instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../../../gobject/gsignal.c:3583
#17 0x00007ffff7c42730 in g_closure_invoke
(closure=0x555558df8d30, return_value=0x0, n_param_values=1, param_values=0x7fffffffd550, invocation_hint=0x7fffffffd4a0)
at ../../../gobject/gclosure.c:834
#18 0x00007ffff7c5687c in signal_emit_unlocked_R
(node=node@entry=0x7fffffffd600, detail=detail@entry=0, instance=instance@entry=0x555557246f00, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffd550) at ../../../gobject/gsignal.c:3888
#19 0x00007ffff7c58281 in signal_emit_valist_unlocked
(instance=instance@entry=0x555557246f00, signal_id=signal_id@entry=421, detail=detail@entry=0, var_args=var_args@entry=0x7fffffffd760) at ../../../gobject/gsignal.c:3520
#20 0x00007ffff7c5df06 in g_signal_emit_valist (instance=0x555557246f00, signal_id=421, detail=0, var_args=0x7fffffffd760)
at ../../../gobject/gsignal.c:3263
#22 0x00005555556671d9 in cm_user_set_details
(self=0x555557246f00 [CmRoomMember], display_name=0x7ffe7c02a2f0 "UnXXX", avatar_url=0x7ffe7c02a1a0 "") ### <--------------
at ../subprojects/libcmatrix/src/users/cm-user.c:252
#23 0x0000555555666e0c in cm_user_set_json_data (self=0x555557246f00 [CmRoomMember], root=0x7ffe7c029ee0)
at ../subprojects/libcmatrix/src/users/cm-user.c:170
#24 0x00005555556539db in cm_room_update_user (self=0x7ffedc5c2880 [CmRoom], event=0x555557edd280 [CmRoomEvent])
at ../subprojects/libcmatrix/src/cm-room.c:2713
#25 0x0000555555663524 in cm_room_event_list_parse_events
(self=0x7ffedc5c29c0 [CmRoomEventList], root=0x7ffe7c0288f0, events=0x0, past=0)
at ../subprojects/libcmatrix/src/events/cm-room-event-list.c:556
#26 0x000055555564d377 in cm_room_set_data (self=0x7ffedc5c2880 [CmRoom], object=0x7ffe7c01e200)
at ../subprojects/libcmatrix/src/cm-room.c:1146
#27 0x000055555562487f in handle_room_join (self=0x55555710ecb0 [CmClient], root=0x7ffe7c013af0)
at ../subprojects/libcmatrix/src/cm-client.c:2269
#28 0x0000555555624fa3 in handle_red_pill (self=0x55555710ecb0 [CmClient], root=0x7ffe7c006a20)
at ../subprojects/libcmatrix/src/cm-client.c:2402
#29 0x00005555556252bf in matrix_take_red_pill_cb
(obj=0x555557211940 [CmNet], result=0x555557590fa0, user_data=0x55555710ecb0)
at ../subprojects/libcmatrix/src/cm-client.c:2444
--Type <RET> for more, q to quit, c to continue without paging--c
#30 0x00007ffff7d44733 in g_task_return_now (task=task@entry=0x555557590fa0 [GTask]) at ../../../gio/gtask.c:1361
#31 0x00007ffff7d4476d in complete_in_idle_cb (task=0x555557590fa0) at ../../../gio/gtask.c:1375
#32 0x00007ffff7b39e2f in g_main_dispatch (context=context@entry=0x55555573bd20) at ../../../glib/gmain.c:3344
#33 0x00007ffff7b3beb7 in g_main_context_dispatch_unlocked (context=0x55555573bd20) at ../../../glib/gmain.c:4152
#34 g_main_context_iterate_unlocked
(context=context@entry=0x55555573bd20, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
at ../../../glib/gmain.c:4217
#35 0x00007ffff7b3c4d0 in g_main_context_iteration (context=context@entry=0x55555573bd20, may_block=may_block@entry=1)
at ../../../glib/gmain.c:4282
#36 0x00007ffff7d7450d in g_application_run (application=0x55555573a290 [ChattyApplication], argc=2, argv=<optimized out>)
at ../../../gio/gapplication.c:2712
#37 0x00005555555930fa in main (argc=2, argv=0x7fffffffdef8) at ../src/main.c:37
(gdb) frame 23
#23 0x0000555555666e0c in cm_user_set_json_data (self=0x555557246f00 [CmRoomMember], root=0x7ffe7c029ee0)
at ../subprojects/libcmatrix/src/users/cm-user.c:170
170 cm_user_set_details (self, name, avatar_url);
(gdb) info locals
name = 0x7ffe7c02a2f0 "UnXXX"
avatar_url = 0x7ffe7c02a1a0 ""
child = 0x7ffe7c02a020
__func__ = "cm_user_set_json_data"
(gdb) l
165 name = cm_utils_json_object_get_string (child, "display_name");
166 if (!name)
167 name = cm_utils_json_object_get_string (child, "displayname");
168
169 avatar_url = cm_utils_json_object_get_string (child, "avatar_url");
170 cm_user_set_details (self, name, avatar_url);
171 }
172
173 void
174 cm_user_set_client (CmUser *self,
(gdb) p (char*)cm_utils_json_object_to_string (root, 1)
[Thread 0x7fff674006c0 (LWP 68023) exited]
[Thread 0x7fff660006c0 (LWP 68022) exited]
$3 = 0x55555d7e6e20 "{
"content" : {
"avatar_url" : "",
"displayname" : "UndXXX",
"membership" : "join"
},
"origin_server_ts" : 1708553974941,
"sender" : "@undXXX:XXXls",
"state_key" : "@undXXX:XXXls",
"type" : "m.room.member",
"unsigned" : {
"replaces_state" : "$p0ua_zW7mTRqvbD6cG7BCZnx3mCbPYnUt-KQhzxbZpg"
},
"event_id" : "$8Wj_IIfu9rG8gIrq1UWZPm5EGvTeL9ZGLW497jGLyow"
}"