Skip to content

Commit 26b59db

Browse files
fix(database): call cancellation callback when using ref.on (#5371)
* call cancellation callback when using ref.on * unskip test Co-authored-by: Mike Hardy <[email protected]>
1 parent 3c438a9 commit 26b59db

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/database/e2e/query/on.e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ describe('database().ref().on()', function () {
108108
});
109109

110110
// the cancelCallback is never called for ref.on but ref.once works?
111-
xit('should cancel when something goes wrong', async function () {
111+
it('should cancel when something goes wrong', async function () {
112112
const successCallback = sinon.spy();
113113
const cancelCallback = sinon.spy();
114114
const ref = firebase.database().ref('nope');

packages/database/lib/DatabaseSyncTree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ class DatabaseSyncTree {
263263

264264
if (once) {
265265
const subscription = SharedEventEmitter.addListener(eventRegistrationKey, event => {
266-
this._onOnceRemoveRegistration(eventRegistrationKey, listener, event);
266+
this._onOnceRemoveRegistration(eventRegistrationKey, listener)(event);
267267
subscription.remove();
268268
});
269269
} else {

0 commit comments

Comments
 (0)