Is it ever possible for `handleFileSave()` to get called with `commandData.doc` in a non-unit-test setting?  If so, this code needs to be hoisted outside the `!doc` case... more similar to what saveAll() below does.