-
Notifications
You must be signed in to change notification settings - Fork 40
Fix fix command when server rejects request #655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,8 +1,11 @@ | ||||||||||||||||||||||
| import { arrayUnique } from '@socketsecurity/registry/lib/arrays' | ||||||||||||||||||||||
| import { debugFn } from '@socketsecurity/registry/lib/debug' | ||||||||||||||||||||||
| import { logger } from '@socketsecurity/registry/lib/logger' | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| import { extractPurlsFromPnpmLockfile } from './pnpm.mts' | ||||||||||||||||||||||
| import { getPublicToken, setupSdk } from './sdk.mts' | ||||||||||||||||||||||
| import { addArtifactToAlertsMap } from './socket-package-alert.mts' | ||||||||||||||||||||||
| import constants from '../constants.mts' | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| import type { CompactSocketArtifact } from './alert/artifact.mts' | ||||||||||||||||||||||
| import type { | ||||||||||||||||||||||
|
|
@@ -117,6 +120,16 @@ export async function getAlertsMapFromPurls( | |||||||||||||||||||||
| throw new Error( | ||||||||||||||||||||||
| `Socket API server error (${statusCode}): ${statusMessage}`, | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| } else { | ||||||||||||||||||||||
| const { spinner } = constants | ||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The codebase appears to be using a style where semicolons are optional. Since this is consistent with the surrounding code, adding an explicit semicolon here isn't necessary. If there's a specific linting rule or style guide requiring semicolons, consider applying it consistently across the entire codebase rather than to individual lines. Spotted by Diamond (based on custom rules) |
||||||||||||||||||||||
| spinner.stop() | ||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The codebase appears to be using a style where semicolons are optional. Since this is consistent with the surrounding code (which also doesn't use semicolons), adding one here would actually be inconsistent with the project's style. Unless there's a specific linting rule for this project requiring semicolons, this code follows what appears to be the established convention. Spotted by Diamond (based on custom rules) |
||||||||||||||||||||||
| debugFn('Received a result=false:', batchResult) | ||||||||||||||||||||||
| logger.fail( | ||||||||||||||||||||||
| `Received a ${batchResult.status} response from Socket API which we consider a permanent failure:`, | ||||||||||||||||||||||
| batchResult.error, | ||||||||||||||||||||||
| batchResult.cause ? `( ${batchResult.cause} )` : '', | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
Comment on lines
+127
to
+131
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding a semicolon at the end of the logger.fail(
`Received a ${batchResult.status} response from Socket API which we consider a permanent failure:`,
batchResult.error,
batchResult.cause ? `( ${batchResult.cause} )` : '',
);
Suggested change
Spotted by Diamond (based on custom rules) |
||||||||||||||||||||||
| break | ||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
Spotted by Diamond (based on custom rules) |
||||||||||||||||||||||
| } | ||||||||||||||||||||||
| remaining -= 1 | ||||||||||||||||||||||
| if (spinner && remaining > 0) { | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.