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

Species sync crash if using same account on two devices #356

Open
norbertschuler opened this issue May 29, 2021 · 1 comment
Open

Species sync crash if using same account on two devices #356

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

Comments

@norbertschuler
Copy link
Collaborator

norbertschuler commented May 29, 2021

Describe the bug
If a user is using the Treemapper app on two devices with the same account and having saved a species on one device and tries to store it on the other device with a species sync at logout as well, the app got stuck with an error as the API call POST https://app-development.plant-for-the-planet.org/treemapper/species to store the species fails with errror 400 as following:

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

{
  "scientificSpecies": "sspec_G9J2HCzvnLkm97owCz",
  "aliases": "Arbutus xalapensis",
  "description": "Test\n",
  "imageFile": "data:image/jpeg;base64,...
}

Response:

{
  "code": 400,
  "message": "Validation Failed",
  "errors": {
    "errors": [
      "you already have defined a species based on the provided scientificSpecies id"
    ],
    "children": {
      "aliases": {},
      "imageFile": {},
      "description": {},
      "scientificSpecies": {}
    }
  }
}

Crash: TypeError: undefined is not an object (evaluating 'addFromAlreadySyncedSpecies(specie.guid, alreadySyncedSpecies).then')

Is it on a Production or Development Build?
develop (maybe also production)

To Reproduce
Steps to reproduce the behavior:

  1. Login on two devices and add a new species
  2. Store species on one device
  3. Store species on second device (e.g. by sync on logout)
  4. See error

Expected behavior
Avoid error if API fails with above error.

What actually happens
App got stuck on sync species screen.

Screenshots
Screenshot_1622293646Screenshot_1622294149

Smartphone (please complete the following information):

  • Device: iPhone simulator + Android emulator
  • Tree Mapper App Version: 1.0.1
@norbertschuler norbertschuler added the bug Something isn't working label May 29, 2021
@norbertschuler
Copy link
Collaborator Author

  • There is also a small UI issue for the Button with a German translation which is longer than the English text.

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