Repository navigation
fix: isolate axios instance and token redaction per check - #1199
Merged
Merged
Conversation
When the repochecker runs as a library with parallel checks, each check now uses its own per-check axios instance (context.axios) rather than a shared module-level axiosInstance. This prevents a check started later from overwriting the authorized instance used by an earlier check still in flight. Token redaction is also now per-check-aware: a Set (knownTokens) collects every token registered via initAxios() so that redactString() redacts all known tokens regardless of which check is currently active. Changes: - downloadURL() now receives context as its first argument and uses context.axios (falling back to axiosInstance for safety) - getFilesList() uses context.axios instead of the module-level instance - getFile() passes context through to downloadURL() - All external callers of downloadURL() updated to pass context - effectiveGithubToken module-level var replaced by knownTokens Set Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mcm1957
force-pushed
the
fix/1193-isolate-per-check-axios
branch
from
October 14, 2026 11:43
85bb62c to
ffe156c
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.
Fixes #1193.
Problem
When repochecker runs as a library with parallel checks (as the dev-portal does), two module-level variables in
lib/common.jswere shared across all concurrent checks:axiosInstance— overwritten by eachinitAxios()call, so check B's instance would be used for check A's in-flight requests, sending A's requests with B's token.effectiveGithubToken— overwritten the same way, so errors from check A would only be redacted using B's token, potentially leaking A's token in logs.Fix
lib/common.jsaxiosInstanceentirely —initAxios()now only writescontext.axios;downloadURLandgetFilesListusecontext.axiosdirectly. The fallback was dead code: every caller either has a validcontext.axios(set before the pipeline runs) or is in local mode where axios is never used.effectiveGithubTokenwith aSet(knownTokens) that accumulates every token registered by anyinitAxios()call.redactString()iterates the set, so all known tokens are redacted regardless of which check is active.downloadURL(context, url, binary)Added
contextas first argument (was(url, binary)). Usescontext.axiosdirectly.getFilesList(context)Uses
context.axiosdirectly for both the jsdelivr request and the GitHub API fallback.Updated callers
lib/common.js—getFile()passescontextthrough todownloadURL()lib/M1000_IOPackageJson.js— three call sites updated; also fixed thegetFile(null, …)"TODO BE ADAPTED" call to passcontextinstead ofnulllib/M5500__JsonConfig.js— one call site updatedImpact
The dev-portal can lift its one-at-a-time serialization workaround (see ioBroker/dev-portal#203 and the TODO referencing this issue).
see: #1193
🤖 Generated with Claude Code