feat(dev-tools): rotate sessions tool and experiment feature flags#700
Draft
Just-Insane wants to merge 15 commits intoSableClient:devfrom
Draft
feat(dev-tools): rotate sessions tool and experiment feature flags#700Just-Insane wants to merge 15 commits intoSableClient:devfrom
Just-Insane wants to merge 15 commits intoSableClient:devfrom
Conversation
Add scripts/inject-client-config.js which reads HOMESERVER_LIST, ELEMENT_CALL_URL, EXPERIMENTS and other config keys from the GH Actions environment and merges them into config.json at build time. CI workflows pass these through via env; the setup action prints an injected-config summary in the job summary. knip.json updated to include the new script as an entry point.
…ntages useClientConfig.ts gains getExperimentVariant() which deterministically buckets a userId into a variant using a hash of userId+experimentName, then checks it against rolloutPercentage. Experiment defaults shape is typed so all callers get compile-time checking of known experiment names.
ExperimentsPanel shows every experiment name, current variant, rollout percentage, and whether the user is enrolled — readable without opening the console. DevelopTools.tsx wires it into the developer settings tab.
- Import KnownMembership from $types/matrix-sdk instead of matrix-js-sdk/lib/types - Use Promise.allSettled to handle partial failures and report accurate count - Add window.confirm confirmation before discarding sessions - Clarify changeset: 'encryption sessions' not 'sessions'
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidates two developer-tooling branches. Adds a "Rotate Sessions" tool to Developer Tools settings and an Experiments panel for percentage-rollout feature flags, with build-time injection from environment variables.
Changes
feat/devtool-rotate-sessions
prepareToEncrypt()on all joined rooms to force Megolm session rotation, useful for testing encryption key rotation flows.feat/feature-flag-env-vars
deepMergeprototype-pollution fix: block keys like__proto__,constructor, andprototypein the deep-merge utility used to inject runtime config.scripts/inject-client-config.jsreadsCLIENT_CONFIG_*environment variables at build time and merges them intoconfig.json, enabling CI/CD pipelines and GitHub Actions to configure feature flags without modifying the source file.useExperimentVariant): typed helper that deterministically buckets users into experiment variants by percentage rollout, based on user ID hash.ExperimentsPanel: new settings panel under Developer Tools listing active experiments and their variant assignments.useClientConfigtest: unit tests covering experiment bucketing logic and theuseExperimentVarianthook.Testing Checklist
CLIENT_CONFIG_*env vars at build time: merged into runtime config correctlydeepMergewith__proto__key: rejected, no prototype pollutionChangeset
feat:Rotate Sessions developer toolfeat:Experiment bucketing with env-var-injectable configfix:Prototype-pollution guard in deepMerge