ews: fix restriction relop element names (IsLessThanOrEqualTo/IsGreaterThanOrEqualTo) - #338
Open
nourdineb-ops wants to merge 1 commit into
Open
nourdineb-ops wants to merge 1 commit into
nourdineb-ops wants to merge 1 commit into
Conversation
…erThanOrEqualTo)
The RestrictionRelop StrEnum used 'IsLessThanOrEqual'/'IsGreaterThanOrEqual'
(missing the trailing 'To'), but the real EWS schema element names are
'IsLessThanOrEqualTo'/'IsGreaterThanOrEqualTo'. Since StrEnum matches
directly against the XML element name, any client using the correctly-
spelled real Exchange element name got rejected with:
E-3220: unknown restriction type 'IsLessThanOrEqualTo'
ErrorInvalidRestriction
...as a normal (HTTP 200) EWS fault, not an HTTP-level error - easy to
miss without a full traffic capture.
Found live: Outlook (New Outlook for Mac) paginates a folder's item list
backward in time via repeated FindItem calls restricted with
IsLessThanOrEqualTo on item:DateTimeReceived (MaxEntriesReturned=100,
sorted descending, Offset=0/BasePoint=Beginning each time - a date-cursor
style, not IndexedPageItemView offsets). Every such call failed with the
above fault, which Outlook then silently gives up on (no error surfaced
to the user), matching the reported symptom exactly: initial sync loads
fine, but scrolling further back ("load more") never brings in older
mail, indefinitely.
Confirmed via a live mitmproxy capture of the actual failing request/
response pair reproduced in Outlook, and confirmed fixed the same way
after rebuilding with this change (E-3220 no longer occurs, older items
load normally on scroll).
Contributor
Author
|
Following up — this has been open two weeks with no comments. Small, self-contained fix (two misspelled restriction relop element names, breaks New Outlook's date-cursor |
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.
Problem
Enum::RestrictionRelop(exch/ews/enums.hpp) listsIsLessThanOrEqual/IsGreaterThanOrEqual, missing the trailingTothat the real EWS schema element names have (IsLessThanOrEqualTo/IsGreaterThanOrEqualTo). SinceStrEnummatches directly against the incoming XML element name (viatRestriction::deserialize()→Enum::RestrictionRelop(name).index()), any client using the correctly-spelled real element name gets rejected:This is a normal HTTP 200 EWS-level fault (
ResponseClass="Error"inside a successful SOAP response), not an HTTP-level error - invisible to nginx/HTTP access logs and to gromox-http's own dispatch-level "unknown request" warning path, which only fires for unrecognized operation names, not unrecognized restriction element names within an otherwise-validFindItem. Only a full request/response body capture surfaces it.Real-world impact
New Outlook for Mac paginates a folder's item list backward in time via repeated
FindItemcalls using a date-cursor style:IndexedPageItemView MaxEntriesReturned="100" Offset="0" BasePoint="Beginning", sorted descending byitem:DateTimeReceived, restricted withIsLessThanOrEqualToagainst the timestamp of the oldest currently-loaded item. Every such call fails with the fault above; Outlook silently gives up (no error surfaced to the user) instead of retrying or reporting anything. Symptom: initial sync loads recent mail fine, but scrolling back further ("there are more items on the server" / conversation "load more") never brings in anything older, indefinitely - looks like data loss, but every item is still present server-side and reachable via search (FindItemwith other restriction types still works).Fix
Rename the two enum values (and their
STR()string literals, which are stringified from the symbol name) to match the actual schema spelling. Verified against Microsoft's EWSSearchExpression/RestrictionTypereference - the complete comparison set isIsEqualTo, IsGreaterThan, IsGreaterThanOrEqualTo, IsLessThan, IsLessThanOrEqualTo, IsNotEqualTo(plusAnd/Or/Contains/Excludes/Exists/Not, handled separately and already correctly named) - no other entries in this family are affected.Testing
Reproduced live via a supervised mitmproxy capture of the actual failing
FindItemrequest/response pair from a real Outlook client hitting a production gromox-http instance. Rebuiltexch/ewswith this change, redeployedlibgromox_ews.so, restartedgromox-http: the same restriction no longer errors, and the user confirmed older mail now loads correctly on scroll in Outlook.