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

Refactor file store #1684

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Commits on Nov 13, 2024

  1. fix(store): replace Path.exists by OpenOptions.create_new

    `Path.exists` is not safe against time-of-creation, time-of-use (TOCTOU)
    bugs.
    
    `OpenOptions.create_new` on the other hand is atomic, so not prone to
    this kind of problems.
    nymius committed Nov 13, 2024
    Configuration menu
    Copy the full SHA
    1f47348 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    703b8c7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    723691f View commit details
    Browse the repository at this point in the history
  4. refactor(store)!: replace IterError with StoreError

    `StoreError` included the `IterError` variants, making it replaceable.
    nymius committed Nov 13, 2024
    Configuration menu
    Copy the full SHA
    84197d7 View commit details
    Browse the repository at this point in the history
  5. refactor(store)!: change Store's method names

    The changes in this commit were motivated due to a bug in the
    `StoreFile` which caused old data to be lost if the file was `open`
    instead of created and new data was appended.
    The bugfix later motivated a general name cleanup in StoreFile's methods
    and some minor changes in their signatures. The new StoreFile methods
    are:
    - create: create file in write only mode or fail if file exists.
    - load: open existing file, check integrity of content and retrieve
      Store.
    - append: add new changesets to Store. Do nothing if changeset is empty.
    - dump: aggregate and retrieve all stored changesets in store.
    - load_or_create: load if file exists, create if not, and retrieve
      Store.
    nymius committed Nov 13, 2024
    Configuration menu
    Copy the full SHA
    a3c3c42 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    83e6229 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1251b82 View commit details
    Browse the repository at this point in the history