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

Support MSC4140: Delayed events (Futures) #17326

Merged
merged 86 commits into from
Sep 23, 2024

Commits on Aug 6, 2024

  1. Configuration menu
    Copy the full SHA
    044f57a View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2024

  1. Configuration menu
    Copy the full SHA
    82c5437 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    645e225 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5472588 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    14cf8ec View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d8e3135 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f9261b9 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d3ea968 View commit details
    Browse the repository at this point in the history
  8. Check startup delayed state events for same state

    If on startup there are multiple delayed state events to be sent, do not
    send multiple events that target the same state key for a room.
    AndrewFerr committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    c34221f View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f2d8144 View commit details
    Browse the repository at this point in the history
  10. Update copyright years

    AndrewFerr committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    d2c9ca7 View commit details
    Browse the repository at this point in the history
  11. Add changelog

    AndrewFerr committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    56c6d87 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    c24c41b View commit details
    Browse the repository at this point in the history
  13. Increase expected db_txn_counts

    Include counts for the delayed event handler's state event callback
    AndrewFerr committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    6e382df View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    7b79db0 View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2024

  1. Configuration menu
    Copy the full SHA
    8b3fb49 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2024

  1. Configuration menu
    Copy the full SHA
    32cbacf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    71e8997 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2024

  1. Configuration menu
    Copy the full SHA
    fafaa03 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3afa3cf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b3d4d6c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    48d8126 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5ce3787 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bee52bd View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6252708 View commit details
    Browse the repository at this point in the history
  8. Remove TODO to verify delayed event contents

    because they are already verified when the event is scheduled
    AndrewFerr committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    b1f74a8 View commit details
    Browse the repository at this point in the history
  9. Don't bother using a CRC for delay_ids

    as all they need to be is a random opaque string
    AndrewFerr committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    221e0af View commit details
    Browse the repository at this point in the history
  10. Assert non-negative delay; allow missing delay ID

    A delayed event missing from the DB on timeout isn't destructive, so
    don't worry about asserting for its presence. Do post a debug message
    explaining its absence, though
    AndrewFerr committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    08f54ca View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    56abbb9 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    c4e80ad View commit details
    Browse the repository at this point in the history
  13. Use built-in method to check for RETURNING support

    and remove some now-unneeded imports
    AndrewFerr committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    99e421c View commit details
    Browse the repository at this point in the history
  14. Properly indent comment block

    Co-authored-by: Andrew Morgan <[email protected]>
    AndrewFerr and anoadragon453 authored Aug 15, 2024
    Configuration menu
    Copy the full SHA
    335eeb7 View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2024

  1. Remove support for delayed event parents

    as they are not part of MSC4140 anymore (and if reinstated, will likely
    require their own MSC)
    AndrewFerr committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    21311fb View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2024

  1. Fix comments

    AndrewFerr committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    3478118 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    00217f3 View commit details
    Browse the repository at this point in the history
  3. Don't bother handling DB key collisions

    because generated delay IDs should have enough entropy for collisions to
    be extremely rare
    AndrewFerr committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    90cc8b5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8a65c77 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    47b6e69 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e0e6802 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5672d0d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    85cb72f View commit details
    Browse the repository at this point in the history
  9. Remove delayed event from DB on cancel

    This was always supposed to be done, but was lost a few commits ago
    AndrewFerr committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    974463f View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2024

  1. Make user_localpart first column of DB key

    to allow for faster queries on user_localpart alone
    AndrewFerr committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    05accda View commit details
    Browse the repository at this point in the history
  2. Don't handle missing delays in DB lookup

    because delay is now a mandatory field of all delayed events
    AndrewFerr committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    2a9069c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    57b7229 View commit details
    Browse the repository at this point in the history
  4. Remove redundant delay value check

    Should have been done in 47b6e69
    AndrewFerr committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    4dc41dc View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2024

  1. Refactor max delay config

    - Move from "experimental" config section to "server"
    - Allow to be set to None to disable delayed event sending
    - Parse as a duration string, not just an integer of milliseconds
    - Set default value to None, i.e. disable delayed events by default
    AndrewFerr committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    3ce7305 View commit details
    Browse the repository at this point in the history
  2. Refactor delayed event processing

    - Instead of popping events to send before they persist, mark them as
      in-progress and remove them only once persisted
    - Check for timed out events in bulk
    - Eschew locks in favour of DB-level atomicity
    AndrewFerr committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    be094e6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2aed40b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    235c432 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b03312b View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2024

  1. Merge 'develop' & bump schema version

    Bump the schema version for delayed events to 88, to avoid conflict with
    schema version 87 for sliding sync
    AndrewFerr committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    afff231 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2024

  1. Configuration menu
    Copy the full SHA
    86c0e97 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    798c79e View commit details
    Browse the repository at this point in the history
  3. Lint

    AndrewFerr committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    186e55d View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2024

  1. Update documentation

    AndrewFerr committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    a3fbdd3 View commit details
    Browse the repository at this point in the history
  2. Fix top-level comment

    AndrewFerr committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    ef7284f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    92d352c View commit details
    Browse the repository at this point in the history
  4. Fix unit tests

    AndrewFerr committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    0ab82f5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9025922 View commit details
    Browse the repository at this point in the history
  6. Pick a nit

    AndrewFerr committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    c3ad95d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1dbbb74 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3e9f76f View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    d36c89f View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2024

  1. Nitpick: rename inner function

    Remove leading underscore for consistency with other inner functions
    AndrewFerr committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    e0225eb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e741c56 View commit details
    Browse the repository at this point in the history
  3. Lint

    AndrewFerr committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    2d79506 View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2024

  1. Put retrieved delayed events in field for GET

    This is to match what is specified in the MSC.
    Also add a unit test for this.
    AndrewFerr committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    e41b5a1 View commit details
    Browse the repository at this point in the history
  2. Lint imports

    AndrewFerr committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    94048f7 View commit details
    Browse the repository at this point in the history
  3. Don't use data-modifying CTE in WITH for sqlite

    Also don't try to use ordered RETURNING rows for sqlite either
    AndrewFerr committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    8e3df61 View commit details
    Browse the repository at this point in the history
  4. Remove TODO for returning transaction IDs

    GET /delayed_events is no longer specced to return them
    AndrewFerr committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    dd3c746 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a60fa7f View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2024

  1. Configuration menu
    Copy the full SHA
    092793a View commit details
    Browse the repository at this point in the history
  2. Reword docstring

    AndrewFerr committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    1d75060 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    34ed582 View commit details
    Browse the repository at this point in the history
  4. Don't expect to remember next_send_ts

    See DelayedEventsHandler._next_send_ts_changed for details
    AndrewFerr committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    a6cf11c View commit details
    Browse the repository at this point in the history
  5. Add more unit tests

    AndrewFerr committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    fb04833 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0bf03ad View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    3860f75 View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2024

  1. Use default ts for delayed events sent on request

    When a delayed event is sent on-demand, let its timestamp be set to
    whatever time the event is sent at, like non-delayed events.
    
    Only timed-out delayed events should have their timestamps set to their
    timeout time, as that is the time they are meant to be sent.
    AndrewFerr committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    8ee1558 View commit details
    Browse the repository at this point in the history
  2. Don't use attr.asdict

    as it converts fields (namely RoomIDs) to dicts too
    AndrewFerr committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    cbedade View commit details
    Browse the repository at this point in the history
  3. Fix path regex for delayed_events updating

    Require non-empty delay ID in path
    AndrewFerr committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    7ee57d8 View commit details
    Browse the repository at this point in the history
  4. Fix SQL query

    Add missing WHERE clause in branched case
    AndrewFerr committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    10b9dee View commit details
    Browse the repository at this point in the history
  5. Add more unit tests

    AndrewFerr committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    a723f6b View commit details
    Browse the repository at this point in the history
  6. Run Complement tests

    AndrewFerr committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    f32cf9c View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2024

  1. Configuration menu
    Copy the full SHA
    dfde3c2 View commit details
    Browse the repository at this point in the history