Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to reset all prices of the entity #410

Closed
novoj opened this issue Jan 10, 2024 · 0 comments · Fixed by #411
Closed

Failed to reset all prices of the entity #410

novoj opened this issue Jan 10, 2024 · 0 comments · Fixed by #411
Assignees
Labels
bug Something isn't working
Milestone

Comments

@novoj
Copy link
Collaborator

novoj commented Jan 10, 2024

The scenario is as follows:

  1. entity has price A ('basic', 'CZK', id = 1)
  2. I call setPrices method with collection of new prices where there is price B ('basic', 'CZK', id = 2) ... the price B should replace price A

I get exception:

ERROR Failed to index entity eP_380523CZ-45 in catalog milagro_cz due to: Price `💰 90752 in basic CZK ` with id `90752` cannot be added to the entity. There is already present price `💰 8473 in basic CZK ` with id `8473` that would create conflict with newly added price because their validity spans overlap.
io.evitadb.api.exception.AmbiguousPriceException: Price `💰 90752 in basic CZK ` with id `90752` cannot be added to the entity. There is already present price `💰 8473 in basic CZK ` with id `8473` that would create conflict with newly added price because their validity spans overlap.
	at io.evitadb.api.requestResponse.data.structure.ExistingPricesBuilder.assertPriceNotAmbiguousBeforeAdding(ExistingPricesBuilder.java:448) ~[evita_api-10.1.3.jar:?]

The method sets entityBuilder.removeAllNonTouchedPrices(); but too late and nevertheless it's not taken into an account when doing the ambiguous check.

@novoj novoj added the bug Something isn't working label Jan 10, 2024
@novoj novoj added this to the Alpha milestone Jan 10, 2024
@novoj novoj self-assigned this Jan 10, 2024
novoj added a commit that referenced this issue Jan 10, 2024
The scenario is as follows:

1. entity has price A ('basic', 'CZK', id = 1)
2. I call setPrices method with collection of new prices where there is price B ('basic', 'CZK', id = 2) ... the price B should replace price A

I get exception:

```
ERROR Failed to index entity eP_380523CZ-45 in catalog milagro_cz due to: Price `💰 90752 in basic CZK ` with id `90752` cannot be added to the entity. There is already present price `💰 8473 in basic CZK ` with id `8473` that would create conflict with newly added price because their validity spans overlap.
io.evitadb.api.exception.AmbiguousPriceException: Price `💰 90752 in basic CZK ` with id `90752` cannot be added to the entity. There is already present price `💰 8473 in basic CZK ` with id `8473` that would create conflict with newly added price because their validity spans overlap.
	at io.evitadb.api.requestResponse.data.structure.ExistingPricesBuilder.assertPriceNotAmbiguousBeforeAdding(ExistingPricesBuilder.java:448) ~[evita_api-10.1.3.jar:?]
```

The method sets `entityBuilder.removeAllNonTouchedPrices();` but too late and nevertheless it's not taken into an account when doing the ambiguous check.
@novoj novoj linked a pull request Jan 10, 2024 that will close this issue
novoj added a commit that referenced this issue Jan 10, 2024
…-of-the-entity

fix(#410): Failed to reset all prices of the entity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant