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

Move SSE to Matrix #2116

Merged
merged 175 commits into from
Mar 10, 2025
Merged

Move SSE to Matrix #2116

merged 175 commits into from
Mar 10, 2025

Conversation

backspace
Copy link
Contributor

@backspace backspace commented Feb 4, 2025

This repurposes existing Matrix “session rooms” (where the auth conversation is conducted) to also broadcast “realm events”, which were formerly transmitted via Server-Sent Events. It includes several TODOs to completely remove the traces of SSE, including:

  • service:message-service no longer needs to exist
  • $REALM/…_message endpoint for subscribing can be removed
  • file watchers to generate realm events in development will go away, relying instead on Boxel Tools

It’s unfortunately a large PR but there were no obvious seams to further decompose it at. Thankfully most of the changes are mechanical, replicated across many files.

The high-level changes to host tests are:

  • removal of setupServerEvents and the TestContextWithSSE that provided it
  • flattening of expectEvents, no more callback
    • most assertions on expected events are gone, they are covered elsewhere
  • occasional addition of settled and waitUntil to ensure realm events have propagated
  • addition of setupMockMatrix when missing, the MockUtils it returns is required for realm setup now

Otherwise the changes include:

  • adding Matrix event types for each flavour of realm event
  • updating the interfaces of event listeners to use those new types
  • removal of a similar expectEvent helper in the realm server’s realm-endpoints-test

@backspace backspace added the enhancement New feature or request label Feb 4, 2025
@backspace backspace self-assigned this Feb 4, 2025
Copy link

github-actions bot commented Feb 4, 2025

Host Test Results

    1 files  ±0      1 suites  ±0   25m 8s ⏱️ +6s
798 tests ±0  796 ✔️ ±0  2 💤 ±0  0 ±0 
803 runs  ±0  801 ✔️ ±0  2 💤 ±0  0 ±0 

Results for commit dfab792. ± Comparison against base commit 160dab0.

This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
Chrome 133.0 ‑ Integration | card-copy: can copy mulitple cards
Chrome 133.0 ‑ Integration | card-copy: can copy multiple cards

♻️ This comment has been updated with latest results.

@backspace backspace requested a review from a team March 6, 2025 22:25
@backspace backspace marked this pull request as ready for review March 6, 2025 22:25
Copy link
Contributor

@lukemelia lukemelia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have time to try this out right now, but the code looks good. Very excited to see the test improvements land!

# Conflicts:
#	packages/host/tests/acceptance/code-submode/schema-editor-test.ts
I don’t understand why this is happening 😞
Copy link
Contributor

@habdelra habdelra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto with what luke said. overall looks great, but too large for me to get deep into it.

# Conflicts:
#	packages/host/app/resources/room.ts
#	packages/host/app/services/matrix-service.ts
@backspace backspace merged commit 4be9597 into main Mar 10, 2025
59 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants