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 0 forks source link

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

Open knipec opened 2 months ago

knipec commented 2 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

Expected behavior

You see the soil color screen

Actual behavior

Crash

Additional context

DerekCaelin commented 2 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 2 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 2 months ago

Triage notes:

shrouxm commented 2 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 2 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"