Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atomic Changes #9

Open
vcsjones opened this issue Apr 28, 2017 · 0 comments
Open

Atomic Changes #9

vcsjones opened this issue Apr 28, 2017 · 0 comments

Comments

@vcsjones
Copy link
Owner

Ideally OVST would be atomic - that is, if some part of the sign process does not work, then it should appear as if no attempt was made to the package.

This is slightly difficult because applying a signature usually means updating or creating a handful of files.

  1. [Content Types.xml] this already supports the notion of commit changes.
  2. _rels/.rels this already supports the notion of commit changes.
  3. origin.psdor creating parts is NOT currently atomic.
  4. Relationship for origin.psdor this is already atomic in the sense that it is transactional because origin.psdor is immediately written to disk.
  5. signature.psdsxs creating parts is NOT currently atomic.

The difficult part here is we need a stream to write to - and read from - without updating the ZIP.

Options:

  1. Shadow copy the ZIP to %TEMP% first, then atomically switch them out. I don't like this idea
  2. New parts can be backed by a memory stream at first, then become real part streams. I like this idea more.

We already keep a running list of OpcPart objects by URI: we would need to virtualize the access to the OpcPackage to return a virtual part with a memory stream. When the signature process is complete, flush all of the virtual parts in to real parts and swap out the memory stream for a part stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant