Repository navigation
Conversation
CI runs 'npm audit' as a required step, and the current lockfile fails it with 6 vulnerabilities (3 high, 2 moderate, 1 low), all in dev-tool transitive dependencies: - serialize-javascript <=7.0.4 (high, RCE + DoS advisories) via mocha - diff 5.0.0-5.2.1 (jsdiff DoS in parsePatch/applyPatch) via mocha - js-yaml 4.0.0-4.3.0 (quadratic-CPU DoS advisories) via eslint/mocha - brace-expansion (DoS family) via minimatch consumers - ajv <6.14.0 (ReDoS) via eslint None are fixable by 'npm audit fix' alone: even mocha@latest still pins vulnerable serialize-javascript/diff ranges. Add npm 'overrides' pinning each package to its patched line and regenerate the lockfile. Runtime dependencies are untouched — the diff is dev-tree only, and the full CI sequence passes clean: npm ci, npm run lint, npm test (84 passing), npm audit (found 0 vulnerabilities).
similar() crashed with "Cannot read properties of null (reading
'length')" when the app page carried no similar-apps cluster at all
(region-restricted apps, apps without recommendations):
extractDataWithServiceRequestId returns null/undefined when the ag2B9c
service request section is absent, and the guard read .length on it
before the intended Error('Similar apps not found') could fire.
- parseSimilarApps: accept only a non-empty array of clusters; anything
else throws the domain error, so callers can distinguish "no similar
apps" from a parser bug.
- processFirstPage: same guard for the cluster page's app list section
(the mapping feeds R.map, which crashes the same way on undefined).
parseSimilarApps is now also exported for tests so the guard is pinned
with a synthetic payload instead of depending on which live apps happen
to lack a cluster today.
Fixes facundoolano#701
Author
|
Note: CI's |
Agi-Asi
force-pushed
the
fix/similar-missing-clusters-crash
branch
from
August 27, 2026 09:40
12efb52 to
0a4561f
Compare
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.
Problem
similar()fails with aTypeErrorinstead of the intended domain error when an app page has no similar-apps cluster (region-restricted apps, apps without recommendations):as reported in #701. Root cause:
extractDataWithServiceRequestIdreturnsnull/undefinedwhen theag2B9cservice request section is absent from the parsed page, andparseSimilarAppsreads.lengthon that before the intendedError('Similar apps not found')can fire. Callers can't distinguish "this app has no similar apps" from a parser bug.Fix
parseSimilarApps: accept only a non-empty array of clusters; anything else throws the domain errorSimilar apps not found.processFirstPage(same file): the same guard for the cluster page's app list section — its mapping feedsR.map, which crashes the same way onundefinedinput.parseSimilarAppsis additionally exported (named export; the default export is unchanged) so the guard can be pinned with a synthetic payload — which live apps happen to lack a cluster changes over time, so a live-repro test would be flaky.Testing
ag2B9csection throws/Similar apps not found/instead of aTypeError.com.mojang.minecraftpe,com.spotify.music).npm test: 85 passing, 0 failing;npm run lint: cleanFixes #701