Fix type-check regression from stricter match() inference#6122
Open
pawelangelow wants to merge 2 commits into
Open
Fix type-check regression from stricter match() inference#6122pawelangelow wants to merge 2 commits into
pawelangelow wants to merge 2 commits into
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
Contributor
Code Coverage - Integration Tests
|
`address.match()` returns `RegExpMatchArray | null`, but the result was destructured directly. Recent dependency bumps (typeorm, socket.io) tightened type inference and surfaced this as a new strict-null error (TS2488), breaking `yarn type-check` on main. Guard the match before destructuring, keeping `host`/`port` typed as `string`. Also refresh the api/desktop TS baselines: the same bumps regenerated `api-client`, lowering recorded error counts that were never updated on main.
`natAddressString.match()` returns `RegExpMatchArray | null`, but was destructured directly. The typeorm 0.3.29 bump tightened inference and surfaced this as a strict-null TS2488 — caught by CI after the matching baseline entry had been removed without the code fix.
64c2eae to
62b777c
Compare
valkirilov
approved these changes
Jun 28, 2026
valkirilov
left a comment
Member
There was a problem hiding this comment.
note: Maybe we should enable the type-check job to run on Dependabot PRs, because this is why I missed that regression :/
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.
What
yarn type-checkwas failing on main after the typeorm 0.3.29 / socket.iobumps tightened type inference, surfacing latent strict-null errors where
String.match()results (RegExpMatchArray | null) were destructureddirectly:
clusterCursor.ts(cursor parser) andcluster.ioredis.client.ts(NAT address parsing).
host/portstay typed asstring.api-clientand lowered recorded error counts that were never updated.These were the only two
.match()-destructure sites in the API.Note
Low Risk
Small null-safety guards in cluster cursor and NAT parsing; baseline JSON only affects recorded type-check debt, not runtime behavior for valid inputs.
Overview
Restores
yarn type-checkafter stricter inference from dependency bumps (e.g. typeorm / socket.io) exposed TS2488 on direct destructuring ofRegExpMatchArray | null.Runtime/type fixes:
parseClusterCursorand the ioredis cluster NAT map parser now assignmatch/natMatch, return or skip when there is no match, then destructure sohost/portstay correctly narrowed.Baselines: Updates
redisinsight/api/.tscheck.rec.json(drops the fixedcluster.ioredis.cliententry) andredisinsight/desktop/.tscheck.rec.jsonto reflect lower recorded error counts after regeneratedapi-clientand related typing changes—not new product logic.Reviewed by Cursor Bugbot for commit 62b777c. Bugbot is set up for automated code reviews on this repo. Configure here.