Commit graph

3265 commits

Author SHA1 Message Date
Michael James Gratton
a24de61242 Turn down default debug logging from the account synchroniser a bit.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala
  (AccountSynchronizer): Log periodic aspects of the account synchroniser
  as PERIODIC.

* src/engine/imap-engine/imap-engine-minimal-folder.vala
  (MinimalFolder::find_earliest_email_async): Remove two debug calls that
  were getting triggered for every sync pass. These should be in the
  synchroniser instead.
2017-11-21 10:42:25 +11:00
Michael James Gratton
7ad941be8e Try harder to ensure Geary always shuts down cleanly.
* src/engine/imap-engine/imap-engine-generic-account.vala
  (GenericAccount): When closing, wait for each folder to close before
  shutting down the local and remote connections.

* src/client/application/geary-controller.vala
  (GearyController::close_async): Close both inboxes and accounts in
  parallel. Don't wait for conversation monitor or inboxes to close
  before closing the account now that the accound does so. The account
  needs to start closing so that the background synchroniser stops, and
  that needs to stop before any open folder will close. Otherwise if the
  background synchroniser is currently synchronising an inbox or any open
  folder, then the account will not close until the synchroniser
  finishes, which could block for a long time.

* src/engine/api/geary-abstract-local-folder.vala (Folder),
  src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
  Notify the close semaphore in the classes' ctors so that if they are
  never opened, calling wait_for_close_async() does not block.
2017-11-21 10:42:25 +11:00
Michael James Gratton
01259104e1 Actually fire Geary.Account::closed signal when closing accounts. 2017-11-21 10:42:25 +11:00
Michael James Gratton
ae5f6a4d31 Document and tweak IMAP keep-alive periods and TCP socket timeouts. 2017-11-21 10:42:25 +11:00
Michael James Gratton
5906b4618f Fix critical warning when deleting an account.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala
  (AccountSynchronizer): Don't try to disconnect from account signals in
  dtor, the instance may already be gone.
2017-11-21 10:42:25 +11:00
Michael James Gratton
69a4e631c1 Minor fix and code cleanup for Geary.Imap.Account.
* src/engine/imap/api/imap-account.vala (Account): Replace camel case
  methods names with underscores per style guide, fix sense of
  is_no_select test in fetch_folder_cached_async() to account for the
  double nagative, and clean up the resulting if/else clause a bit.
2017-11-21 10:42:25 +11:00
Daniel Mustieles
d8d4af7eda Update Spanish translation 2017-11-20 15:50:26 +00:00
Marek Cernocky
e050ecbfd1 Updated Czech translation 2017-11-20 07:55:37 +01:00
Emin Tufan Çetin
14e415bef2 Update Turkish translation 2017-11-20 06:38:53 +00:00
Piotr Drąg
dde4fd2210 Update Polish translation 2017-11-19 20:05:39 +01:00
Michael James Gratton
412549a3f7 Don't try to install the contractor file if disabled. Bug 790382.
Patch courtesy Jiri Cerny.
2017-11-19 21:55:03 +11:00
Michael James Gratton
a46feb24af Fix namespace error listing "[GMail]" mailbox. Bug 790544.
Thanks to Torben for bug report and inital patch.

* src/engine/imap/transport/imap-client-session.vala
  (ImapClientSession::get_delimiter_for_path): If the folder root does
  not exist as a namespace, look for an empty namespace, then default to
  the personal namespace.
2017-11-19 21:49:45 +11:00
Michael James Gratton
d1d8d6411e Merge branch 'wip/713006-better-error-reporting'. Fixes Bug 713006. 2017-11-19 18:35:06 +11:00
Michael James Gratton
8c2a4fc2a5 Add licensing info for libunwind binding, based on convention. 2017-11-19 12:07:14 +11:00
Mario Blättermann
a226d0cebf Update German translation 2017-11-18 20:06:55 +00:00
Frank Brütting
0a52791685 Update German translation 2017-11-18 19:25:34 +00:00
Marek Cernocky
6939894d2e Updated Czech translation 2017-11-18 19:17:35 +01:00
Michael James Gratton
e0ba2716ec Minor code cleanup. 2017-11-18 15:25:51 +11:00
Michael James Gratton
bcca75f5a8 Include a back trace in problem report technical details.
This adds a dependcy on libunwind for generating the back trace.

* src/CMakeLists.txt: Require libunwind-generic package and libunwind
  VAPI. Update docs and debian/control with new dependencies.

* src/engine/api/geary-problem-report.vala (ProblemReport): Generate a
  stack trace in the default constructor if an error is specified.

* src/client/components/main-window-info-bar.vala
  (MainWindowInfoBar::format_details): Include stack trafe from problem
  report in output if present.

* ui/main-window-info-bar.ui: Add a ScrolledWindow around the TextView
  since the details could now be quite large.

* bindings/vapi/libunwind.vapi: Add bindings for libunwind courtesy
  Guillaume Poirier-Morency, add Error enum.
2017-11-18 15:25:28 +11:00
Michael James Gratton
6182f466f5 Delay checking network connectivity if already connected. Bug 776042.
* src/engine/util/util-connectivity-manager.vala: Add both a next-check
  time and a delayed check timer so that if we are already connected and
  a check ran recently, re can avoid running one again for a little while.
2017-11-17 13:18:32 +11:00
Michael James Gratton
1d746e43c7 Fix sketchy line breaking in quoted plain text.
* src/engine/util/util-html.vala (smart_escape): Use "white-space:
  pre-wrap" for preserving whitespace to get decent work breaks.
2017-11-16 18:04:18 +11:00
Michael James Gratton
c2afe8fe48 Fix lost line breaks when selective quoting plain text. Bug 781178.
* src/engine/rfc822/rfc822-utils.vala (quote_body): Smart escape quoted
  part, preserving whitespace if source message is plain text. Throw
  exceptions rather that catching them to clean the code paths up a
  bit. Update call sites.
2017-11-16 18:01:43 +11:00
Michael James Gratton
261e8a4ba3 Prevent composer body/sig/quote parts from losing focus. Bug 779369.
* ui/composer-web-view.js: Add a click handler for the document that
  prevents clicks outside the body parts from being processed.
2017-11-16 15:49:51 +11:00
Michael James Gratton
343bb640e9 Fix composer body text caret not being visible on reply. Bug 788797.
* src/client/composer/composer-widget.vala (ComposerWidget::set_focus):
  Ensure we grab the web view's focus only after its content has finished
  loading.
2017-11-16 12:49:49 +11:00
Michael James Gratton
f1e92feae2 Allow determining when JS has finished loading in ClientWebView.
* src/client/components/client-web-view.vala (ClientWebView): Add
  is_content_loaded property and content_loaded signal, update and fire
  when getting a contentLoaded message from the WebProcess.

* ui/client-web-view.js: Fire the contentLoaded message when loading is
  complete. Add ClientPageStateTest test case to ensure it is working
  fine.

* test/client/components/client-web-view-test-case.vala
  (ClientWebViewTestCase::load_body_fixture): Use is_content_loaded
  rather than is_loading as the test for loading having finished, since
  we're actually interested in when the JS has finished loaded, not the
  resources.
2017-11-16 12:44:57 +11:00
Michael James Gratton
7ad97fb5d9 Handle font-family strings containing both single and double quotes.
Fixes a failing unit test with WebKitGTK 2.18.

* ui/composer-web-view.js (EditContext::init): Check for and strip both "
  and ' from start and end of font-family string.
2017-11-16 10:48:42 +11:00
Michael James Gratton
ccabe6ed6c Update testcase to fix failure introduced by commit da15ebe. 2017-11-16 10:37:29 +11:00
Michael James Gratton
81869a535d Don't use overwrite_confirmation with FileChooserNative, it's not supported. 2017-11-16 10:18:02 +11:00
Michael James Gratton
46d8462aaf Fix mistaken commit in flatpak-builder manifest from commit da15ebe. 2017-11-14 14:54:54 +11:00
Michael James Gratton
da15ebe3c0 Fix gnome-shell notifications missing an icon under flatpak. Bug 790103.
* icons: Rename application icons to match fully-qualified app name. Update
  references to the olde name with the fully-qualified app name.
2017-11-14 14:38:57 +11:00
Gautier Pelloux-Prayer
9727d41bfc Show notification when receiving new fails in INBOX subfolders as well. Bug 713227 2017-11-14 11:30:49 +11:00
Michael James Gratton
0d1efc2fe0 Use the ConnectivityManager to detect connection problems up front.
* src/engine/util/util-connectivity-manager.vala (ConnectivityManager):
  Work with a NetworkAddress rather than an Endpoint to simplify a
  bit. Use trillian for is-reachable property, since that's more
  realistic Add new is-valid property and address_error_reported signal,
  update and fire these when the reachability check reports an error
  rather than just not reachable. Don't treat transient DNS errors as an
  error, however. Update call sites.

* src/engine/imap-db/outbox/smtp-outbox-folder.vala (SmtpOutboxFolder),
  src/engine/imap/transport/imap-client-session-manager.vala
  (ClientSessionManager): Look up to new address_error_reported signal
  and clean up then report the problem when it is fired.
2017-11-14 00:46:52 +11:00
Michael James Gratton
36092d4a9c Add doc comments for Geary.SmtpError. 2017-11-14 00:37:43 +11:00
Michael James Gratton
5520c10219 Allow passing addtional information when reporting engine errors.
* src/engine/api/geary-problem-report.vala: New problem enum,
  ProblemReport class and AccountProblemReport and ServiceProblemReport
  subclasses that encapsulate error, account and service information when
  reporting problems.

* src/engine/api/geary-account.vala (Account): Remove old Problem enum,
  make report_problem signal and related notify methods accept a
  ProblemReport instance instead. Reorganise protected methods a bit and
  update subclasses and signal handlers.

* src/client/components/main-window-info-bar.vala (MainWindowInfoBar):
  Substantially rework to handle ProblemReport instances via
  for_problem() constructor.

* src/engine/imap-db/outbox/smtp-outbox-folder.vala (SmtpOutboxFolder):
  Substantially rework error handling yet again to get some better
  ProblemReport instances being generated.
2017-11-14 00:37:43 +11:00
Michael James Gratton
733def6634 Report IMAP connection errors, don't endlessly retry to connect.
* src/engine/imap/transport/imap-client-session-manager.vala
  (ClientSessionManager): Add new connection_failed signal, remove the
  retry timer and simply report a connection error via the new signal.

* src/engine/imap/api/imap-account.vala (Account): Listen to new signal,
  send a problem report through when a connection error occurs.
2017-11-13 10:35:40 +11:00
Michael James Gratton
9733210642 Implement retry for send and receive errors.
* src/client/application/geary-controller.vala (GearyController): Make
  on_report_problem a proper method so it can be called internally, add a
  trivial handler shim for compat.
  (GearyController::on_retry_problem): Restart SMTP and IMAP clients when
  requested.

* src/engine/api/geary-account.vala (Account): Add
  start_incoming_client() and start_outgoing_client() methods to allow
  clients to be restarted. Implement in subclasses.

* src/engine/imap-db/outbox/smtp-outbox-folder.vala
  (SmtpOutboxFolder::start_postman_async): Make public so it can be
  called from GenericAccount.
2017-11-12 22:22:19 +11:00
Michael James Gratton
5382752fb8 Clean up SmtpOutboxFolder error handling further.
* src/engine/api/geary-account.vala (Account.Problem): Remove
  SEND_EMAIL_DELIVERY_FAILURE, we can't really and don't want to
  distinguish between and general sending failures. Remove uses.

* src/engine/imap-db/outbox/smtp-outbox-folder.vala (SmtpOutboxFolder):
  Use new global auth retry constant.
  (SmtpOutboxFolder::postman_send): Always throw auth error when we hit
  max attempts, always throw non-TLS errors so we don't keep on blindly
  retrying.
2017-11-12 22:20:27 +11:00
Michael James Gratton
c27ad28651 Handle incoming connection failures in the same way as for outgoing.
* src/client/application/geary-controller.vala
  (GearyController::report_problem): Replace connection failure dialog
  with use of an info bar.

* src/client/components/main-window-info-bar.vala (MainWindowInfoBar):
  Add new infobar type for incoming mail errors.

* src/engine/api/geary-account.vala (Account.Problem): Rename
  CONNECTION_FAILURE to RECV_EMAIL_ERROR to be consistent with
  SEND_EMAIL_ERROR, update uses.
2017-11-12 22:20:27 +11:00
Michael James Gratton
7310e09c78 Push IMAP auth handling down the stack, try 3 times before bailing out.
* src/engine/api/geary-account.vala (Account): Add internal constant for
  maximum number of authentication attempts.

* src/engine/imap-engine/imap-engine-generic-account.vala (Account):
  Move auth-related code to Imap.Account.

* src/engine/imap/api/imap-account.vala (Account): Keep track of the
  number of auth failures and bail out when the max has been
  reached. Manually notify the ClientSessionManager when the user has
  updated their creds so it only restarts as a response to user input.

* src/engine/imap/transport/imap-client-session-manager.vala
  (ClientSessionManager): Don't keep track of imap credentials changing,
  add new credentials_updated() method to allow Imap.Account
  notify when they have changed instead.
2017-11-12 22:20:27 +11:00
Michael James Gratton
403a99f768 Make account-related implementation debugging ids a bit more consistent. 2017-11-12 22:18:51 +11:00
Michael James Gratton
80680f280e Add initial support for using Gtk.InfoBars to display errors.
* src/client/components/main-window-info-bar.vala (MainWindowInfoBar):
  New class and UI file for displaying an info bar in the main window, as
  well as providing a way to show technical informartion if needed.

* src/client/components/main-window.vala (MainWindow): Add a Gtk.Frame
  and container to hold inforbar instances. Show it when showing an
  infobar, and hide it when there are none. Add show_infobar() method to
  provide a cromulent way of adding info bars.

* src/client/application/geary-controller.vala (BaseObject): Rather than
  bailing out on an account when an error occurs, display an info bar
  instead.

* ui/geary.css: Style the info bar frame to only show a border between
  main content and the info bars.
2017-11-12 22:18:51 +11:00
Michael James Gratton
fddf609a97 Merge branch 'wip/789924-network-transition'. Fixes Bug 789924. 2017-11-12 22:16:45 +11:00
Michael James Gratton
304fa9dcc2 Add a IMAP pool stop timeout as well as a start to help prevent flapping.
* src/engine/imap/transport/imap-client-session-manager.vala
  (ClientSessionManager): Increase the start timeout and add a stop
  timeout to suppress connection flapping when e.g. the system is
  connecting to a network.
2017-11-12 22:10:11 +11:00
Michael James Gratton
f273058c2a Rely on the ready signal to re-open folder IMAP connections, not a timer.
* src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
  Remove the reestablishment timer and code to automatically reestablish
  the remote connection when it is closed. Add a class doc comment.
2017-11-12 22:08:09 +11:00
Michael James Gratton
ef258064ac Trigger account synchronizer when account becomes ready.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala
  (AccountSynchronizer): Trigger synchronizer when the account becomes
  ready, not when it opens. Ensure when synchronizer halts when a remote
  error is encountered, so when going off-line it doesn't attempt to
  continue.

* src/engine/imap-engine/imap-engine-generic-account.vala
  (GenericAccount): Make Tie AccountSynchronizer a property to tie its
  lifecycle that of its account. Stop the synchronizer when the account
  is stopped.

* src/engine/imap-engine/imap-engine.vala (ImapEngine): Remove
  now-redundant AccountSynchronizer lifecycle code, update call sites.
2017-11-12 21:34:27 +11:00
Ask Hjorth Larsen
5b815f70d5 Updated Danish translation 2017-11-11 18:44:51 +01:00
Dušan Kazik
499b92e863 Update Slovak translation 2017-11-11 09:19:42 +00:00
Michael James Gratton
2a0cfc31a7 Don't delay opening remote folder when it is being waited on.
* src/engine/imap-engine/imap-engine-minimal-folder.vala
  (MinimalFolder.wait_for_open_async): Cancel the timer if remote hasn't
  already opened, so it opens immediately.
2017-11-11 15:33:54 +11:00
Michael James Gratton
4218dbb715 Fix race between account becoming ready and MinimalFolder opening.
* src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
  remove remote_ready attr, just use the property on Imap.Account. This
  ensures that if the account is already ready, the folder opens right
  away.
2017-11-11 15:33:54 +11:00
Michael James Gratton
acb339f2ab Misc ClientSessionManager fixes. 2017-11-11 15:33:54 +11:00