Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.6.0
    • JMAP
    • None

    Description

      WHY

      As a user i should be able to limit the number of results i want to receive from the server.
       {{[[ "Email/query",{
      "accountId": "ue150411c",
      "limit": 20,
      "filter":

      { "inMailbox": "myMailboxID" }

      }, "0" ]]}}
      The server should be able to have a limit of results he can send for a request, if the client didn't provided one or a larger than the supported one.
      It should then add the limit field to the response object to make the client aware of its limit.
       {{ "accountId": "ue150411c",
      "queryState": "09aa9a075588-780599:0",
      "limit": 100,
      "ids": [ "Ma783e5cdf5f2deffbc97930a",
      "M9bd17497e2a99cb345fc1d0a", ... ]
      }, "0" ]]}}

      HOW

      {{limit: UnsignedInt|null The maximum number of
      results to return. If null, no limit presumed. The server MAY choose to
      enforce a maximum limit argument. In this case, if a greater value is
      given (or if it is null), the limit is clamped to the maximum; the new
      limit is returned with the response so the client is aware. If a
      negative value is given, the call MUST be rejected with an
      invalidArguments error.}}

      • in the jmap.properties file, allow to have a propertie 'query.limit' which will be user to determine the limit used by the server.
      • accept the limit value in the request, and limit the result by the minimum of the client limit and the server limit.
      • if a negative value is given reject the request with an invalidArguments error.`

      DOD

      • write an integration test demonstrating the limitation of the number of results by the limit provided by the client
      • write an integration test demonstrating the limitation of the number of results by the limit enforced by the server if no limit from the client
      • write an integration test demonstrating the limitation of the number of results by the limit enforced by the server if a greater limit provided by the client
      • write an integration test demonstrating the limitation of the number of results by the limit provided by the client if this limit is smaller by the one enforced by the server.
      • write an integration demonstrating that the request is rejected with an invalidArguments error if the limit in the resquest is negative

      Attachments

        Activity

          People

            aduprat Antoine Duprat
            remi_kowalski Rémi Kowalski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: