ITEM.lastUpdate returning null on influxdb in 4.x - bug or me?

Upon openhab migration to 4.2.0 from 2.x (which may or may not be related) I started observing that:

fact #1

ITEM.lastUpdate returns null if ITEM is persisted only in influxdb.

while using previousState in the same rule (fact#2), e.g.:

ITEM.previousState.getTimestamp.toString

shows properly last update time.

NB: fact #3: would the ITEM be persisted in parallel to influxdb also in mapdb, lastUpdate works fine.

Is it by design that lastUpdate is restricted to selected persistence engines? Or I’m tired and missed sth :slight_smile:

Looks like it’s by design (at least since 4.x) and happens not only with influxdb but also JDBC (see item.persistence.lastUpdate() not always working ) and others persistence engines (not with mapdb however).

Important: this only happens in the rules which react to changes/updates to the ITEM you do lastUpdate on. In any other rules, lastUpdate works fine.

This will be kinda "fixed/reverted/no guilt admitted :wink: in 4.3, see: item.persistence.lastUpdate() not always working

Temporary workaround you can use now:
replace lastUpdate in ITEM chaning DSL rules to ITEM.previousState.getTimestamp