We anticipate keeping everything backward compatible in the API and won’t intentionally break anything so definitely holler if anything breaks.
Also a quick sanity check from @mary or other iOS people: does everything about YBHP goals currently seem fine in the iOS app?
Back to tech nerdery…
1. Switching from
This is orthogonal to YBHP but we’re soon switching from
safesum so might as well make that update to clients while we’re at it.
2. Deciding between
At some point we thought that the single canonical thing that clients should care about is
losedate in the API). It’s the timestamp of when you’ll derail if you don’t add any more data.
tluz all we want? Clients need to know the integer number of safe days. Is that easy to derive from the
tluz timestamp or do deadlines and timezones make it fraught? Beebrain currently returns the integer number of safe days –
safebuf – but we were going to deprecate it? Should we?
How are y’all currently getting number of safe days from the API? The
lane field? That obviously needs to die and maybe
safebuf is the right thing to replace it with.
Speaking of which…
3. Death to the
lane field was a way to number the regions of the graph and told you which region the current datapoint was in:
(And I guess it could be +3 or more for being further above the road or conceivably -3 or less for being further below the road.)
I think in the new world order we want to compute a legacy deprecated backwards-compatibility
lane field like so:
lane = yaw*(safebuf - (safebuf <= 1 ? 2 : 1))
(UPDATE: The above is implemented for YBHP now.)
4. Clients computing the color themselves
Beebrain currently returns
color (either “green”, “blue”, “orange”, or “red”) but that’s not documented in the API and should be deprecated. Clients should derive it themselves from the number of safe days like so:
color = (safebuf < 1 ? "red" : safebuf < 2 ? "orange" : safebuf < 3 ? "blue" : safebuf < 7 ? "green" : "gray")
Update: Just to try out @grayson’s suggestion, I updated the above to include gray for 7+ days of safety buffer!