Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add experimental support for MSC3391: deleting account data #14714

Merged
merged 15 commits into from
Jan 1, 2023

Commits on Dec 20, 2022

  1. Configuration menu
    Copy the full SHA
    8173de4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8cd633f View commit details
    Browse the repository at this point in the history
  3. Add replication methods for removing account data

    We also rename existing account data methods, explicitly stating that
    they're for adding account data.
    anoadragon453 committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    d338a00 View commit details
    Browse the repository at this point in the history
  4. Add storage functions for deleting user/room account data

    We "delete" account data by UPDATE'ing any existing account data type to
    have a content of "{}". Clients will receive this change as is, which
    MSC3391 defines as the method for telling clients that an account data
    type has been deleted.
    
    We explicitly don't update rows that already have a content of "{}",
    such that we can use the number of update'd rows by the txn to check
    whether a delete actually occurred or not. This saves us a replication
    request/module API call in the case that it didn't, while retaining
    idempotency at the client-facing level.
    
    This comit additionally adds some method docstrings for
    simple_update{,_txn}.
    anoadragon453 committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    36d3bd2 View commit details
    Browse the repository at this point in the history
  5. Add handler, servlet methods for deleting user/room account data

    Servlet methods, which call handler methods, which call the new storage
    methods.
    anoadragon453 committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    dcfacc8 View commit details
    Browse the repository at this point in the history
  6. Allow deleting account data by PUT'ing with empty content

    MSC3391 specifies that for backwards compatibility purposes, setting an account data type's content to {}
    should be equivalent to deleting that account data. That call should succeed regardless of whether the
    account data existed previously or not.
    anoadragon453 committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    ef562a2 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0f81122 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2937973 View commit details
    Browse the repository at this point in the history
  9. changelog

    anoadragon453 committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    0520e4c View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2022

  1. Simplify txn.rowcount return check

    Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
    anoadragon453 and clokep committed Dec 29, 2022
    Configuration menu
    Copy the full SHA
    80e991f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3c62cd1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    36eab04 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2aa8986 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ccd4225 View commit details
    Browse the repository at this point in the history
  6. Convert queries in get_account_data_for_user_txn to raw SQL

    Doing the filtering in SQL should theoretically be more efficient.
    anoadragon453 committed Dec 29, 2022
    Configuration menu
    Copy the full SHA
    554dd36 View commit details
    Browse the repository at this point in the history