Replace CorniceFall problem type with Cornice#1175
Conversation
|
if we are 100% sure CorniceFall will never make another debut, this change looks good (but if we are not, maybe we keep both?) referencing a similar issue we have run into in the past if you want to cross check if us keeping both was not the right solution (and maybe we can remove one of them too: https://github.com/NWACus/avy/pull/1175/changes) |
|
I asked the NAC about what to do here, and Aaron's response was to keep both. I pushed a change adding Cornice Fall back to the name, and one to undo the changes that renamed the type "You should keep both for Cornice and Glide, at least for now. Forecasts store an FK to national.avalanche_problems, the name column is literally 'Cornice Fall' / 'Glide Avalanches'. So even though the dropdown labels it "Cornice", the persisted value is an FK (id=8 → 'Cornice Fall'), and that's what the API emits. 1,273 forecast rows with Cornice or Glide. |
A Zod Error came in that uncovered an issue with the
observation -> advanced_fields -> avalanche_problems -> typeschema where if the type didn't match the specificAvalancheProblemNameenum, then we failed to parse.The problem was that one of the avalanche problems had a type of 'Cornice' instead of 'Cornice Fall'.
Both the AFP widget to create an observation and the AFP dashboard to create a forecast have this value set to
Corniceso the best fix seems to be to update our schema to match.I updated
AvalancheProblemTypeto match as well just for consistencyObs that had the issue:
https://nwac.us/observations/#/view/observations/9801b523-356b-440c-9f30-1fe0607ce9fa
Zod Error: