Repository navigation
Treat a lazy limit of zero as parsing everything up front - #6
Merged
Merged
Conversation
A limit of zero was read as every field being over it, so every field, the id included, was set aside to be parsed later and the build failed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FLATPACK_LAZY_LIMIT=0is documented in the config file as "parse everything up front", but it stoppedflatpack:build:Cause
A field is set aside to be parsed later when its size is over the limit. With a limit of zero every field is over it, the id and title included. Nothing was left to parse up front, the parser returned nothing, and the next line added an array to it.
So zero did the opposite of what the comment says. It has been like this since 1.0; the default of 2048 never reaches it.
Fix
Flatpack::configure()treats a limit of zero or less as no limit, which is the one place both checks read it from (Shallow::split()for files,EntryCodecfor cached entries).Checked
On the demo's 9,780-entry site with Statamic 6.41.0:
FLATPACK_LAZY_LIMIT02048(default)Every entry and term URL matches Statamic's own Stache in both cases (12,840 compared). The parity suite passes on Statamic 6.
Reproduced on 6.40.0 and 6.41.0, so it isn't tied to a Statamic version.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.