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

Fix get_last_event_in_room_before_stream_ordering(...) finding the wrong last event #17295

Commits on Jun 12, 2024

  1. Fix get_last_event_in_room_before_stream_ordering(...) not finding …

    …the last event
    
    Previously, it would use the event with the lowest `stream_ordering` that was
    fetched (we want the highest `stream_ordering. `union` does not work how you
    might think at first and does not preserve the ordering of the operand queries.
    
    `union all` also doesn't necessarily have that gurantee but it does behave
    that way. See https://dba.stackexchange.com/questions/316818/are-results-from-union-all-clauses-always-appended-in-order/316835#316835
    MadLittleMods committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    87ad458 View commit details
    Browse the repository at this point in the history
  2. Add actual guranteed order for UNION

    We use `union all` because we don't need any of the deduplication logic
    (`union` is really a union + distinct). `UNION ALL`` does preserve the
    ordering of the operand queries but there is no actual gurantee that it
    has this behavior in all scenarios so we need the extra `ORDER BY` at the
    bottom.
    
    See https://dba.stackexchange.com/questions/316818/are-results-from-union-all-clauses-always-appended-in-order/316835#316835
    MadLittleMods committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    431b31e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d7f40ae View commit details
    Browse the repository at this point in the history
  4. Add changelog

    MadLittleMods committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    a8056ae View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3f317a9 View commit details
    Browse the repository at this point in the history
  6. Fix invalid syntax

    MadLittleMods committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    54bdc0c View commit details
    Browse the repository at this point in the history
  7. Merge branch 'develop' into madlittlemods/fix-and-tests-for-get_last_…

    …event_in_room_before_stream_ordering
    MadLittleMods committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    4d585b6 View commit details
    Browse the repository at this point in the history
  8. Update wording

    MadLittleMods committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    d3ba660 View commit details
    Browse the repository at this point in the history
  9. Merge branch 'develop' into madlittlemods/fix-and-tests-for-get_last_…

    …event_in_room_before_stream_ordering
    MadLittleMods committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    8a9cc2b View commit details
    Browse the repository at this point in the history