Skip to content

Conversation

@ComputerElite
Copy link

❗ Important Announcements

Click here for more details:

⚠️ Please Note: We do not accept all types of pull requests, and we want to ensure we don’t waste your time. Before submitting, make sure you have read our pull request guidelines: Pull Request Rules

🚫 Please Avoid Unnecessary Pinging of Maintainers

We kindly ask you to refrain from pinging maintainers unless absolutely necessary. Pings are for critical/urgent pull requests that require immediate attention.

📋 Overview

  • What problem does this pull request address?
    • Matrix notifications were previously not end to end encrypted
    • What features or functionality does this pull request introduce or enhance?
    • This pull requests adds the matrix-encrypted notification provider for provided end to end encrypted matrix messages
    • New dependencies have been added for providing e2ee matrix:
      • matrix-js-sdk: ^39.3.0: Matrix sdk required for implementation of matrix functionality. Simple api calls aren't enough anymore as key exchanges are more complex.
      • @matrix-org/matrix-sdk-crypto-nodejs: ^0.4.0-beta.1: Crypto module required by matrix-js-sdk for e2ee.

🛠️ Type of change

  • 🐛 Bugfix (a non-breaking change that resolves an issue)
  • ✨ New feature (a non-breaking change that adds new functionality)
  • ⚠️ Breaking change (a fix or feature that alters existing functionality in a way that could cause issues)
  • 🎨 User Interface (UI) updates
  • 📄 New Documentation (addition of new documentation)
  • 📄 Documentation Update (modification of existing documentation)
  • 📄 Documentation Update Required (the change requires updates to related documentation)
  • 🔧 Other (please specify):

📄 Checklist

  • 🔍 My code adheres to the style guidelines of this project.
  • 🦿 I have indicated where (if any) I used an LLM for the contributions
  • ✅ I ran ESLint and other code linters for modified files.
  • 🛠️ I have reviewed and tested my code.
  • 📝 I have commented my code, especially in hard-to-understand areas (e.g., using JSDoc for methods).
  • ⚠️ My changes generate no new warnings.
  • 🤖 My code needed automated testing. I have added them (this is an optional task).
  • 📄 Documentation updates are included (if applicable).
  • 🔒 I have considered potential security impacts and mitigated risks.
  • 🧰 Dependency updates are listed and explained.
  • 📚 I have read and understood the Pull Request guidelines.

📷 Screenshots or Visual Changes

  • UI Modifications: Added Matrix (encrypted) notification provider ui
  • Before & After: Include screenshots or comparisons (if applicable).
Event Before After
UP Before After
DOWN Before After
Certificate-expiry Before After
Testing Before After

Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

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

Not sure if you want a review yet. this is still a draft.

Instead of adding this to a new notification provider, could you add this to the regular matrix notification instead, but with a selector if a user wants the non-encrypted vs non-encrypted?

@CommanderStorm CommanderStorm added the pr:please address review comments this PR needs a bit more work to be mergable label Jan 9, 2026
@ComputerElite
Copy link
Author

Yeah I still want to work on this. Will change that. My problem currently is that I cannot feet the matrix season of uptime kuma verified. Therefore it is encrypted but has an indicator with a red exclamation mark saying that the senders session isn't verified. If someone has an idea on how to fix that lmk

@CommanderStorm
Copy link
Collaborator

CC people who messaged in the thread if they have an idea to getting verified by matrix.
@Aviator7290 @cestoliv

Comment on lines +45 to +49
await new Promise((resolve) => {
MatrixEncrypted.client.once("sync", (state) => {
if (state === "PREPARED") resolve();
});
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this might be the issue for the verification, but I am not a huge matrix user, so don't know.

@cestoliv is doing the following here

await new Promise<void>((resolve) => {
  this.matrixClient.once(ClientEvent.Sync, () => {
    // Send encrypted message, even if member isn't trusted
    this.matrixClient.setGlobalErrorOnUnknownDevices(false)
    resolve()
  })
})

accessToken: notification.accessToken,
userId: notification.userId,
deviceId: notification.deviceId,
//cryptoStore: MatrixEncrypted.store,
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe this?


log.info("Matrix", "Sending encrypted message…");

await MatrixEncrypted.client.sendMessage(notification.internalRoomId, {
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe you need to join the room here and upload the keys (whatever this does) here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:resolve-merge-conflict pr:please address review comments this PR needs a bit more work to be mergable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Matrix notifications end-to-end encryption implementation

2 participants