E.g. a recent error with timeslots not showing up in timezones far from EST was due to not applying % 24 to the start and end hours, causing them to be values like 28 (which doesn't make sense for a clock with 24 hours). This led to issues with the slot generation in the ScheduleColumn (which uses minute offsets in a hashmap for fast calculation) as slots ended up being negative (which should never happen). An example fix would be adding a check to this function to ensure that slots are always positive.
There are probably lots of other places throughout the codebase that could benefit from checks like this (where if the check fails throw an error so we can debug easily). We also benefit from rewriting the app to use Typescript (since it's cross-compatible we can have some files in TS and others in plain JS until it's completely rewritten, although this will be a bigger undertaking). Discuss any other places for checks here.
E.g. a recent error with timeslots not showing up in timezones far from EST was due to not applying
% 24
to the start and end hours, causing them to be values like 28 (which doesn't make sense for a clock with 24 hours). This led to issues with the slot generation in the ScheduleColumn (which uses minute offsets in a hashmap for fast calculation) as slots ended up being negative (which should never happen). An example fix would be adding a check to this function to ensure that slots are always positive.There are probably lots of other places throughout the codebase that could benefit from checks like this (where if the check fails throw an error so we can debug easily). We also benefit from rewriting the app to use Typescript (since it's cross-compatible we can have some files in TS and others in plain JS until it's completely rewritten, although this will be a bigger undertaking). Discuss any other places for checks here.