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

Only report undecryptable events once #12501

Merged
merged 15 commits into from
May 20, 2024

Conversation

uhoreg
Copy link
Member

@uhoreg uhoreg commented May 7, 2024

Fixes element-hq/element-web#27421

Stores the events in a scalable Bloom filter, rather than as a set. The scalable Bloom filter expands its capacity as items are added, to avoid false-positives, without needing to pre-allocate space. The JSON-encoded version of the Bloom filter takes about 8 characters per entry, as opposed to >40 characters if we stored it as an array of event IDs.

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • Sign-off given on the changes (see CONTRIBUTING.md).

@uhoreg uhoreg added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label May 7, 2024
@uhoreg
Copy link
Member Author

uhoreg commented May 7, 2024

TypeScript check fails due to something wrong in a dependency (I suspect there's a mistake in a type definition). Not sure what's the best way to fix this.

@richvdh
Copy link
Member

richvdh commented May 17, 2024

TypeScript check fails due to something wrong in a dependency (I suspect there's a mistake in a type definition). Not sure what's the best way to fix this.

I've filed Callidon/bloom-filters#72 about this, and pinned @types/seedrandom to 3.0.4 to work around it.

@richvdh
Copy link
Member

richvdh commented May 17, 2024

This seems to work now. It is based on #12546

@@ -182,6 +183,7 @@
"@types/react-transition-group": "^4.4.0",
"@types/sanitize-html": "2.11.0",
"@types/sdp-transform": "^2.4.6",
"@types/seedrandom": "<3.0.5",
Copy link
Member

Choose a reason for hiding this comment

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

this is pinned to work around Callidon/bloom-filters#72

Copy link
Member

Choose a reason for hiding this comment

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

This sounds like it should have been in resolutions rather than dev deps

Copy link
Member

@t3chguy t3chguy May 23, 2024

Choose a reason for hiding this comment

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

#12551 is why - renovate is going to keep trying to update it.

@richvdh richvdh marked this pull request as ready for review May 20, 2024 11:05
@richvdh richvdh requested review from a team as code owners May 20, 2024 11:05
@richvdh
Copy link
Member

richvdh commented May 20, 2024

Since I've written a good portion of this, could I get review from someone who isn't me or @uhoreg please?

@richvdh richvdh added this pull request to the merge queue May 20, 2024
Merged via the queue into matrix-org:develop with commit 1bb70c5 May 20, 2024
27 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Posthog: Stop double reporting UTD events when app is relaunched.
4 participants