| 1 | # Page versions |
| 2 | |
| 3 | What OneNote 2010 stores for a page's earlier versions (Share, Page Versions), what its |
| 4 | Restore Version, Delete Version, Copy Page To and Delete All Versions write, and that it |
| 5 | reads and deletes the versions Rust writes. `tools/test_page_versions.py` checks the rows |
| 6 | without a VM; `crates/onestore/tests/versions.rs` compares Rust's writes with OneNote's. |
| 7 | |
| 8 | ## Storage |
| 9 | |
| 10 | A version is an earlier revision of the page's own object space, kept current under a |
| 11 | context of its own (MS-ONE 2.1.17, 2.1.18); nothing is copied. The page's *version history* |
| 12 | is another revision of the same space, current under context |
| 13 | `{7111497F-1B6B-4209-9491-C98B04CF4C5A},1`: root `jcidVersionHistoryContent` (`0x6003c`) |
| 14 | whose `ElementChildNodesOfVersionHistory` (`0x24001c20`) lists a `jcidVersionProxy` |
| 15 | (`0x6003d`) per version, newest first. A proxy holds `VersionContextNodes` (`0x3400347b`, |
| 16 | the version's context), `LastModifiedTimeStamp` and `AuthorMostRecent` of the version (from |
| 17 | its revision metadata, root role 4) and a `CreationTimeStamp` of when the version was made. |
| 18 | The page manifest names the history context in `0x3400347b` from the page's creation, and |
| 19 | the page's metadata and the section's copy of it carry `HasVersionPages` (`0x88003462`) |
| 20 | while any version is listed. A version's context is its revision identity XOR |
| 21 | `9D52FE7C-8FBC-4495-9300-129B5797A9EA`, its proxy's identity the context XOR |
| 22 | `88440BCA-118C-0E81-32BF-83DB8CB8B6B5`. |
| 23 | |
| 24 | - **Making one.** When a different author edits the page, OneNote labels the page's last |
| 25 | revision as a version (a `0x5d` RevisionRoleAndContextDeclaration in the space's list) |
| 26 | and appends a history revision listing its proxy. One author's edits make none. |
| 27 | - **Restore Version** (`step-03` to `step-04`): the page's next revision depends on the |
| 28 | version's revision (the page's chain forks there), its revision metadata naming who |
| 29 | restored it; the page as it stood is labelled as the newest version and the history lists |
| 30 | it first. The version restored stays listed. |
| 31 | - **Delete Version** (`step-04` to `step-05`): only the history changes, dropping the proxy. |
| 32 | The version's label and revisions stay in the file until Optimize drops them. Deleting |
| 33 | the last one (`step-07` to `step-08`) also clears `HasVersionPages`. |
| 34 | - **Delete All Versions in Section** (`step-05` to `step-06`) asks first ("Do you want to |
| 35 | delete all page versions in the section "History"?") and writes the same as deleting each. |
| 36 | - **Copy Page To** (`step-02` to `step-03`) copies the version as a new page without |
| 37 | versions; the copy's manifest still names the history context, which no revision |
| 38 | carries. Readers must accept that. |
| 39 | - **Optimize** (`step-10`, two years on) rewrites each kept version and the history as |
| 40 | checkpoints; versions are not expired by age here. |
| 41 | |
| 42 | ## Interface |
| 43 | |
| 44 | A version is listed under its page as "M/D/YYYY author" (`shots/06-shown-again.png`) once |
| 45 | the page's Show Page Versions (page menu, `shots/22-page-menu.png`) or Share, Page |
| 46 | Versions is chosen. An open version is read-only under a yellow bar (RGB 255, 238, 194): |
| 47 | "This is an earlier version of the page. It will be deleted over time. Click here to restore |
| 48 | or delete this version." What the version changed since the one before it is banded green |
| 49 | (RGB 214, 255, 214). The bar's menu (`shots/02-version-menu.png`): Restore Version, Delete |
| 50 | Version, Copy Page To; Delete All Versions in Section, Section Group, Notebook; Disable |
| 51 | History for This Notebook; Hide Page Versions. Share also has Hide Authors, Recent Edits and |
| 52 | Find by Author (`shots/14`–`16`). |
| 53 | |
| 54 | ## Rows |
| 55 | |
| 56 | - `native`: one OneNote client driven by hand, authors switched through the Office user |
| 57 | name. `step-NN/notebook` is the section after each step above, `shots/` the screens. |
| 58 | - `native-scripted`: the same steps, one to nine, by `tools/native_versions.py observe`. |
| 59 | - `candidate-restore`, `candidate-delete-all`: `restoring_a_version_stores_what_onenote_stores` |
| 60 | (Restore Version of `step-03`'s version) and `deleting_versions_stores_what_onenote_stores` |
| 61 | (Delete Version of `step-05`'s last one), `ONESTORE_VERSIONS_EXPORT`. |
| 62 | - `cold-restore`: OneNote's fresh read of `candidate-restore` (`native_versions.py cold |
| 63 | --delete`): both versions listed, the newest one Rust labelled opened read-only under the |
| 64 | bar and deleted through its menu (`notebook` is what OneNote left). `cold-delete-all`: its |
| 65 | fresh read of `candidate-delete-all`, the page without versions. |