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

fix: Remove attributes and meta attributes before persisting docs #1525

Merged
merged 8 commits into from
Sep 12, 2024

Commits on Sep 12, 2024

  1. fix: Remove attributes and meta attributes before persisting docs

    Those doc's attributes are specific to the JSON API and should not be
    inserted into the Pouch database
    
    This implies that we will have a difference on documents regarding if
    they are served through the cozy-stack or through a local PouchDB, the
    first one may include those fields in their result, but not the second
    one
    
    So from now we should avoid, as much as possible, to relies on the
    `attributes` member to prevent bugs on Offline mode. Multiple commits to
    fix usages of `attributes` in cozy-client will be done after this one
    
    Usage of `attributes` and `meta` members on cozy-app will also have to
    be fixed. This will be a requirement to implement Offline mode on
    cozy-apps
    
    This replies to #1486 (comment)
    Ldoppea committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    3ec3450 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d201932 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0a51ff1 View commit details
    Browse the repository at this point in the history
  4. fix: Don't use attributes on useCapabilities

    By doing so we add unnecessary values to the capabilities object that
    will now contain more data than just `.attributes`
    
    As those are supernumerary values we consider that this is not
    problematic, but we may want to find a cleaner solution in the future
    Ldoppea committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    a4c3575 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7327578 View commit details
    Browse the repository at this point in the history
  6. fix: Don't use attributes on models/applications

    Calls of `isInstalled` and all related methods have been checked and
    `apps` parameter is always a result of `client.query()` so we know that
    `.slug` can be used in replacement of `.attributes.slug`
    Ldoppea committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    9573fb8 View commit details
    Browse the repository at this point in the history
  7. fix: Don't use attributes on models/instance

    Calls of those methods have been checked and `instanceInfo` parameter
    is always a result of `useInstanceInfo` so we know that `.attributes`
    can be omited
    Ldoppea committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    d810982 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    75bd960 View commit details
    Browse the repository at this point in the history