Skip to content

sdk: Fix empty-cache handling in LocalFileIdentifiableStore#463

Merged
s-heppner merged 1 commit intoeclipse-basyx:developfrom
rwth-iat:fix/438
Feb 25, 2026
Merged

sdk: Fix empty-cache handling in LocalFileIdentifiableStore#463
s-heppner merged 1 commit intoeclipse-basyx:developfrom
rwth-iat:fix/438

Conversation

@moritzsommer
Copy link
Contributor

Previously, the _object_cache of the LocalFileIdentifiableStore was initialised empty. Calling discard() immediately after store initialisation raised a KeyError if the Identifiable to delete existed on disk but had not yet been loaded into the in-memory cache.

This adds explicit handling of missing cache entries in discard(), preventing errors when a key is not present in the in-memory cache. Moreover, a corresponding regression test is added. Finally, the interim empty-cache workaround in sync() is removed.

Fixes #438

Previously, the `_object_cache` of the `LocalFileIdentifiableStore` was
initialised empty. Calling `discard()` immediately after store
initialisation raised a `KeyError` if the Identifiable to delete existed
on disk but had not yet been loaded into the in-memory cache.

This adds explicit handling of missing cache entries in `discard()`,
preventing errors when a key is not present in the in-memory cache.
Moreover, a corresponding regression test is added. Finally, the interim
empty-cache workaround in `sync()` is removed.

Fixes eclipse-basyx#438
Copy link
Member

@s-heppner s-heppner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds explicit handling of missing cache entries in discard().

This is a very fancy way of saying we now ignore missing cache entries :D
As far as I can see, this is the correct way of handling these, though.

Copy link
Member

@s-heppner s-heppner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds explicit handling of missing cache entries in discard().

This is a very fancy way of saying we now ignore missing cache entries :D
As far as I can see, this is the correct way of handling these, though.

@s-heppner s-heppner merged commit 1b1a884 into eclipse-basyx:develop Feb 25, 2026
14 checks passed
@s-heppner s-heppner deleted the fix/438 branch February 25, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants