Repository navigation
fix: Improve guidance for Runtime API connection resets - #432
pablomoreno61 wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| return error.code === 'ECONNRESET' || | ||
| /ECONNRESET/i.test(error.message || '') || | ||
| /socket hang up/i.test(error.message || '') || | ||
| /(ECONNRESET|socket hang up)/i.test(typeof error.error === 'string' ? error.error : '') |
There was a problem hiding this comment.
Can we make the logic more cleaner by something like this -
const CONNECTION_RESET_PATTERN = /ECONNRESET|socket hang up/i const matchesConnectionReset = (value) => typeof value === 'string' && CONNECTION_RESET_PATTERN.test(value)
Then use above in error check as
e.code === ECONNRESET || matchesConnectionReset(e.message) || matchesConnectionReset(e.error) || matchesConnectionReset(e)
WDYT?
|
|
||
| if (isConnectionReset) { | ||
| pretty = 'the connection to the Runtime API was interrupted (socket hang up / ECONNRESET). ' + | ||
| 'Please try again in a few moments. Before you do, run `aio app use` to get the latest Adobe Developer Console configuration file.' |
There was a problem hiding this comment.
"Before you do, run aio app use to get the latest Adobe Developer Console configuration file."
Is this a required step or only required when workspace/runtime details are not available?
Right now the message looks like mandating the aio app:use command
There was a problem hiding this comment.
No. Using the AIO app is a troubleshooting suggestion, not a required step for every connection reset. It may help if the project’s Adobe Developer Console configuration is stale or doesn’t match the intended workspace/runtime.
Description
Detect
ECONNRESETandsocket hang uperrors in Runtime API failures and provide actionable guidance to refresh the Adobe Developer Console configuration withaio app use. Adds regression tests for both error forms.Related Issue
No matching open issue was identified. The repository template requests an open issue for PRs; this PR was opened at the user's direction without one.
Motivation and Context
Runtime API calls interrupted by a stale or missing Developer Console configuration currently surface without guidance to refresh that configuration. This change tells users what to do before retrying.
How Has This Been Tested?
npm run unit-tests -- --runInBand --runTestsByPath test/RuntimeBaseCommand.test.js— not run:jestis not installed (jest: command not found).npm ci --ignore-scripts --no-audit --no-fund— could not install dependencies because this repository has nopackage-lock.json(npm cirequires a lockfile).Screenshots (if appropriate):
before the fix, with verbosity disabled
after the fix, listing activations
after the fix, getting activation by ID
Types of changes
Checklist: