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

Automatic pagination breaks on static data endpoints if ETags are used #1

Open
CarbonAlabel opened this issue May 2, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@CarbonAlabel
Copy link
Owner

If previous_response is included on a request to a paginated static data endpoint, and the ETags match, no items past the first page will be returned.

let first = await ESI.request("/v1/universe/types/");
console.log(first.data.length); // Around 36k items
let second = await ESI.request("/v1/universe/types/", {previous_response: first});
console.log(second.data.length); // Exactly 1000, 1 page worth of items

This happens because ESI's static data endpoints will not include the x-pages header in 304 responses, causing the library to assume there is only one page of data. By doing this, ESI is following https://tools.ietf.org/html/rfc2616#section-10.3.5, which is now obsolete, and may be considered to be breaking https://tools.ietf.org/html/rfc7232#section-4.1, which supersedes the obsolete RFC.

esi/esi-issues#1104 is relevant here. This issue only happens with static data endpoints because they are still using weak ETags. If they were updated to use strong ETags like the rest of ESI, this shouldn't be an issue anymore, as ESI seems to include the x-pages header in 304 responses when strong ETags are used.

I have a couple of ideas for workarounds which would resolve this issue, but as mentioned in esi/esi-issues#1104, in their current state the ETags on static data endpoints are of very limited use, so I'm inclined to just wait for the switch to strong ETags be made in ESI, however long that might take.

@CarbonAlabel CarbonAlabel added the bug Something isn't working label May 2, 2019
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
Development

No branches or pull requests

1 participant