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

fix: regression by reverting fix that returned 206 when first-pos=length in Range header #3006

Merged
merged 4 commits into from
Oct 21, 2023

Conversation

laurenceisla
Copy link
Member

Related to: #2824 (comment)

@steve-chavez
Copy link
Member

steve-chavez commented Oct 19, 2023

@laurenceisla Just so I understand. Once we merge this, the next step would be to do #3007 to fix #2824 ?

@wolfgangwalther
Copy link
Member

How about adding a test-case with offset=0 and empty response together with the revert, so that #2824 (comment) can never break again?

@wolfgangwalther
Copy link
Member

And probably a test-case for this as well:

Still, the error was happening even when Prefer: count=exact was present but when Range: ... wasn't.

@laurenceisla
Copy link
Member Author

@laurenceisla Just so I understand. Once we merge this, the next step would be to do #3007 to fix #2824 ?

@steve-chavez Not necessarily, but I think it would be ideal and more straightforward to do it that way (note that it's a breaking change).

How about adding a test-case with offset=0 and empty response together with the revert, so that #2824 (comment) can never break again?

And probably a test-case for this as well:

Still, the error was happening even when Prefer: count=exact was present but when Range: ... wasn't.

@wolfgangwalther Good idea, I'll add those.

Copy link
Member Author

@laurenceisla laurenceisla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like ra-data-postgrest uses the Prefer: count=exact header by default.

https://github.com/raphiniert-com/ra-data-postgrest/blob/cc3d412c3789bdd87bfd792f629631d9bdab9f54/src/index.ts#L137-L144

That's why the test I added for only offset=0 did not break for v11.2.1, but I'll leave it just in case.

test/spec/Feature/Query/RangeSpec.hs Show resolved Hide resolved
test/spec/Feature/Query/RangeSpec.hs Show resolved Hide resolved
test/spec/Feature/Query/RangeSpec.hs Show resolved Hide resolved
@laurenceisla laurenceisla merged commit 317619b into PostgREST:main Oct 21, 2023
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants