techmatters / terraso-mobile-client

A React Native project for Terraso’s LandPKS mobile application.
https://landpks.terraso.org
GNU Affero General Public License v3.0
2 stars 1 forks source link

Somehow I set an impossible color that crashes if you try to view it #2019

Open knipec opened 3 months ago

knipec commented 3 months ago

App Version

1.0.1 (182)

Account

No response

Platforms

Description

App crashes when navigating to the color screen. But I think only when the color has been set is kinda invalid (see "Additional context")

Steps to Reproduce

  1. Go to Projects and click on the project "Test project cknipe 2024-07-23". (I added everyone on the team as viewers)
  2. Go to the Sites tab and click on the site "Crash on soil color screen"
  3. Go to the site's Soil tab and click on the "Soil Color" for the first depth interval that has data

Derek/Courtney's steps to reproduce:

  1. Open color module and set manual color
  2. Leave first "hue" blank
  3. Set second "hue" to R
  4. Set "value" to 2.5
  5. Set "chroma" to 1
  6. see issue (Color loads as 10RP 2.5/1)
  7. Select "done"
  8. from soil pit screen, select color
  9. see issue (crash)

Expected behavior

You see the soil color screen

Actual behavior

Crash

Additional context

DerekCaelin commented 3 months ago

I have tried all different combos of this and I can't repro! Very mysterious.

This is a P1 (crash!) but I'm not sure if we can tackle if we don't know how to repro. @shrouxm do you have an opinion?

knipec commented 3 months ago

Paul pointed out there are two things we can do here:

  1. Don't crash if you do run into a weird color (we can tackle this -- but also makes me wonder if there's a more general solution we want to implement rather than a one-off for this)
  2. Don't allow a weird color (don't know how to tackle)
knipec commented 3 months ago

Triage notes:

shrouxm commented 3 months ago

as far as i understand things:

but it seems you're saying you were able to set that color via the dropdowns?

re point 1, the crash could be in the validProperties function in soilColorValidation.ts where we try to index the SOIL_COLORS table by hue, and SOIL_COLORS does not include RP

i don't know how to address point 2 without being able to reproduce and am not sure how to reproduce

DerekCaelin commented 3 months ago

I think this is a lower priority if we're having trouble reproducing... keeping open, but dropping it down to a medium. It seems "very bad, but extremely uncommon"

DerekCaelin commented 7 hours ago

I've found a way to reproduce and have added those instructions to the issue.

paulschreiber commented 5 hours ago

Sentry issue: https://techmatters.sentry.io/issues/6111348114/?