Skip to content

Metadata Aggregate ID can be an integer and causes errors (v6) #314

Description

@sandrokeil

The identity map causes errors if aggregate id is a numeric string.

Strings containing valid decimal integers, unless the number is preceded by a + sign, will be cast to the integer type. E.g. the key "8" will actually be stored under 8. On the other hand "08" will not be cast, as it isn't a valid decimal integer.

An explicit string type cast is needed here.

$domainEvent = $domainEvent->withAddedMetadata('aggregate_id', (string)$aggregateId);

@prolic The PR will be for version v6 and against this repository (v6 branch). We have to check if this can also happen with the new event store implemenation.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions