Repository navigation
chore(solana): replace in and type the Solana subscription services - #631
Open
ulissesferreira wants to merge 1 commit into
Open
ulissesferreira wants to merge 1 commit into
ulissesferreira wants to merge 1 commit into
Conversation
ulissesferreira
temporarily deployed
to
default-branch
November 17, 2026 02:13 — with
GitHub Actions
Inactive
|
This branch was previously deployed
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.



Description
Clears the Oxlint suppressions for the Solana subscription services. The 9
internal-snaps/no-in-operatorviolations are replaced byhasProperty()from@metamask/utils, which is a drop-in own-property check with the same narrowing behaviour (importers inparentchains are no longer consulted), so no logic or control flow was restructured. The rest is typing hygiene: the WebSocket payload parsers, the notification-handler registry and the test mocks are now typed instead ofany, redundant assertions and leftover return-type gaps are filled in.This is behaviour-neutral: the only runtime-visible differences are that
hasProperty()reads own properties (the point of the rule) and thatString()is applied explicitly to the already-never-narrowed event type in the warning log. Two test mock factories now return a realWebSocketMessage(they gained theoriginfield the type requires); the parser under test never readsorigin.Changes
packages/solana-wallet-snap/src/core/services/subscriptions/SubscriptionService.ts—hasProperty()in the confirmation guards and#handleFailure;message: object/obj: unknowninstead ofany;DispatchableNotificationHandlerfor the notification dispatch; arrow wrappers for the#isExpired/#isNotExpiredfilters; explicit return type onsendSubscriptionMessage(no-in-operator,no-explicit-any,no-unsafe-*,unbound-method,explicit-function-return-type)packages/solana-wallet-snap/src/core/services/subscriptions/SubscriptionRepository.ts—hasProperty()infindBy(no-in-operator)packages/solana-wallet-snap/src/core/services/subscriptions/parseWebSocketMessage.ts— owns alet jsonParsed: unknownandhasProperty()on the SIP-20 payload (no-in-operator,no-explicit-any,no-unsafe-assignment,no-unsafe-return)packages/solana-wallet-snap/src/core/services/subscriptions/SignatureMonitor.ts— dropped the redundanttransaction.typeassertion (no-unnecessary-type-assertion)packages/solana-wallet-snap/src/core/services/subscriptions/KeyringAccountMonitor.ts,WebSocketConnectionRepository.ts— explicit return types (explicit-function-return-type)packages/solana-wallet-snap/src/core/services/subscriptions/WebSocketConnectionService.ts—String(type)in the unknown-event warning (restrict-template-expressions)packages/solana-wallet-snap/src/core/services/subscriptions/SubscriptionService.test.ts,SignatureMonitor.test.ts,KeyringAccountMonitor.test.ts,WebSocketConnectionRepository.test.ts,WebSocketConnectionService.test.ts— typed mocks and helpers,it.eachtable for the background-event cases (no-explicit-any,no-unsafe-*,explicit-function-return-type,no-conditional-in-test)oxlint-suppressions.json— regenerated with--prune-suppressionsQuality gates
yarn lint:oxlint packages/solana-wallet-snap— clean, 12 suppressions entries removed (60 violations)tsc --noEmit— cleanvitest run— 88 files, 1124 passed | 4 skipped | 1 todooxfmt --check— clean