Skip to content

Persisted-state cache can diverge when Store.async_save swallows write failures #704

Description

@tykeal

KeymasterCoordinator._async_save_data() tracks _prev_kmlocks_dict to avoid rewriting unchanged lock state. Home Assistant's Store.async_save() logs lower-level WriteError/SerializationError failures instead of propagating them, so the coordinator can advance its persisted-state cache even when the data did not reach disk. A later identical save can then be skipped because the in-memory cache claims it was already persisted.

This predates PR #695; the PR only made the cache/write ordering stricter for exceptions that do propagate. A complete fix likely needs observing the lower-level write path or otherwise confirming durability before advancing _prev_kmlocks_dict.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions