Infomaniak / desktop-kDrive

:computer: Desktop Syncing Client for kDrive
GNU General Public License v3.0
19 stars 4 forks source link

Kdesktop 992 Add a modal to lock the app when the current version is forbidden. #193

Closed herve-er closed 1 month ago

herve-er commented 2 months ago

Description

This PR aims to provide a solution allowing us to make a version of the app unusable.

Technical Solution

The technical solution selected is to catch any error 406 response on any kDrive API request (update and login are not concerned). When such an error is fetched, it is propagated up to a point where it is added as an error (either in appserver or in executorworker). This error is then fetched on the client side, which is interpreted and leads to closing all the opened windows except for synthesispopover. Synthesispopover adopts a specific "locked App" design:

image

Depending on the update process (Windows, macOS, Linux) the button can show different messages:

Tests

As their is currently no test for the updaters, this PR also come with some unit test. However, Due to the current implementation, all the updaters methods are not eligible to unit test and the coverage cannot be as high as desired.

A completely new implementation of the updater will come soon, with a new internal API road. This one must be done following a TDD approach.


Tasklist

herve-er commented 2 months ago

On Linux, there isn't a download button as the user need to download the new version on the website manually: image

As There isn't a download button, I let the quit button in the icon menu: image

(Synthesis open the upgrade required page)

ClementKunz commented 2 months ago

The style of the synthesis popover is not ok anymore on macOS

Same on Windows, only visible with dark mode. Working on it.

Fixed in this commit: 9bd6a65

ClementKunz commented 2 months ago

Screenshot 2024-07-03 at 16 13 27 Screenshot 2024-07-03 at 16 14 15

The app try to restart itself once Sparkle killed it, therefor displaying this message. Sparkle does not use the uninstaller so we need to find a different way to avoid that... Once all processed stopped, it is impossible to start the app. However, we can see in the ìnfo.plist` file that the version has been updated

herve-er commented 2 months ago

The app try to restart itself once Sparkle killed it, therefor displaying this message. Sparkle does not use the uninstaller so we need to find a different way to avoid that... Once all processed stopped, it is impossible to start the app. However, we can see in the ìnfo.plist` file that the version has been updated

Did you desactivate proxyman before tring to restart the app after the update? As 406 error is not retrocompatible, the 3.6.1 app crash at startup when receiving a 406.

For the Sparkle issue, I will think about it and come back.

ClementKunz commented 2 months ago

Did you desactivate proxyman before tring to restart the app after the update? As 406 error is not retrocompatible, the 3.6.1 app crash at startup when receiving a 406.

No I did not, good thinking 👍 But anyway it is another issue, a DB migration failure that should not happen. This is because we are currently building a 3.6.2 labelled as a 3.5.8

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
2 New issues
6 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud