Add simple update flow - #4582
Conversation
|
To test the changes in this pull request, install this apk: |
|
some quick feedback:
|
84725e2 to
fc8e409
Compare
|
after talking with @r10s wrt the core side of this etc. we also came over some change of requirements:
about that last point: I also realized that we are adding that device message for every selected profile, better do it only in one profile, and in the rest set it to null as we do already in |
|
then we probably can also drop still, it makes sense to do the update check only once per day or every some hours, at a somehow random time |
It may be useful later so I say we just keep it, it basically costs nothing. |
it is not about cost, it is about annoyance, if you have, for example, 5 profiles, you will have to deal 5 times with a device message chat with the same unread message, also for removing it later is much easier because you have to only remove it in 1 place |
fc8e409 to
ea07f61
Compare
|
Strange, github quoted the wrong message. I was replying to the timestamp thing @r10s mentioned. |
|
To test the changes in this pull request, install this apk: |
ahh! wrt that the thing is that core will just not provide the field the whole format will change so better wait in that regard to just use the core api, not much to do here than removing the whole mock data with timestamp and stuff |
|
I updated the update flow to show only in the active profile. Also the message shall remove itself after a new version is installed now. The one-week check is also removed. |
- remove device message after update
ea07f61 to
96582b5
Compare
|
To test the changes in this pull request, install this apk: |
|
i did the core part at chatmail/core#8557 - but please wait for replacing MOCKUP by real calls until things are settled there; there are some open ends to be discussed |
| if (context == null || activity == null) return; | ||
|
|
||
| PackageInfo info = context.getPackageManager().getPackageArchiveInfo(localPath, 0); | ||
| if (info == null || !context.getPackageName().equals(info.packageName)) { |
There was a problem hiding this comment.
For other reviewers: this is the place where we check that downloaded APK is an update and not something entirely unrelated.
|
@r10s this is really not needed, the system already gives feedback that the app got updated after the update finishes, see attached screenshots of an apk update process, showing a message afterwards in-app only makes sense if you are going to announce what is new / changelog, otherwise you are just stating the same again:
|
|
@r10s @adbenitez I kind of agree with adb here. Although I think we can re-purpose the device message we have now to show new changes. Currently that message is static and doesn't do much after a user have installed Delta. |
|
k, if that is the normal flow, i am fine for now with not saying smth in device chat after installation (only removing existing "New version available" message) |
> we aim to inform about updates for installations outside of any appstore soon. > > there is already a PR on android at deltachat/deltachat-android#4582, however, the information about "update available" is a mockup there. > > in general, there are 3 ideas around about how to gather the "update available" infomation - (1) checking a central url, (2) let contacts provide information, (3) let relay provide information. on various one-to-one discussions, outcome is that (3) is the most reasonable way to go. this PR is about reading update information via IMAP metadata from the relay. it is up to the UI to call `get_app_version()` at a reasonable time and frequency, see comment in the code. when called, `get_app_version()` iterates over all known profiles and relays and checks for version information, returning the newest for the given scope. we do not use an event, as that is tricky wrt changes - we do not know if other relays report later a newer version. we also do not cache anything, to prevent bad relays avoiding us to update permanently. also it is easier :) <details> <summary>outdated notes and questions</summary> - ~~it is up to the clients to get the needed information, we could let core filter, but it seems easy enough the other way round, and may have debug advantages, one can iterate etc.~~ EDIT: we now filter in core, this also makes the jsonrpc part easier, see review comments - when is IMAP METADATA actually read? when are they ready? is that really the correct place? i am up to change that, but beware, this is not really my expertise, so someone else may need to take over :) EDIT: see below, IMAP METADATA is read on connection, before fetching starts, usually fast enough - relay part is missing. once the format is settled and discussed shortly here, that should be done soon as well. but this is definitely not my expertise and needed to be done by someone else :) - key for IMAP METADATA is `/shared/vendor/deltachat/appversions` - shall we continue use `deltachat` for compatibility or so? `chatmail` seems to be more correct EDIT: we stay with the current </details> relay counterpart issue: chatmail/relay#1037 cc @link2xt @Hocuri @hpk42 --------- Co-authored-by: holger krekel <holger@merlinux.eu>
|
ftr, the core PR and relay PR are merged, and this PR should use the new API get_app_version("deltachat", "gplay"), returning an json as for testing: this is already deployed on nine.testrun.org, so faking a lower versionInteger should start the update flow (that should not be part of the PR, just mentioning that so one can test :) |





A very simple self-update flow, starting from device message:
Then a simple progess dialog:
And going into install dialog:
Permission check happens before downloading to avoid wasting a download, other problems like app id mismatch are shown as toasts.
resolve #4575