koopjs / FeatureServer

An open source Geoservices Implementation (deprecated)
https://geoservices.github.io
Other
101 stars 32 forks source link

Remove `exceededTransferLimit` check #144

Closed rgwozdz closed 5 years ago

rgwozdz commented 5 years ago

This PR removes (options.limit >= maxRecordCount) from the conditional assignment of json.exceededTransferLimit. After some code review, I realized this check was not necessary and can actually break paging behavior of clients. The check is not necessary because:

  1. option.limit is already set to maxRecordCount when the request doesn't arrive with a req.query.limit or a req.query.resultRecordCount (see here).

  2. The option.limit is already used by the Winnow dependency to determine limitExceeded (see here). limitExceeded is passed back to FeatureServer and used in the check we are aiming to simplify.

  3. There is no reason to check both metadata.limitExceeded && (options.limit >= maxRecordCount); if fact, doing so breaks the ability of resultRecordCount to properly set exceededTransferLimit to true which can break paging functionality of clients.