Skip to content

Unexpected item state restore with OH4.3 #4677

Open
@spacemanspiff2007

Description

@spacemanspiff2007

Similar to #3605

Steps to reproduce:

Create a fresh installation of 4.3.3 and install mapdb persistence.

Observe that no standard persistence service is configured:
Image

Create an item and post a state to the item.
Delete item and create it again.
Observe that the previous state is restored through mapdb.

Observed events:

# Create item
{"type":"ItemAddedEvent","topic":"openhab/items/TestItem/added","payload":"{\"type\":\"String\",\"name\":\"TestItem\",\"label\":\"\",\"category\":\"\",\"tags\":[],\"groupNames\":[]}"}

# Udate state
{"type":"ItemStateUpdatedEvent","topic":"openhab/items/TestItem/stateupdated","payload":"{\"type\":\"String\",\"value\":\"my_string\"}"}
{"type":"ItemStateChangedEvent","topic":"openhab/items/TestItem/statechanged","payload":"{\"type\":\"String\",\"value\":\"my_string\",\"oldType\":\"UnDef\",\"oldValue\":\"NULL\"}"}

# Remove item
{"type":"ItemRemovedEvent","topic":"openhab/items/TestItem/removed","payload":"{\"type\":\"String\",\"name\":\"TestItem\",\"label\":\"\",\"category\":\"\",\"tags\":[],\"groupNames\":[]}"}

# Create item with same name
{"type":"ItemAddedEvent","topic":"openhab/items/TestItem/added","payload":"{\"type\":\"String\",\"name\":\"TestItem\",\"label\":\"\",\"category\":\"\",\"tags\":[],\"groupNames\":[]}"}

# Observe state restore
{"type":"ItemStateUpdatedEvent","topic":"openhab/items/TestItem/stateupdated","payload":"{\"type\":\"String\",\"value\":\"my_string\"}"}
{"type":"ItemStateChangedEvent","topic":"openhab/items/TestItem/statechanged","payload":"{\"type\":\"String\",\"value\":\"my_string\",\"oldType\":\"UnDef\",\"oldValue\":\"NULL\"}"}

Since no persistence service is configured as a default persistence no restore should happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn unexpected problem or unintended behavior of the Core

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions