This will end up with a core dump:
W: luakit: luaH_dofunction:104: error while running function
[C]: in function 'save_file'
./lib/downloads.lua:140: in function 'add'
./lib/downloads.lua:234: in function <./lib/downloads.lua:233>
error: ./lib/downloads.lua:140: trying to emit signal on non-object
** (luakit:5629): CRITICAL **: SoupMessage* webkit_network_response_get_message(WebKitNetworkResponse*): assertion `WEBKIT_IS_NETWORK_RESPONSE(response)' failed
GLib:ERROR:gmain.c:2518:g_main_dispatch: assertion failed: (current->dispatching_sources == ¤t_source_link)
 5629 abort (core dumped) ./luakit
I can attach the code dump file if needed.
I confirm that, especially it hits you hard when your ISP channel is unstable, and you have to wait and guess each time you follow a download link: will start the download ever or not?
And if you occasionally get two «Save it as…» dialogs all your tabs and links just go away as luakit segfaults.
The problem may be addressed to getting either a queue of pending «Save as…» tasks if any runs for completion already or investigating GTK for a way to spawn several separately signal-able window wigdets like this dialog is.
Then, if queue selected, the part of the code which waits for the dialog to complete (yes, I guess there is luaH_luakit_save_file using GTK methods to reuse GTK tools) may act in a fork:
• (queuer) if there is a dialog spawned already, add current new target to save into the queue of pending «saves»;
• (worker) if there's no yet save dialogs, trig «dialog is spawned» marker (to true), then proceed with the dialog spawning, wait for it to complete, then run in a cycle while the queue is not empty, end loop, trig «dialog is spawned» marker (to false).
Any more ideas?