return save(ns);
  }

  try {
    let decrypted = JSON.parse(decryptData(val, encryptionKey));

    // handle the case when we just migrated from the previous storage
    // which stored the data in binary with a `data` key
    if (ns === "app" && keyPath === "accounts" && decrypted.data) {
      decrypted = decrypted.data;
    }

    // apply transform if needed
    const transform = get(transforms, `${ns}.${keyPath}`);
    if (transform) {
      decrypted = transform.get(decrypted);
    }

    // only set decrypted data in memory
    set(memoryNamespaces[ns], keyPath, decrypted);

    return save(ns);
  }
Register a keyPath in db that is encrypted
This will decrypt the keyPath at this moment, and will be used
in `save` to encrypt it back