Preserve caller fetch modifiers when adding keyword options - #746
Conversation
|
I'm on the fence about this one. On the one hand, the current behavior is potentially dangerous and unexpected. On the other hand, the So I don't want to do anything to draw attention to it or encourage it's use. But it is kind of a bug. |
nevans
left a comment
There was a problem hiding this comment.
Since mod is unsupported and I want to remove it anyway, this doesn't need to add a new test.
But, lets not explicitly check against the two supported modifiers, because that requires extra diligence in keeping this up-to-date as support for other modifiers is added
Lets not explicitly check against the two supported modifiers, because that requires extra diligence in keeping this up-to-date as support for other modifiers is added.
|
I'm not even going to classify this as a bugfix (for the release notes), since |
Summary
Copy a supplied fetch modifier array before appending PARTIAL or CHANGEDSINCE keyword options. Reusing the same array currently accumulates duplicate modifiers, and frozen arrays raise FrozenError. Calls without keyword additions retain the existing allocation behavior.
Reproduction
Verification
rake teston this isolated branch: 1726 tests, 12599 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications, Ruby 4.0.6 via rbenv. Baseline also passes 1,726 tests; assertion counts vary slightly between runs.6d2ef7a636a1e2449187a83b06ac7a5baa54ead2; runtime differs from released 0.6.6 only in documentation before this change. Existing upstream PR searches found no matching fix.Compatibility and limits
No signature, version or dependency change. Caller modifier arrays are no longer modified by keyword additions, including on validation errors. Only a shallow copy is needed; contained modifier objects are not changed. The reproduction stubs only command dispatch to stay offline. No production or external IMAP service used. Other Ruby/OS versions were not run locally. Local success does not imply upstream CI approval or exhaustive coverage.