Closed rivaldi8 closed 7 years ago
The idea I have in mind is to add two new fields to scheduled_actions
table: error_count
and error_message
.
error_count
stores how many times a scheduled action has failed. It's reset to 0 when the action succeeds or when the user is informed.
error_message
stores information about the last time the action failed.
The next time the user runs the application, it checks if any scheduled actions has failed. If any error has been registered, a Snackbar is shown informing of it. It would have an action to show the details of the actions that have failed and the error messages.
@rivaldi8 you mean adding that to the db table? I have reservations about this. The way Android is designed, we are not responsible for what happens outside of the app. Once we hand over a file, we should not care how it is handled.
We only have issues now because my Google Drive integration is a bit buggy. I am working to switch this to the storage access framework in v2.2 which should make the export very very reliable. Eventually, we would phase out our own sync implementations for API levels >= 19 and let the users use the app of their favourite service with SAF support.
Also, I would prefer not to modify the db with extra fields not present in the GnuCash schema, because if we later on want to sync the db files, that would be another thing to handle.
We should just ensure that backups always work reliably before exports so that users can avoid data loss. One way would be to create a UI which offers the user a chance to undo the last delete. Then we can transparently restore from that backup for the user in case they want to. The UI can either be a SnackBar or an option in Settings. What say you?
Oh! I didn't remember you were working on switching to SAF. That would make this issue invalid then. I'll close it.
About the undo feature, I think we should have both the SnackBar and the option in Settings. The SnackBar showing up after some destructive actions, like "delete after export". The option in Settings for any time the user needs it. However, now that I think, there's an option already under "Backup & export". Do you mean to implement it differently?
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its recipients. This is a temporary error. The following address(es) deferred:
pkbrister@zoho.com Domain ownyourbits.com has exceeded the max emails per hour (3/3 (100%)) allowed. Message will be reattempted later
------- This is a copy of the message, including all the headers. ------
Received: from o11.sgmail.github.com ([167.89.101.202]:13242)
by skywalker.onesite.co with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128)
(Exim 4.87)
(envelope-from bounces+848413-7866-nacho=ownyourbits.com@sgmail.github.com)
id 1cV1QH-001wiQ-Tb
for nacho@ownyourbits.com; Sat, 21 Jan 2017 14:34:02 -0500
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=github.com;
h=from:reply-to:to:cc:in-reply-to:references:subject:mime-version:content-type:content-transfer-encoding:list-id:list-archive:list-post:list-unsubscribe;
s=s20150108; bh=9zPRlxd+PTnDJXU/TPMB83he9dI=; b=teG7SDIV0xe56nT0
FkzWsxZOX9o8aSV19sChz4DEEfNt0XwxUrI5yB1KB/8cZLYeU+jfZcUjWu18ZUoB
8iK4e6UvRWYXHcFGhPUXCdQbQ/KMcCQqBL0iNBSDC1oPrOnO5Mc4/bghA5aXsJJl
dc44AAgAQO6Kw+CTJTnvmdY5H3w=
Received: by filter0444p1mdw1.sendgrid.net with SMTP id filter0444p1mdw1-11103-5883B781-D
2017-01-21 19:33:21.464507197 +0000 UTC
Received: from github-smtp2a-ext-cp1-prd.iad.github.net (github-smtp2a-ext-cp1-prd.iad.github.net [192.30.253.16])
by ismtpd0001p1iad1.sendgrid.net (SG) with ESMTP id CZ3lmSXxTGC5OWFu43j0bw
for nacho@ownyourbits.com; Sat, 21 Jan 2017 19:33:21.389 +0000 (UTC)
Date: Sat, 21 Jan 2017 11:33:21 -0800
From: Àlex Magaz Graça notifications@github.com
Reply-To: codinguser/gnucash-android reply@reply.github.com
To: codinguser/gnucash-android gnucash-android@noreply.github.com
Cc: Subscribed subscribed@noreply.github.com
Message-ID: codinguser/gnucash-android/issues/643/274282955@github.com
In-Reply-To: codinguser/gnucash-android/issues/643@github.com
References: codinguser/gnucash-android/issues/643@github.com
Subject: Re: [codinguser/gnucash-android] Inform the user when a scheduled
action fails (#643)
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_5883b7814bdba_4a8c3fa203ed313826775f";
charset=UTF-8
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: rivaldi8
X-GitHub-Recipient: nachoparker
X-GitHub-Reason: subscribed
List-ID: codinguser/gnucash-android
----==_mimepart_5883b7814bdba_4a8c3fa203ed313826775f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit
Oh! I didn't remember you were working on switching to SAF. That would make this issue invalid then. I'll close it.
About the undo feature, I think we should have both the SnackBar and the option in Settings. The SnackBar showing up after some destructive actions, like "delete after export". The option in Settings for any time the user needs it. However, now that I think, there's an option already under "Backup & export". Do you mean to implement it differently?
-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/codinguser/gnucash-android/issues/643#issuecomment-274282955 ----==_mimepart_5883b7814bdba_4a8c3fa203ed313826775f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Oh! I didn't remember you were working on switching to SAF. That would m= ake this issue invalid then. I'll close it.
About the undo feature, I think we should have both the SnackBar and the= option in Settings. The SnackBar showing up after some destructive actions= , like "delete after export". The option in Settings for any time the user = needs it. However, now that I think, there's an option already under "Backu= p & export". Do you mean to implement it differently?
<p style=3D"font-size:small;-webkit-text-size-adjust:none;color:#666;">&mda=
sh;
You are receiving this because you are subscribed to this thread.<=
br />Reply to this email directly, <a href=3D"https://github.com/codinguser=
/gnucash-android/issues/643#issuecomment-274282955">view it on GitHub, =
or <a href=3D"https://github.com/notifications/unsubscribe-auth/AUWsXN9ROn4=
sku38HXp5uIUlMxMlWBmXks5rUl2BgaJpZM4LqG_9">mute the thread.<img alt=3D"=
" height=3D"1" src=3D"https://github.com/notifications/beacon/AUWsXKycn75zV=
h8CZoUKCxnVIiaRpiF5ks5rUl2BgaJpZM4LqG_9.gif" width=3D"1" />
<script type=3D"application/json" data-scope=3D"inboxmarkup">{"api_version"= :"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"Gi= tHub"},"entity":{"external_key":"github/codinguser/gnucash-android","title"= :"codinguser/gnucash-android","subtitle":"GitHub repository","main_image_ur= l":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d8= 8-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubuserc= ontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png"= ,"action":{"name":"Open in GitHub","url":"https://github.com/codinguser/gnu= cash-android"}},"updates":{"snippets":[{"icon":"PERSON","message":"@rivaldi= 8 in #643: Oh! I didn't remember you were working on switching to SAF. That= would make this issue invalid then. I'll close it.\r\n\r\nAbout the undo f= eature, I think we should have both the SnackBar and the option in Settings= . The SnackBar showing up after some destructive actions, like \"delete aft= er export\". The option in Settings for any time the user needs it. However= , now that I think, there's an option already under \"Backup \u0026 export\= ". Do you mean to implement it differently?"}],"action":{"name":"View Issue= ","url":"https://github.com/codinguser/gnucash-android/issues/643#issuecomm= ent-274282955"}}}=
----==_mimepart_5883b7814bdba_4a8c3fa203ed313826775f--
@rivaldi8 I agree that we should have both. The current option in Settings makes the user select the file by date. This is easy but not the most convenient thing to do. We can leave that in place.
But the undo option (via SnackBar) would definitely be a great addition. It will give the user the option to immediately restore the deleted transactions without going through any further dialogs.
A temporary backup file will be generated (which doesn't even need to go into the backups folder), it can just be a short-lived file created for the express purpose of doing an undo. When SnackBar is dismissed, the file is also deleted.
Something like that is what I was thinking about.
:+1: I like the idea.
Now, the user isn't informed when a scheduled action fails. For example, if an scheduled export fails because of some problem uploading the files to Google Drive, the user won't notice until he or she checks for the exported files. This may happen too late, when the user is looking for a backup to recover from a data loss.
The scheduled actions service should register any error so the user is informed the next time the application is run.