mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
88c08bbfc7
- `ItemStorageMemory.get` now throws an `ItemNotFoundError` when the requested `item_id` is not found. - Update docstrings in ABC and tests. The new memory item storage implementation implemented the `get` method incorrectly, by returning `None` if the item didn't exist. The ABC typed `get` as returning `T`, while the SQLite implementation typed `get` as returning `Optional[T]`. The SQLite implementation was referenced when writing the memory implementation. This mismatched typing is a violation of the Liskov substitution principle, because the signature of the implementation of `get` in the implementation is wider than the abstract class's definition. Using `pyright` in strict mode catches this. In `invocation_stats_default`, this introduced an error. The `_prune_stats` method calls `get`, expecting the method to throw if the item is not found. If the graph is no longer stored in the bounded item storage, we will call `is_complete()` on `None`, causing the error. Note: This error condition never arose the SQLite implementation because it parsed the item with pydantic before returning it, which would throw if the item was not found. It implicitly threw, while the memory implementation did not. |
||
---|---|---|
.. | ||
app | ||
assets | ||
backend | ||
configs | ||
frontend | ||
version | ||
__init__.py | ||
README |
Organization of the source tree: app -- Home of nodes invocations and services assets -- Images and other data files used by InvokeAI backend -- Non-user facing libraries, including the rendering core. configs -- Configuration files used at install and run times frontend -- User-facing scripts, including the CLI and the WebUI version -- Current InvokeAI version string, stored in version/invokeai_version.py