-
Notifications
You must be signed in to change notification settings - Fork 42
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
Token limit change after apollo-parser 0.5.3 #610
Labels
Comments
I might call this intentional as previously you would get one more token than the limit, as the eof token was not part of the limit. Now when you |
Admittedly it does feel a bit odd to have to abort just because the EOF pseudo-token doesn't fit. But you're not really meant to be close to the limit in normal use. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Apollo Router exposes the token limit in its own configuration. The test for this config fails when upgrading apollo-router from 0.5.3.
Steps to reproduce
Modify the existing
token_limit
test incrates/apollo-parser/src/lexer/mod.rs
:Expected result
Passes in both 0.5.3 and current main 126816f.
Actual result
Passes in 0.5.3. On main:
The panic location points to the
.with_limit(TEST_INPUT_TOKEN_COUNT)
case. If commenting out the failing assert produces:Still in the the
.with_limit(TEST_INPUT_TOKEN_COUNT)
case. Also commenting out that one makes the test pass. So it doesn’t look like an off-by-one change, but rather something that happens specifically around the EOF token. I don’t fully understand it just by looking at the code though, sinceTokenKind::Eof
is (surprisingly) now created in two places.Environment
apollo-rs
crate: apollo-parserThe text was updated successfully, but these errors were encountered: