1. 06 Apr, 2018 1 commit
  2. 25 Mar, 2018 1 commit
  3. 18 Mar, 2018 3 commits
  4. 16 Mar, 2018 1 commit
  5. 15 Mar, 2018 1 commit
  6. 12 Mar, 2018 1 commit
  7. 11 Mar, 2018 1 commit
  8. 06 Mar, 2018 1 commit
  9. 05 Mar, 2018 4 commits
  10. 04 Mar, 2018 2 commits
    • Michael Gratton's avatar
      Don't let a task try to re-open a folder while it is being closed. · 675d7d3a
      Michael Gratton authored
      Really (for sure this time) ensure folder opening/closing is not racy by
      using the same mutex to guard the complete opening and closing processes.
      
      * src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
        Rename open_mutex to remote_mutex since it's only actually used when
        opening a remote session. Rename close_mutex to lifecycle_mutex and
        ensure that has always been claimed when manipulating the
        open_count. In particular, ensure that all of open_async is executed
        under that mutex and ensure that both decrementing the close count, and
        the complete actual closing process is always protected by it as well.
      675d7d3a
    • Michael Gratton's avatar
      Make ConversationMonitor more robust with no/changing connectivity. · cf86d07b
      Michael Gratton authored
      Conversation monitor was built around older assumptions of how a folder's
      remote connections work - that once a folder opens it will likely also
      eventually establish a remote connection, that once the connection is up
      it will hang around, and so on.
      
      This patch removes any public notion of (re)seeding, since it can't be
      relied to actually happen over the course of the session, ensures that
      all folder operations are local-only when the folder does not have a
      working remote connection so it doesn't block, and take the opportunity
      to reorganise and clean up the monitor API and documentation comments.
      
      * src/engine/app/app-conversation-monitor.vala (ConversationMonitor):
        Remove seed signals, and don't bother running an initial reseed if the
        folder is already open, since the fill operation will cause any locally
        incomplete messages to be filled out from the report. Manage and use an
        internal Cancellable for cancelling internal operations when shutting
        down. Construct a queue only when starting to monitor conversations,
        delete it when stopping. Move as much operation-specific code into the
        operations themselves as reasonably possible, making some methods
        internal so thy can be accessed from the ops. Ensure all folder listing
        operations specify LOCAL_ONLY when the remote is not open. Removed
        LocalLoadOperation since that is now redundant. Update the API for
        accessing conversations to match Gee conventions and update call
        sites. Update documentation comments. Hook back up to locally-complete
        signals so we don't miss emails being filled out by the prefetcher, for
        now.
      
      * src/engine/app/conversation-monitor/app-conversation-set.vala
        (ConversationSet): Rename conversations property to match Gee
        conventions, update call sites.
      
      * src/engine/app/conversation-monitor/app-conversation-operation.vala
        (ConversationOperation): Allow operations to specify if they should
        allow duplicates, and allow the execution method to throw errors, so
        they can be handled in a uniform way.
      
      * src/engine/app/conversation-monitor/app-conversation-operation-queue.vala
        (ConversationOperationQueue): Accept progress monitor property as a
        ctor arg rather than constructing on itself, so it is tied to the
        life-cycle of the ConversationMonitor rather than the queue. Add a
        signal for notifying of errors thrown when running operations, and use
        the new operation-independent support for determining if duplicates
        should be queued.
      
      * src/engine/app/conversation-monitor/app-fill-window-operation.vala
        (FillWindowOperation): Enforce a maximum window size as well as minimum
        to keep loading large windows semi-responsive. Remove code to handle
        inserts now that they are handled by their own op.
      
      * src/engine/app/conversation-monitor/app-insert-operation.vala
        (InsertOperation): New operation to manage inserts, handle it them by
        simply adding them to the conversation if they are newer than the
        oldest message, rather that relisting all loaded messages.
      cf86d07b
  11. 03 Mar, 2018 5 commits
    • Michael Gratton's avatar
      Improve IMAP client session pool management. · 39448842
      Michael Gratton authored
      Close released client sessions when there are too many, and try harder to
      not give out bad sessions when one is being claimed.
      
      * src/engine/imap/transport/imap-client-session-manager.vala
        (ClientSessionManager): Add a maximum free session tunable and release
        any client sessions returned if it would otherwise exceed this
        threshold. When claiming a session, ensure that an older session is
        still good by sending a NOOP before returning it.
      39448842
    • Michael Gratton's avatar
      Ensure account synchroniser re-uses client sessions properly. · 3f0b8c98
      Michael Gratton authored
      This ensures that when an account synchroniser account op completes and
      its folder is closing completely, that it waits for this to complete
      fully. Thus when the next op executes, it can re-use the same client
      session.
      
      This, along with recent other recent changes on the branch, gets the
      total client session count on app start down to 2 simultaneous
      connections only, instead of 3 or 4.
      
      * src/engine/imap-engine/imap-engine-account-synchronizer.vala
        (RefreshFolderSync): If closing the folder causes it to be completely
        closed, wait for that to happen so the session is released to the pool
        before the next op runs.
      
      * src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
        Make close_remote_session async so it can wait for the session to be
        fully released, including returning the session to the pool. Update
        call sites.
      
      * src/engine/imap-engine/imap-engine-generic-account.vala
        (GenericAccount): Make release_folder_session async so that
        MinimalFolder can wait for it to be fully released, including returning
        the session from Selected state. Update call sites.
      3f0b8c98
    • Michael Gratton's avatar
      Tidy up IMAP folder session management. · 9070380f
      Michael Gratton authored
      * src/engine/imap-engine/imap-engine-generic-account.vala
        (GenericAccount): Don't attempt to claim two client sessions when
        opening a folder, rather claim one and use as both an account session
        and a folder session. Rename open_folder_session to
        claim_folder_session to be consistent with account session API, update
        call sites.
      
      * src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
        Ensure the remote session is automatically re-established if
        appropriate on disconnect. Tidy up debug output and some comments.
      9070380f
    • Michael Gratton's avatar
      Remove GenericAccount's IMAP account session attribute. · 9cedfaf0
      Michael Gratton authored
      For most of the time, GenericAccount does not need an open client
      session, yet it always claims one from the pool on open and hangs on to
      it. This means that the account synchroniser for example cannot use the
      same session to perform sync, requiring an additional session to be
      opened.
      
      This patch removes the held session with methods to claim and release
      account sessions instances for those code paths that need it, allowing
      the previously claimed session to be re-used when not in use.
      
      * src/engine/imap-engine/imap-engine-generic-account.vala
        (GenericAccount): Remove remote_open_lock and remote_session, just
        claim new client sessions from the pool as needed instead. Add
        release_account_session to allow claimed sessions to be returned to the
        pool. Update uses of remote_session to claim and release instead.
      
      * src/engine/imap/transport/imap-client-session-manager.vala
        (ClientSessionManager): Update ready signal to include a parameter
        indicating if ready or not, so GenericAccount can still block
        claim_account_session callers when not ready. Rework all code that sets
        is_ready to use a common notify method that both does that and fires
        the signal, and rework all code paths that stop the pool to use a
        common code path that uniformly resets timers, notifies no longer
        ready, and drops all client sessions.
      
      * src/engine/imap/api/imap-account-session.vala: Remove distinction
        between fetch_folder_async and fetch_folder_cached_async
        since account session objects are now short-lived.
      9cedfaf0
    • Michael Gratton's avatar
      Improve doc comments for Email, Folder and RFC822.Message. · e78313df
      Michael Gratton authored
      fixup and reword 79b9bbe
      e78313df
  12. 01 Mar, 2018 1 commit
  13. 26 Feb, 2018 9 commits
  14. 22 Feb, 2018 1 commit
  15. 21 Feb, 2018 1 commit
  16. 18 Feb, 2018 2 commits
  17. 13 Feb, 2018 3 commits
  18. 10 Feb, 2018 2 commits