Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify API for stanzas #3814

Merged
merged 7 commits into from
Oct 25, 2022
Merged

Unify API for stanzas #3814

merged 7 commits into from
Oct 25, 2022

Commits on Oct 21, 2022

  1. Rework mongoose_stanza_api

    - Move functions from mongoose_stanza_helper, because there is no need
      for two separate modules here.
    - Perform a fold over individual steps to organize error handling.
      The 'fold' function can be later reused, and moved e.g. to
      mongoose_api_common.
    - Handle more error cases, that were caught only by graphql-specific
      code. Now the REST api handles them as well.
    - Allow stanza without 'from' when 'user' is known.
      'from' is set to the user JID later in the routing process anyway.
    - Use Stanza ID not only for REST. MAM ID was used for GraphQL.
      We can add MAM ID as a separate GraphQL field when needed.
    - Set Stanza ID if the stanza does not already have one - this is
      similar to the behaviour for messages.
    - Do not treat 0 and <<>> values as undefined - this is a bit
      unexpected, and now in the unified API the user can always omit
      them when needed.
    - Set correct max_result_limit - previously it was set to 1.
    chrzaszcz committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    2fcdacd View commit details
    Browse the repository at this point in the history
  2. Update graphql stanza handlers with the new mongoose_stanza_api

    - Call the new API, which makes it possible to ged rid of some checks.
    - Remove unused helper functions.
    - Make format_error/2 more flexible.
    chrzaszcz committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    73f777f View commit details
    Browse the repository at this point in the history
  3. Update REST API for stanzas with the new mongoose_stanza_api

    - The new API makes it possible to avoid some checks
    chrzaszcz committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    cf7d0b8 View commit details
    Browse the repository at this point in the history
  4. Remove unused function

    chrzaszcz committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    2c19b3d View commit details
    Browse the repository at this point in the history
  5. Update GraphQL tests with the new mongoose_stanza_api

    - The Id is a stanza Id now.
    - It is possible to send a stanza with predefined Id and/or without 'from'.
    - Update error messages.
    chrzaszcz committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    bb6aa5c View commit details
    Browse the repository at this point in the history
  6. Update REST tests with the new mongoose_stanza_api

    - Update error messages
    - Test getting messages for a non-existent user
    chrzaszcz committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    d0bc113 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4c81efb View commit details
    Browse the repository at this point in the history