Skip to content

Commit a350462

Browse files
committed
cat.js: add _current info for bounce test
see #79110
1 parent 5d3b060 commit a350462

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • server/db_pre_save+webhook

server/db_pre_save+webhook/cat.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ process.stdin.on('end', () => {
1515
let data;
1616
try {
1717
data = JSON.parse(input)
18+
// fs.writeFileSync('/tmp/post-req', JSON.stringify(data));
1819
delete(data.info)
20+
for (const obj of data.objects) {
21+
if (obj.bounce?._version > 1 && obj.bounce?.ref) {
22+
// add hint about current to "ref"
23+
obj.bounce.ref += ", current version: "+obj._current?.bounce._version
24+
}
25+
}
1926
} catch(e) {
2027
console.error(`Could not parse input: ${e.message}`, e.stack)
2128
process.exit(1)
2229
}
23-
// fs.writeFileSync('/tmp/post-req', JSON.stringify(data));
2430
console.log(JSON.stringify(data, "", " "))
2531
})

0 commit comments

Comments
 (0)