Skip to content

support regex based filtering#26

Open
nvdk wants to merge 12 commits into
mu-semtech:masterfrom
nvdk:feature/regex-based-filtering
Open

support regex based filtering#26
nvdk wants to merge 12 commits into
mu-semtech:masterfrom
nvdk:feature/regex-based-filtering

Conversation

@nvdk
Copy link
Copy Markdown
Member

@nvdk nvdk commented Dec 11, 2025

This extends the optimized filtering PR (#21) with support for regex matching. Mostly opening the PR here for awareness. This can be combined with #24 if you need multiple matches for a give rule.

nvdk and others added 12 commits December 11, 2025 16:30
this greatly reduces the size of delta messages in stacks with large data changes.
this tries to optimize filtering and match detection in two ways:
- by grouping on match pattern: this means we only do detection and filtering
once for a given match pattern (takes the pattern and sendMatchesOnly into
account)
- by doing matching before origin filter, since the latter seems more costly
this is not the prettiest of solutions, but it does achieve the same thing.
bonus is it only happens once on startup
it's mentioned in the expressjs best practices (and elsewhere) that process.env should be used sparingly:

| If you need to write environment-specific code, you can check the value of NODE_ENV with process.env.NODE_ENV. Be aware that checking the value of any environment variable incurs a performance penalty, and so should be done sparingly.
https://expressjs.com/th/advanced/best-practice-performance.html#set-node_env-to-production

it seems this is because process.env is a getter that processes the ENV array each time
- avoid recalculating changedTriples in every loop
- if sendMatchesOnly is true, a changeset might be empty. Do not send a changeset in this case
- don't redo checking matches if this was already done because of `sendMatchesOnly`
madnificent added a commit that referenced this pull request Dec 22, 2025
We probably want to have some structure to better filter out quads and better
filter out information sent to consumers (also see #26).

This experiment allows dropping the access rights used in the request's header.

It doesn't allow dropping the mu-session-id though doing so could allow for more
involved folding and we see no reason not allow this too.

The mu-auth-allowed-groups are still persisted in the delta body.  It's not
documented to be available there so we could remove it there too.

A function can be specified to alter the access rights.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant