Skip to content

Entity instance in cache differs from the provided when using EntityHooks #2443

@constructivetim

Description

@constructivetim

i am using EntityHooks to ensure that i record an updatedAt date

    EntityHook.subscribe { entityChange ->
        if (entityChange.changeType == EntityChangeType.Updated) {
            if (entityChange.entityClass == FanArtistTable.FanArtist) entityChange.toEntity(FanArtistTable.FanArtist)?.updatedAt = DateTime.now()
        }
    }

however, when I do, I see this a lot

ERROR Exposed - Entity instance in cache differs from the provided: FanArtist with ID b8dc8bb6-4ddc-48bb-b528-9510a86935bc. Changes on entity could be missed.

if I remove the hook, everything is fine.

exposed 0.59.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions