You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If setting undefined as a value in a transaction, Firebase will throw an error transaction failed: Data returned contains undefined in property 'data'. If the same code is run through MockFirebase, no such error is thrown.
var Firebase = require('firebase');
var FirebaseTokenGenerator = require('firebase-token-generator');
var fbClient = new Firebase(process.env.FIREBASE_URL);
var fbTokenGenerator = new FirebaseTokenGenerator(process.env.FIREBASE_SECRET);
// Uncomment these and it will print 'FIREBASE NEVER GETS HERE');
//fbClient = new (require('mockfirebase').MockFirebase)();
//fbClient.autoFlush();
fbClient.child('deleteme').transaction(function (cur) {
return {data: undefined}; // Big no-no
}, function (err, comitted, snap) {
console.log('FIREBASE NEVER GETS HERE');
});
The text was updated successfully, but these errors were encountered:
Yeah, Firebase has a ton of validation logic that we're never going to fully replicate. Not that I'm not willing to try to create parity where possible. Just that you should be doing integration tests with the real SDK as well.
This isn't going to happen right away because I'm not willing to patch this for transactions and ignore every other write method that validates its inputs.
This will be implemented in 1.0 by running user inputs through to-firebase. If you really want this now, I'll take a PR to master that runs all write method input through to-firebase.
If setting
undefined
as a value in a transaction, Firebase will throw an error transaction failed: Data returned contains undefined in property 'data'. If the same code is run through MockFirebase, no such error is thrown.The text was updated successfully, but these errors were encountered: