fix(gateway): don't force-enable matrix-sdk via the metrics feature#1139
Open
resumeparseeval wants to merge 1 commit into
Open
fix(gateway): don't force-enable matrix-sdk via the metrics feature#1139resumeparseeval wants to merge 1 commit into
resumeparseeval wants to merge 1 commit into
Conversation
The `metrics` feature listed `moltis-matrix/metrics` (non-weak), which turns on the optional `moltis-matrix` dependency — and so compiles the whole `matrix-sdk` — whenever metrics are enabled, even for builds that disable the Matrix channel. Every sibling channel in the same list already uses the weak `dep?/feature` form (`moltis-discord?/metrics`, `moltis-msteams?/metrics`, `moltis-nostr?/metrics`, `moltis-signal?/metrics`); matrix is the lone inconsistency. Make it weak too: `moltis-matrix?/metrics`. The `metrics` feature now only enables matrix's own metrics when matrix is independently enabled, instead of dragging matrix into otherwise matrix-free builds. Verified with cargo tree: - `--no-default-features --features metrics` no longer pulls matrix-sdk. - the default feature set still includes matrix-sdk (no behavior change).
Contributor
Greptile SummaryThis PR updates the gateway metrics feature wiring.
Confidence Score: 5/5This looks safe to merge.
|
| Filename | Overview |
|---|---|
| crates/gateway/Cargo.toml | Changes the Matrix metrics feature reference to match the weak forwarding pattern used by the other optional channel crates. |
Reviews (1): Last reviewed commit: "fix(gateway): don't force-enable matrix-..." | Re-trigger Greptile
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
The gateway's
metricsfeature listsmoltis-matrix/metricswithout the weak?qualifier, so enablingmetricsforce-enables the optionalmoltis-matrixdependency — pulling the entirematrix-sdkinto the build even when the Matrix channel is otherwise disabled.Every other optional channel in the same list already uses the weak form:
moltis-matrixis the only inconsistency. The fix makes it weak (moltis-matrix?/metrics):metricsnow enables matrix's metrics only when matrix is independently enabled, instead of dragging it into matrix-free builds.Why this matters
A build that wants metrics but no Matrix (
--no-default-features --features "...,metrics"withoutmatrix) currently still compilesmatrix-sdk. Besides the wasted build time, on the repo's pinned nightlymatrix-sdk 0.16currently fails to compile (error: queries overflow the depth limit), so this unnecessary edge makes otherwise-valid matrix-free builds fail. No effect on the default feature set, which enablesmatrixanyway.Validation
Completed (via
cargo tree)cargo tree -p moltis-gateway --no-default-features --features metrics -i matrix-sdk→ "nothing to print" (was previously pullingmatrix-sdk v0.16.0).cargo tree -p moltis-gateway -i matrix-sdk(default features) → still resolvesmatrix-sdk— no regression for default builds.cargo metadataparses cleanly.Remaining (CI / maintainer)
just release-preflight/ full build matrix.Manual QA
Build the gateway with metrics but without Matrix and confirm
matrix-sdkis absent from the compile set: