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

Fixes Issue 366 #376

Merged
merged 14 commits into from
Apr 29, 2024
Merged

Fixes Issue 366 #376

merged 14 commits into from
Apr 29, 2024

Commits on Apr 12, 2024

  1. Initial fix, prior to understanding logical issue with update, `pat…

    …ch`, and `upsert`.
    
    The operations `update`, `patch`, and `upsert` will need to change their current behavior when encountering a `false` value from `condition`. In that case, these operations will actually need to `delete` the `pk` and `sk` for that index.
    tywalch committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    7b0ff33 View commit details
    Browse the repository at this point in the history
  2. Solidifies new condition logic

    The condition callback will be invoked only when a composite attribute associated with an index is set via an update, patch, or upsert. [existing behavior]
    The condition callback is provided the attributes being set on that particular operation, including the item's identifying composite attributes. [existing behavior]
    If the condition callback returns true, ElectroDB will attempt to create the index and all of its associated keys. If an index cannot be created because an update operation only has enough context for a partial key, ElectroDB will throw. [the original issue here, fixed]
    If the condition callback returns false, the index and all of its associated keys will be removed from the item. [new behavior]
    Item #1 above is the key to solving the issue you bring up in your first comment, and it's actually what we do currently. This means that condition would only be called when an index must be recalculated. furthermore, as described in #3, ElectroDB will actually throw if your update operation (set and remove) lacks a full composite context and would result in a "partial" key. This would mean that all * -> true transitions are already validated to have all the composite parts necessary to recreate the complete index already.
    tywalch committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    3e84618 View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2024

  1. Checkpoint commit

    Checkpointing initial pass at new condition tests, tests not passing.
    tywalch committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    b7d5e6f View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2024

  1. All current tests working

    tywalch committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    8bb7bac View commit details
    Browse the repository at this point in the history
  2. Clean up and test fix

    tywalch committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    d669625 View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2024

  1. Clean up and test fix

    tywalch committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    0268faf View commit details
    Browse the repository at this point in the history
  2. Clean up and test fix

    tywalch committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    1855463 View commit details
    Browse the repository at this point in the history
  3. Clean up and test fix

    tywalch committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    a764a6d View commit details
    Browse the repository at this point in the history
  4. Clean up and test fix

    tywalch committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    658e6a1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1d5bf8e View commit details
    Browse the repository at this point in the history
  6. adds new test case

    tywalch committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    955dc27 View commit details
    Browse the repository at this point in the history
  7. Adds changelog documentation

    tywalch committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    3e47188 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e79518f View commit details
    Browse the repository at this point in the history
  9. Adds additional tests

    tywalch committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    87521c4 View commit details
    Browse the repository at this point in the history