Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup: Lots of fixes, refactoring and documentation #887

Merged
merged 18 commits into from
Aug 3, 2023

Commits on Jul 27, 2023

  1. fix(backup): Upload could crash when response body undefined

    For unknown error, there is now response body. So JSON.parse crash.
    Updated TS types of patch-package.
    zatteo committed Jul 27, 2023
    Configuration menu
    Copy the full SHA
    d0597f6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    826d3c5 View commit details
    Browse the repository at this point in the history
  3. refactor(backup): Create an upload service distinct from Media model

    Not totally agnostic. Linked to cozy-stack.
    
    Will help next features link "share with".
    zatteo committed Jul 27, 2023
    Configuration menu
    Copy the full SHA
    a17d491 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2023

  1. Configuration menu
    Copy the full SHA
    fe5822f View commit details
    Browse the repository at this point in the history
  2. fix(backup): Set backup as to do on new start after killing app

    When killing app during a backup, backup was stuck as running even if
    it was not running. Now, if we start the app and backup is set as
    running, we set it as to do because it is not possible. It is only
    when app start, you we can still move between webview while a backup
    is running
    zatteo committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    d332981 View commit details
    Browse the repository at this point in the history
  3. feat(backup): Disable album management on Android

    We try to stay as close as operating system :
    - folder structure on Android
    - album on iOS
    zatteo committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    b5d3084 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ce52f19 View commit details
    Browse the repository at this point in the history
  5. fix(backup): Fix restoring when media at backup root path

    On iOS, media are set with a remote path to '/' because there is no
    folder in backup folder. But when restoring, remote path was set to
    empty string so algorithm was considering these photos as not
    backuped.
    zatteo committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    82ba33b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2a1d096 View commit details
    Browse the repository at this point in the history
  7. fix(backup): Allow users to rename is backup folder

    Backup folder is a magic folder. But in some part of the code, we
    need to use the path of the backup folder from local backup config.
    So now before uploading files, we check if the backup folder has been
    renamed and we update local backup config if needed.
    zatteo committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    84c256b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a187a28 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    1d9348e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    9b50fba View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2023

  1. Configuration menu
    Copy the full SHA
    321c68d View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2023

  1. fix: Add Size to upload URL

    Like that, cozy-stack is able to cut the connexion before the end if
    there is no space left on the device.
    Crash-- committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    d7ba638 View commit details
    Browse the repository at this point in the history
  2. chore: Add a task to generate the dependancies graph

    This is how I use it : `./gradlew allDeps > allDeps.txt`
    Crash-- committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    c4aa505 View commit details
    Browse the repository at this point in the history
  3. fix: Use okhttp5.0.0-alpha.1 for react-native-background-upload

    We have an http2 issue when uploading a file to a cozy when we reach the
    quota limit. In that case, the stack closes the connexion but it can
    appears after having already send a few bytes. In that case, okhttp was
    not returning the right headers and we ended up with a:
    `stream closed: cancel`.
    
    With this version, okhttp is returning the right header!
    
    see the okhttp changelog:
    https://github.com/square/okhttp/blob/master/CHANGELOG.md#version-500-alpha1
    specially:
    `Fix: Attempt to read the response body even if the server canceled the
    request. This will cause some calls to return nice error codes like
     HTTP/1.1 429 Too Many Requests instead of transport errors like
    SocketException: Connection reset and StreamResetException: stream was
    reset: CANCEL.
    `
    Crash-- committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    d0cfea6 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2023

  1. fix: Better check for Upload error type in uploadMedias()

    Previous implementation would throw if the received error do not
    contain any `errors` array. this can happen if the error is not thrown
    by cozy-client
    
    Also this commit improve type check to ensure the receive error is the
    one we expect. Casting objects using `as` should be avoided as this
    will never ensure type compatibility
    Ldoppea committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    f7cf0f8 View commit details
    Browse the repository at this point in the history