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

Fix index read error #583

Merged
merged 7 commits into from
Sep 29, 2023
Merged

Fix index read error #583

merged 7 commits into from
Sep 29, 2023

Commits on Sep 28, 2023

  1. Make flake serialization/deserialization account for time objects

    Upon transaction, flakes with time types (`xsd:time`, `xsd:date`, `xsd:dateTime`) have their values coerced to `java.time`/`js/Date` objects. When writing index files to disk, we need to write out readable strings for these objects, and then re-coerce them into time objects upon load. Previously we were writing files with unreadable tagged literals in them.
    
    Note: This writes out time strings with maximal precision, allowing us to reuse our existing datatype coercion code when loading (time strings with trailing zeros trimmed do not always satisfy our regexes). This makes for a simpler solution, but it does mean potential wasted space in our index files. We can likely optimize this in the future by having more clever formatters and/or having deserialization-specific coercion logic that recognizes truncate
    d values.
    mpoffald committed Sep 28, 2023
    Configuration menu
    Copy the full SHA
    992d3c8 View commit details
    Browse the repository at this point in the history
  2. Fix coercion for xsd:dateTime, xsd:time in clj

    Fixes #580
    
    The built-in java parsers will do the correct thing for subsecond values. We don't need to be doing any manual string-inspecting apart from determining whether an offset is present.
    mpoffald committed Sep 28, 2023
    Configuration menu
    Copy the full SHA
    bc86894 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    550372b View commit details
    Browse the repository at this point in the history
  4. Use correct type for commit:time value

    Previously, this value was being written as an `xsd:dateTime`, but that is not a valid `xsd:dateTime` value: https://books.xmlschemata.org/relaxng/ch19-77049.html
    
    Apart from just being incorrect, this was causing this one flake to be an anomaly among the `xsd:DateTime` flakes, breaking the assumptions needed for serialization/deserialization.
    mpoffald committed Sep 28, 2023
    Configuration menu
    Copy the full SHA
    49f1b34 View commit details
    Browse the repository at this point in the history
  5. simplify serialization fn now that we no longer produce anomalous `xs…

    …d:dateTime` flakes
    
    Now that the `commit:time` flake is no longer erroneously of type `xsd:dateTime`, any time-typed flakes we encounter should be standardized to time objects. Therefore, we don't need to check the type, and can just use the formatters directly.
    mpoffald committed Sep 28, 2023
    Configuration menu
    Copy the full SHA
    f17ec70 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ba9a452 View commit details
    Browse the repository at this point in the history
  7. add missing cljs require

    mpoffald committed Sep 28, 2023
    Configuration menu
    Copy the full SHA
    789e437 View commit details
    Browse the repository at this point in the history