| … | … | @@ -63,10 +63,10 @@ steps: |
| 63 | 63 | # Costs 71MB disk but saves minutes of P2P bandwidth per update. |
| 64 | 64 | sed -i '/fs.promises.rm(this.next/d' $RT |
| 65 | 65 | |
| 66 | | # 6. Numeric version comparison — prevent downgrades during replication race. |
| 67 | | # On fresh corestore, append fires at intermediate lengths. checkout(oldLength) |
| 68 | | # returns an old deploy's package.json with a LOWER version. Skip unless newer. |
| 69 | | sed -i 's/JSON.parse(manifest).version === this.version/(() => { const rn = parseInt((JSON.parse(manifest).version || "0").split(".")[1] || "0"); const ln = parseInt((String(this.version) || "0").split(".")[1] || "0"); return rn <= ln })()/' $RT |
| 66 | # 6. Version comparison — skip update only when versions match exactly. |
| 67 | # Patch #8 (staging validation) guards against replication race artifacts. |
| 68 | # Using exact equality so commit count resets (history rewrites) don't block updates. |
| 69 | sed -i 's/JSON.parse(manifest).version === this.version/JSON.parse(manifest).version === String(this.version)/' $RT |
| 70 | 70 | |
| 71 | 71 | # 7. Update this.version after successful mirror — prevents double-fire. |
| 72 | 72 | # Without this, _update() sees version mismatch again (this.version is from |