← Commit history

0.11.0 followup: canonicalise status on the way out of mergedData

Drew Owens ·60c86538f7 · ·parent 22b1b35
CSV export aliased the status vocabulary but /export/json did not, so the two disagreed whenever a sidecar carried the old words, which the live plan's does. Normalise once in mergedData instead, so json, csv, svg and the html snapshot all speak the four states. Stored data is still never touched: a sidecar saying live keeps saying it until the user next saves.
1 file changed +5
server.js+5
@@ -433,6 +433,11 @@ function mergedData() {       data.items = reordered;     }   }+  // The merged plan is the app's canonical output, so it speaks the canonical+  // vocabulary. Stored data is never touched: this normalises on the way OUT, so+  // /export/json, /export/csv, the SVG and the HTML snapshot all agree, and a+  // sidecar still saying "live" keeps saying it until the user next saves.+  data.items.forEach(r => { if (r.status) r.status = statusKey(r.status); });   return data; }