pulsar-edit / package-backend

Pulsar Server Backend for Packages
https://api.pulsar-edit.dev
MIT License
12 stars 11 forks source link

Fix `vcs.ownership()` call when publishing a new version #96

Closed confused-Techie closed 1 year ago

confused-Techie commented 1 year ago

Requirements

Description of the Change

This PR implements a fix being experienced in production when publishing a new version.

When attempting to publish a new version the newest package data should be passed to verify ownership rather than the data last stored on the DB incase of a package name changed or the like.

Additionally the check to protect vcs.ownership() from accessing an invalid object of packObj.repository.type was originally, inaccurately checking for typeof packObj === "object" rather than typeof packObj.repository === "object"