Skip to content

Commit 9e73a16

Browse files
Merge pull request #295 from pulsar-edit/noisy-webhook-logs
Fix package version updates not appearing on Discord notifications
2 parents ffac90e + 3bb92df commit 9e73a16

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

src/controllers/postPackagesPackageNameVersions.js

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,29 +44,20 @@ module.exports = {
4444

4545
// Lets bail early in case these values don't exist.
4646
// Such as the original request failing
47-
48-
if (
49-
typeof obj?.webhook?.pack !== "string" ||
50-
typeof obj?.webhook?.user !== "string"
51-
) {
47+
if (!obj.webhook || !obj.featureDetection) {
5248
// This data isn't defined, and we cannot work with it
5349
return;
5450
}
5551

56-
if (
57-
typeof obj?.featureDetection?.user !== "string" ||
58-
typeof obj?.featureDetection?.ownerRepo !== "string" ||
59-
typeof obj?.featureDetection?.service !== "string"
60-
) {
61-
// This data isn't defined, and we cannot work with it
62-
return;
63-
}
64-
65-
await context.webhook.alertPublishVersion(
52+
let webhookSend = await context.webhook.alertPublishVersion(
6653
obj.webhook.pack,
6754
obj.webhook.user
6855
);
6956

57+
if (!webhookSend.ok) {
58+
context.logger.generic(3, webhookSend);
59+
}
60+
7061
// Now to call for feature detection
7162
let features = await context.vcs.featureDetection(
7263
obj.featureDetection.user,

0 commit comments

Comments
 (0)