After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 678901 - Avoid ESource::changed notification after extension load
Avoid ESource::changed notification after extension load
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
3.6.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
evolution[account-mgmt]
Depends on:
Blocks:
 
 
Reported: 2012-06-26 16:28 UTC by Milan Crha
Modified: 2015-06-11 10:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
eds patch (4.81 KB, patch)
2012-07-03 09:17 UTC, Milan Crha
needs-work Details | Review

Description Milan Crha 2012-06-26 16:28:20 UTC
I described this behaviour in bug #677635 comment #1

   I just start evolution, and it opens in IMAP folder with selected message
   which was selected when I closed evolution. I see in status bar
   "Retrieving list of folders for xxx". I do not touch anything and let
   it be. When this list of folder retrieval is done the message list is
   vanished, like I described above.

and I found out what is going on here, thus I'm breaking that bug into two separate issues.

  • #0 folder_tree_selection_changed_cb
    at em-folder-tree.c line 884
  • #1 g_closure_invoke
    from /lib64/libgobject-2.0.so.0
  • #2 ??
    from /lib64/libgobject-2.0.so.0
  • #3 g_signal_emit_valist
    from /lib64/libgobject-2.0.so.0
  • #4 g_signal_emit_by_name
    from /lib64/libgobject-2.0.so.0
  • #5 gtk_tree_view_row_deleted
    at gtktreeview.c line 9137
  • #6 g_closure_invoke
    from /lib64/libgobject-2.0.so.0
  • #7 ??
    from /lib64/libgobject-2.0.so.0
  • #8 g_signal_emit_valist
    from /lib64/libgobject-2.0.so.0
  • #9 g_signal_emit
    from /lib64/libgobject-2.0.so.0
  • #10 gtk_tree_store_remove
    at gtktreestore.c line 1231
  • #11 em_folder_tree_model_remove_folders
    at em-folder-tree-model.c line 1226
  • #12 em_folder_tree_model_remove_store
    at em-folder-tree-model.c line 1188
  • #13 mail_ui_session_source_changed_cb
    at e-mail-ui-session.c line 507
  • #14 g_cclosure_marshal_VOID__OBJECTv
    from /lib64/libgobject-2.0.so.0
  • #15 ??
    from /lib64/libgobject-2.0.so.0
  • #16 g_signal_emit_valist
    from /lib64/libgobject-2.0.so.0
  • #17 g_signal_emit
    from /lib64/libgobject-2.0.so.0
  • #18 source_registry_source_changed_idle_cb
    at e-source-registry.c line 436
  • #19 g_main_context_dispatch
    from /lib64/libglib-2.0.so.0
  • #20 ??
    from /lib64/libglib-2.0.so.0
  • #21 g_main_loop_run
    from /lib64/libglib-2.0.so.0
  • #22 gtk_main
    at gtkmain.c line 1161
  • #23 main
    at main.c line 674

Comment 1 Milan Crha 2012-06-26 16:31:00 UTC
As far as I can tell, the ESource had no reason to be changed at the first place, then this "remove & add" approach is really not the best one, but I understand that it's sometimes needed.
Comment 2 Matthew Barnes 2012-07-02 19:25:46 UTC
Note to self that CamelSettings obviates the need to remove & add.  We merely need to disconnect the service and let it reconnect with the current settings.
Comment 3 Milan Crha 2012-07-03 09:17:34 UTC
Created attachment 217915 [details] [review]
eds patch

for evolution-data-server;

OK, the problem is not about change itself, the problem is that the ESource didn't really change, it was only loaded, but it still notified about its fake change, which caused this misbehaviour. I filled a follow-up bug #679309 for real changes on client side savings. See example b) there why ESource change cannot invoke disconnect & connect pair.

Apart of fake notifications during ESource creation, not only during source_initable_init(), also ESourceExtension *loading* meant fake notifications, thus I added internal changed signal ignorer.

Note one thing, the ESource disables changed notifications by default, and e_source_new() enables them again. The counter part is if the ESource will be created with other than e_source_new() function, then it'll never notify about its changes. I do not expect anyone creating the ESource with other than this function, thus should be fine.
Comment 4 Milan Crha 2012-07-03 09:18:54 UTC
Created commit c982bab in eds master (3.5.4+)
Comment 5 Milan Crha 2012-07-09 08:49:32 UTC
It would be good to reopen the bug when you revert the commit.
http://git.gnome.org/browse/evolution-data-server/commit/?id=fed66405ec
Comment 6 Milan Crha 2012-07-09 11:21:25 UTC
I see you partly fixed (workarounded) this by commit
http://git.gnome.org/browse/evolution/commit/?id=09e374bfc606

I call this "partly", because it just hides those fake ESource::changed notifications from one (currently most visible)_ place. Does it make sense to adapt at least part of the patch, like loading an already added extension should not emit ESource::changed signal for sure.

For the "locked for changed signal on creation", I agree that was just a stupid idea of me, I had nothing better for it. Thinking of it now, will it be better to not lock the changed signal by default, but add a priv bool member "is_first_change_after_create", which will be set to true on start, and it will not notify about "changes" in an ESource on creation (used in source_idle_changed_cb)? The thing is that this creating notifications are done even after source_initable_init() call, thus its code for removing that changed notification from the source doesn't work. It's the code below comment /* Avoid a spurious "changed" emission. */.
Comment 7 Milan Crha 2012-07-25 17:18:05 UTC
This can also cause block of factories, in case the backend listens for ESource changes and it does some 'heavy' stuff on change, then as it's delivered in the main thread, then during processing the signal factory cannot reply to the GDBus calls, resulting in timeouts on client side. I got one such from CalDAV, I'm fixing it there, thought it'd be better to have it done on ESource side. I think.
Comment 8 Milan Crha 2015-06-11 10:06:45 UTC
Current evolution works better, but still unnecessarily notifies about ESource changes on extension load. I adapted the patch to current sources and simplified it significantly.

Created commit 727c084 in eds master (3.17.3+)
Created commit b1ab573 in eds gnome-3-16 (3.16.4+)