Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
None
Description
According to JMAP spec: https://jmap.io/spec-core.html#changes section 5.5, a filter object in Email/query can either be an array of FilterOperator or FilterCondition.
Currently we are allowing the request to have properties from both types. This could lead to unexpected result when querying Email. For example:
{ "using": [ "urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail"], "methodCalls": [[ "Email/query", { "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6", "filter": { "inMailbox": "1", "operator": "AND", "conditions": [ { "hasKeyword": "custom" }, { "hasKeyword": "another_custom" } ] } }, "c1"] ] }
Email/query will ignore the inMailbox condition in the request above.
DoD
Integration tests to show that Email/query only accept an array of FilterOperator or FilterCondition in their respective correct structure.