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

Compute was not yet called on price termination formula, this is not expected! #460

Closed
novoj opened this issue Feb 8, 2024 · 2 comments · Fixed by #462
Closed

Compute was not yet called on price termination formula, this is not expected! #460

novoj opened this issue Feb 8, 2024 · 2 comments · Fixed by #462
Assignees
Labels
bug Something isn't working
Milestone

Comments

@novoj
Copy link
Collaborator

novoj commented Feb 8, 2024

Valid query produces this error:

{
  "data": null,
  "errors": [
    {
      "message": "Compute was not yet called on price termination formula, this is not expected!",
      "locations": [
        {
          "line": 2,
          "column": 464,
          "sourceName": null
        }
      ],
      "path": [
        "queryProduct"
      ],
      "extensions": {
        "errorCode": "897f068d2c8d52f22b7472294a23cf19:3ac10e4c1e0245eefed6b3cb73410c70:88"
      }
    }
  ]
}

Link to query in evitaLab

@novoj novoj self-assigned this Feb 8, 2024
@novoj novoj added the bug Something isn't working label Feb 8, 2024
@novoj novoj added this to the Alpha milestone Feb 8, 2024
@novoj
Copy link
Collaborator Author

novoj commented Feb 9, 2024

The query is exactly:

query(
	collection('Product'),
	filterBy(
		entityPrimaryKeyInSet(125319, 125320, 741, 748, 755, 235132, 699, 67627),
		userFilter(
			priceBetween(194, 500)
		),
		entityLocaleEquals('cs'),
		attributeInSet('productType', 'BASIC', 'SET', 'MASTER'),
		attributeEquals('status', 'ACTIVE'),
		priceInCurrency('CZK'),
		priceInPriceLists('jko-cenik-registrovani', 'jko-cenik-vsichni', 'basic', 'reference', 'stanardni-cenik1', 'dalsi-novy-cenik'),
		priceValidInNow(),
		referenceHaving(
			'stockVisibilities',
			entityHaving(
				attributeInSet('code', 'moda', 'moda-sklad-2', 'moda-sklad-3')
			)
		)
	),
	orderBy(
		priceNatural(DESC)
	),
	require(
		priceType(WITH_TAX),
		page(1, 20),
		entityFetch(
			attributeContent('minOrderQuantity', 'rating', 'relatedFiles', 'name', 'availability', 'descriptionShort', 'productType', 'ratingVotes', 'url'),
			priceContentAll(),
			referenceContentWithAttributes(
				'stocks',
				attributeContent('quantityOnStock'),
				entityFetch(
					attributeContent('code', 'name'),
					dataInLocales('cs')
				)
			),
			referenceContent(
				'tags',
				entityFetch(
					attributeContent('isVisibleInDetail', 'isVisibleInListing', 'isVisibleInFilter', 'code', 'name'),
					dataInLocales('cs')
				)
			),
			referenceContent(
				'parameterValues',
				filterBy(
					attributeEquals('variant', true)
				),
				entityFetch(
					attributeContent('code', 'order', 'name'),
					referenceContentWithAttributes(
						'parameter',
						attributeContent('orderInParameter'),
						entityFetch(
							attributeContent('code', 'isVisibleInDetail'),
							dataInLocales('cs')
						)
					),
					dataInLocales('cs')
				)
			),
			referenceContent('master'),
			dataInLocales('cs')
		),
		attributeHistogram(20, STANDARD, 'delka'),
		priceHistogram(20, STANDARD),
		facetSummaryOfReference(
			'brand',
			IMPACT,
			entityFetch(
				attributeContent('code', 'name'),
				dataInLocales('cs')
			)
		),
		facetSummaryOfReference(
			'stocks',
			IMPACT,
			entityFetch(
				attributeContent('code', 'name'),
				dataInLocales('cs')
			)
		),
		facetSummaryOfReference(
			'parameterValues',
			IMPACT,
			filterGroupBy(
				attributeEquals('isVisibleInFilter', true)
			),
			entityFetch(
				attributeContent('code', 'basicUnitValue', 'name'),
				dataInLocales('cs')
			),
			entityGroupFetch(
				attributeContent('code', 'description', 'name'),
				dataInLocales('cs')
			)
		),
		facetSummaryOfReference(
			'tags',
			IMPACT,
			filterBy(
				attributeEquals('isVisibleInFilter', true)
			),
			entityFetch(
				attributeContent('code', 'name'),
				dataInLocales('cs')
			)
		)
	)
)

@novoj
Copy link
Collaborator Author

novoj commented Feb 9, 2024

The problem is caused by following the prefetching logic evaluation path which doesn't produce the data in requested way.

novoj added a commit that referenced this issue Feb 9, 2024
…n formula, this is not expected!` in prefetched records scenario

The problem is caused by following the prefetching logic evaluation path which doesn't produce the data in requested way.
@novoj novoj closed this as completed in #462 Feb 9, 2024
novoj added a commit that referenced this issue Feb 9, 2024
…-on-price-termination-formula-this-is-not-expected

fix(#460): Exception: `Compute was not yet called on price termination formula, this is not expected!` in prefetched records scenario
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
1 participant