Code RoomDownloaded artifact not verified
MediumPrep Room Coding #2232

Downloaded artifact not verified

Code reviewStorage & CDNMid–Senior~20 min

Review this Node download-and-extract routine.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix, specific and kind.

0:00 of about 20 min
Mark a line and say what kind of problem it is.0 findings
1const fs = require("fs");
2const https = require("https");
3 
4async function fetchArtifact(url, expectedSha, dest) {
5 await new Promise((resolve, reject) => {
6 const file = fs.createWriteStream(dest);
7 https.get(url, (res) => {
8 res.pipe(file);
9 file.on("finish", () => file.close(resolve));
10 }).on("error", reject);
11 });
12 // artifact is now on disk; install it
13 return installPackage(dest);
14}
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.