c# - Write file transactional in UWP failes from time to time -


made mindmapping app uwp month ago.

the file handling managed app:

  1. the files auto saved
  2. the files stored in localfolder
  3. i use queue file operations (see code)
  4. the files saved transactional, see following snippet

    using (storagestreamtransaction transaction = await file.opentransactedwriteasync()) {     jsondocumentserializer.serialize(history, transaction.stream.asstreamforwrite());      await transaction.commitasync(); } 

jsondocumentserializer wrapper around jsonserializer.

from time time bug reports users, file gets corrupt, e.g. file seems have correct size empty or have json written file.

how can happen?


Comments