codice / ddf

DDF Distributed Data Framework - an open source, modular integration framework.
http://ddf.codice.org
Other
132 stars 181 forks source link

The CswEndpoint does not properly handle the SourceResponse hit count #6601

Closed glenhein closed 3 years ago

glenhein commented 3 years ago

Description

The SourceResponse API states that it may return -1 for the hit count if it is known. The Csw Endpoint sums the hit counts without checking for the -1 value.

Note: The CSW spec does not appear to support an optional hit count, so the solution may be to have CSW return an error.

Note: There is a new itest in TestSpatial (https://github.com/codice/ddf/pull/6600) that depends on CSW returning -1 for the hit count. Once CSW is fixed, the itest needs to be updated to use a different endpoint that can return -1 for the hit count.

Severity: minor

Steps to Reproduce

This was reproduced in a downstream project, but those systems are not publicly available. To reproduce, you need a source that returns -1 for the hit count and returns valid results/metacards.

Expected behavior :

According to the CSW spec, I would expect the endpoint to return an error when the hit count cannot be determined.

Actual behavior:

The CSW endpoint returns a hit count of -1, which violates the CSW spec that requires a non-negative value.

Reproduces how often:

always

Platform and environment:

Affects versions

Found in 2.26.15-SNAPSHOT

Additional Information

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.