Bug Description
When using the S3 storage engine with transactions: false in the config overrides, xyOps crashes during startup with:
TypeError: trans.commit is not a function
at /opt/xyops/lib/monitor.js:687:12
Root Cause
Two issues in node_modules/pixl-server-storage/transaction.js:
1. Wrong truthy check on this.transactions
In beginTransaction() (line ~532):
if (!this.transactions) return callback(null, this);
this.transactions is the runtime transactions map object {}, not the config boolean. An empty object is truthy, so this check never passes even when Storage.transactions is set to false in config.
2. Missing commit/abort on returned object
When the check does pass, beginTransaction() returns this (the main storage object), but callers like monitor.js and list.js call trans.commit() and trans.abort() — methods that only exist on the TransStorage clone, not on the main storage object.
Fix
// Before:
if (!this.transactions) return callback(null, this);
// After:
if (!this.config.get('transactions')) {
if (!this.commit) {
this.commit = function(cb) { if (cb) cb(); };
this.abort = function(cb) { if (cb) cb(); };
}
return callback(null, this);
}
Same fix needed for the other two occurrences:
// commitTransaction and abortTransaction:
if (!this.config.get('transactions')) return callback();
Environment
- xyOps v1.0.39
- Node.js v22.22.1
- S3-compatible storage: Cloudflare R2
- Config:
Storage.engine: "S3", Storage.transactions: false
Reproduction
- Configure xyOps with S3 storage engine and
transactions: false
- Start xyOps
- Crash on startup:
TypeError: trans.commit is not a function
Reported by Salmen Essridi (@salmen-essridi)
Bug Description
When using the S3 storage engine with
transactions: falsein the config overrides, xyOps crashes during startup with:Root Cause
Two issues in
node_modules/pixl-server-storage/transaction.js:1. Wrong truthy check on
this.transactionsIn
beginTransaction()(line ~532):this.transactionsis the runtime transactions map object{}, not the config boolean. An empty object is truthy, so this check never passes even whenStorage.transactionsis set tofalsein config.2. Missing
commit/aborton returned objectWhen the check does pass,
beginTransaction()returnsthis(the main storage object), but callers likemonitor.jsandlist.jscalltrans.commit()andtrans.abort()— methods that only exist on theTransStorageclone, not on the main storage object.Fix
Same fix needed for the other two occurrences:
Environment
Storage.engine: "S3",Storage.transactions: falseReproduction
transactions: falseTypeError: trans.commit is not a functionReported by Salmen Essridi (@salmen-essridi)