You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have app:data_sharing:taxii:max_pagination_result set to 10000. When requesting /objects with no limit parameter, it returns 5000 entries and more=false. However, there are more entries and requesting with the next parameter properly returns additional entries.
The value of more is determined by pageInfo.hasNextPage
// Because of stateless approach its difficult to know if its finish
// this test could lead to an extra round trip sometimes
consthasNextPage=instances.length===limit;
This conditional will evaluate to false if limit is not set as a query parameter and MAX_TAXII_PAGINATION > ES_DEFAULT_PAGINATION, because instances.length == ES_DEFAULT_PAGINATION but limit == MAX_TAXII_PAGINATION.
Environment
OS (where OpenCTI server runs): Ubuntu
OpenCTI version: 6.2.6
OpenCTI client: frontend
Other environment details:
Reproducible Steps
Steps to create the smallest reproducible scenario:
Create a TAXII2 collection which has more than ES_DEFAULT_PAGINATION elements
Set MAX_TAXII_PAGINATION to a value greater than ES_DEFAULT_PAGINATION
Request the /objects endpoint with no explicit limit parameter
Expected Output
more should be true, because there are more elements
Actual Output
more is false, because of the reasons outlined above
Additional information
Screenshots (optional)
The text was updated successfully, but these errors were encountered:
samczsun
added
bug
use for describing something not working as expected
needs triage
use to identify issue needing triage from Filigran Product team
labels
Jul 23, 2024
Thanks for the report @samczsun. There is a collision in term of option between the data_sharing:taxii:max_pagination_result and the elasticsearch:max_pagination_result that create this issue.
We be fixed in the next release.
However you need to be really careful about changing this kind of option. Too many results will impact the processing and the elasticsearch.
For now please use 5000 as the max configuration.
Description
We have
app:data_sharing:taxii:max_pagination_result
set to10000
. When requesting/objects
with nolimit
parameter, it returns 5000 entries andmore=false
. However, there are more entries and requesting with thenext
parameter properly returns additional entries.The value of
more
is determined bypageInfo.hasNextPage
opencti/opencti-platform/opencti-graphql/src/domain/taxii.js
Lines 134 to 143 in 18ce0c0
This value is true if
instances.length === limit
opencti/opencti-platform/opencti-graphql/src/database/utils.js
Lines 223 to 234 in 18ce0c0
This conditional will evaluate to false if
limit
is not set as a query parameter andMAX_TAXII_PAGINATION > ES_DEFAULT_PAGINATION
, becauseinstances.length == ES_DEFAULT_PAGINATION
butlimit == MAX_TAXII_PAGINATION
.Environment
Reproducible Steps
Steps to create the smallest reproducible scenario:
ES_DEFAULT_PAGINATION
elementsMAX_TAXII_PAGINATION
to a value greater thanES_DEFAULT_PAGINATION
/objects
endpoint with no explicit limit parameterExpected Output
more
should be true, because there are more elementsActual Output
more
is false, because of the reasons outlined aboveAdditional information
Screenshots (optional)
The text was updated successfully, but these errors were encountered: