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

fix(#410): Failed to reset all prices of the entity #411

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

novoj
Copy link
Collaborator

@novoj 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.

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 an issue Jan 10, 2024 that may be closed by this pull request
@novoj novoj merged commit 7459376 into dev Jan 10, 2024
1 check passed
@novoj novoj deleted the 410-failed-to-reset-all-prices-of-the-entity branch January 10, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to reset all prices of the entity
1 participant