GNOME Bugzilla – Bug 678901
Avoid ESource::changed notification after extension load
Last modified: 2015-06-11 10:06:45 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.
+ Trace 230439
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.
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.
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.
Created commit c982bab in eds master (3.5.4+)
It would be good to reopen the bug when you revert the commit. http://git.gnome.org/browse/evolution-data-server/commit/?id=fed66405ec
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. */.
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.
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+)