pull down to refresh
Maybe this is where my inexperience as a real developer starts to show.
My thought process was: If there was an edge case I didn't think about, I'd rather the app just proceed on, with a slightly messed up carousel order, than for it to error out. Happy to be corrected as to what k00b and ek think the standards should be in this case.
The first complaint looks valid but really poorly addressed by the digital overlord - I don't know the codebase but in general this is something that human review may have flagged up too. I saw your comment "this never happens", but that makes it all the more important to fix the code.
Think of it this way: if a field is never
undefinedbecause it is always set on every possible code path, then you shouldn't put a default but instead do error handling (and logging!) when encounteringundefined. Assigning a default value on a case that should not exist is a problem because if for any reason (in the future) it does exist, it shouldn't just gracefully apply your assumption. Assigning a default value is what leads to hidden tech debt in this case, because it will mask future errors.