• 
      

    Improve invalidation checking to InvalidatableMixin.

    Review Request #15189 — Created July 21, 2026 and updated

    Information

    cryptozoology
    master

    Reviewers

    Initially, invalidation support was limited to BaseKey, though it
    was moved out early in development to InvalidatableMixin. The one
    piece remaining in BaseKey was check_valid(), which raised a
    KeyInvalidatedError if no longer valid.

    This change renames the exception to InvalidatedError and moves
    check_valid() out into the mixin, so that any invalidatable object can
    perform these validity checks. It's been renamed to assert_valid(), to
    make its purpose more clear.

    When used as a context manager, invalidatable objects will now start
    with a validity assertion, to avoid any surprises and catch problems
    early.

    Unit tests pass.

    Summary ID
    Improve invalidation checking to InvalidatableMixin.
    Initially, invalidation support was limited to `BaseKey`, though it was moved out early in development to `InvalidatableMixin`. The one piece remaining in `BaseKey` was `check_valid()`, which raised a `KeyInvalidatedError` if no longer valid. This change renames the exception to `InvalidatedError` and moves `check_valid()` out into the mixin, so that any invalidatable object can perform these validity checks. It's been renamed to `assert_valid()`, to make its purpose more clear. When used as a context manager, invalidatable objects will now start with a validity assertion, to avoid any surprises and catch problems early.
    51b16ff5594badd0014a6349d507d4cd5b22acd6
    Description From Last Updated

    'cryptozoology.errors.InvalidatedError' imported but unused Column: 1 Error code: F401

    reviewbot reviewbot
    Checks run (1 failed, 1 succeeded)
    flake8 failed.
    JSHint passed.

    flake8

    chipx86
    Review request changed
    Change Summary:

    Removed an unused import.

    Commits:
    Summary ID
    Improve invalidation checking to InvalidatableMixin.
    Initially, invalidation support was limited to `BaseKey`, though it was moved out early in development to `InvalidatableMixin`. The one piece remaining in `BaseKey` was `check_valid()`, which raised a `KeyInvalidatedError` if no longer valid. This change renames the exception to `InvalidatedError` and moves `check_valid()` out into the mixin, so that any invalidatable object can perform these validity checks. It's been renamed to `assert_valid()`, to make its purpose more clear. When used as a context manager, invalidatable objects will now start with a validity assertion, to avoid any surprises and catch problems early.
    726f1805cff2dda9f452a8518ce3e1da2dec1051
    Improve invalidation checking to InvalidatableMixin.
    Initially, invalidation support was limited to `BaseKey`, though it was moved out early in development to `InvalidatableMixin`. The one piece remaining in `BaseKey` was `check_valid()`, which raised a `KeyInvalidatedError` if no longer valid. This change renames the exception to `InvalidatedError` and moves `check_valid()` out into the mixin, so that any invalidatable object can perform these validity checks. It's been renamed to `assert_valid()`, to make its purpose more clear. When used as a context manager, invalidatable objects will now start with a validity assertion, to avoid any surprises and catch problems early.
    51b16ff5594badd0014a6349d507d4cd5b22acd6

    Checks run (2 succeeded)

    flake8 passed.
    JSHint passed.