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

Projects loaded from TPO account do not get cleared #357

Open
norbertschuler opened this issue May 29, 2021 · 0 comments
Open

Projects loaded from TPO account do not get cleared #357

norbertschuler opened this issue May 29, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@norbertschuler
Copy link
Collaborator

norbertschuler commented May 29, 2021

Describe the bug
If you logged in with a TPO account the projects are downloaded and stored locally. After logging out and login with another account, the old projects are still available. So when registering a new tree and choosing a project not belonging to the new TPO the registration upload failed as following:

POST https://app-development.plant-for-the-planet.org/treemapper/plantLocations

Response:

{
  "code": 400,
  "message": "Validation Failed",
  "errors": {
    "children": {
      "type": {},
      "deviceLocation": {},
      "plantDate": {},
      "registrationDate": {},
      "captureMode": {},
      "plantProject": {
        "errors": [
          "The provided plant project does not belong to the authenticated user."
        ]
      },
      "scientificSpecies": {},
      "measurements": {
        "children": {
          "height": {},
          "width": {}
        }
      },
      "geometry": {},
      "tag": {}
    }
  }
}

The wrong registration once saved can not be edited any more to delete the wrong project and also currently can not be deleted anymore as well, so is stuck in the app (until uploading it with the TPO belonging to the project).

Is it on a Production or Development Build?
develop

To Reproduce
Steps to reproduce the behavior:

  1. Login with a first TPO account with projects
  2. Logout and login again with another TPO account
  3. Register tress and choose project of first TPO
  4. Upload registration
  5. See error

Expected behavior
Delete old locally stored projects on logout and clear them before logging with a new account like for species or registrations.

What actually happens
Projects are left locally even if another account got logged in.

@norbertschuler norbertschuler added the bug Something isn't working label May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant