Bug Report: Wrong Chemical Recs

A user emailed me showing that my old app (Pool Doctor) recommended very different chemicals than Pooldash (screenshots attached).

It does seem like something is wrong with Pooldash in this case, although I don’t have a ton of context. I’ll try to reproduce the issue now… looking into it!

:eyes:

Pool Doctor recs:

Pooldash recs:

I think I’ve identified the error… it’s a combination of 2 things:

  1. Some of the formulas (including the default one) have problematic treatments, where their functions don’t actually check if the corresponding reading was skipped.

  2. The default values for some of these readings are outside of the ideal range, which seems… wrong.

For instance, the app would recommend Calcium Chloride even when no Calcium Chloride reading was taken… yikes! I need to add checks like this:

// If the user didn't take a CH reading, don't try to balance this chem:
if (s.ch) {
    return 0;
}

Link to this function: https://app.pooldash.com/formula/vast_argument_756/edit#t-cal_chlor

I’ll update all the relevant formulas & post back here when done.

Ok, all of the official formulas have been patched to make sure that they respect skipped readings.

For anyone else making a formula, you can read more about skipped readings here:
https://docs.pooldash.com/#properties

Yesterday the app recommended I enter 0 fl. oz of muriatic acid. Today it did the same. I haven’t changed any of the app settings so only I can think of is an app update has broken the calculation.

Edit: I should clarify that 0 fl. oz of muriatic acid is most definitely the wrong recommendation.

Here’s a screenshot of the values I entered.