Read options.fetch_body and options.fetch_flags from the config - #628
Open
csemazharul wants to merge 1 commit into
Open
Read options.fetch_body and options.fetch_flags from the config#628csemazharul wants to merge 1 commit into
csemazharul wants to merge 1 commit into
Conversation
src/config/imap.php documents both options, but Query never read them: the properties were hardcoded to true, so the only way to turn either off was to chain setFetchBody(false) / setFetchFlags(false) on every query. Take them in the constructor alongside the other options it already reads, keeping true as the default so nothing changes for anyone who has not set them. Fixes Webklex#620
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.
Fixes #620.
src/config/imap.phpdocuments both options:but
Query::__construct()never reads them. It picks upoptions.sequence,options.fetch,options.fetch_order,date_formatandoptions.soft_fail, while$fetch_bodyand$fetch_flagsstay at their hardcodedtrue:So setting either in the
ClientManagerconfig has no effect, and the only way to turn one off is to chainsetFetchBody(false)/setFetchFlags(false)on every query.Change
Two lines in the constructor, next to the options it already reads.
truestays the default, so behaviour is unchanged for anyone who has not set them.Test
tests/issues/Issue620Test.phpcovers both directions — config values honoured, and the defaults still true. It fails on master and passes with the change.tests/issuesbefore:Tests: 24, Assertions: 58, Errors: 1, Failures: 6tests/issuesafter:Tests: 24, Assertions: 59, Errors: 1, Failures: 5The remaining error and five failures are pre-existing on master and unrelated (Issue355, 379, 383, 410, 420, 511). The root-level unit tests pass in both cases. Note the full suite stops early on a live-mailbox test when
LIVE_MAILBOXis unset, so I ran the directories separately.