Skip to content
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

fix: ignore npm registry 404 status response on sync process #740

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
f
fengmk2 committed Dec 9, 2024
commit a6094886a7aa8fbe8beaf360a831e51229dcbf8a
6 changes: 3 additions & 3 deletions app/core/service/PackageSyncerService.ts
Original file line number Diff line number Diff line change
@@ -262,14 +262,14 @@ export class PackageSyncerService extends AbstractService {
// },
// "_attachments": {}
// }
let isSecurityHolder = false;
let isSecurityHolder = true;
for (const versionInfo of Object.entries<{ _npmUser?: { name: string } }>(data.versions || {})) {
const [ v, info ] = versionInfo;
// >=0.0.1-security <0.0.2-0
const isSecurityVersion = semver.satisfies(v, '^0.0.1-security');
const isNpmUser = info?._npmUser?.name === 'npm';
if (isSecurityVersion && isNpmUser) {
isSecurityHolder = true;
if (!isSecurityVersion || !isNpmUser) {
isSecurityHolder = false;
break;
}
}