[GH-ISSUE #28] Double event callbacks using on(event, callback) syntax #25

Closed
opened 2026-05-23 08:26:25 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @appy-one on GitHub (Apr 1, 2021).
Original GitHub issue: https://github.com/appy-one/acebase/issues/28

Originally assigned to: @appy-one on GitHub.

Events 'value', 'child_added' and 'notify_child_added' are fired twice for each value when using ref.on(event, callback) syntax.
To reproduce:

db.ref('messages').on('value', snap => {
   console.log('value callback'); // Prints twice
});

db.ref('messages').on('child_added', snap => {
   console.log('child_added callback'); // Prints twice for each child
});

db.ref('messages').on('notify_child_added', ref => {
   console.log('notify_child_added callback'); // Prints twice for each child
});

This does not happen when using ref.on(event).subscribe(callback)

Originally created by @appy-one on GitHub (Apr 1, 2021). Original GitHub issue: https://github.com/appy-one/acebase/issues/28 Originally assigned to: @appy-one on GitHub. Events 'value', 'child_added' and 'notify_child_added' are fired twice for each value when using `ref.on(event, callback)` syntax. To reproduce: ```js db.ref('messages').on('value', snap => { console.log('value callback'); // Prints twice }); db.ref('messages').on('child_added', snap => { console.log('child_added callback'); // Prints twice for each child }); db.ref('messages').on('notify_child_added', ref => { console.log('notify_child_added callback'); // Prints twice for each child }); ``` This does not happen when using `ref.on(event).subscribe(callback)`
gitea-mirror added the
bug
label 2026-05-23 08:26:25 -06:00
Author
Owner

@appy-one commented on GitHub (Apr 2, 2021):

Fix published in acebase-core v1.4.1, which is now required by acebase v1.5.0 and acebase-client 1.3.2

<!-- gh-comment-id:812510745 --> @appy-one commented on GitHub (Apr 2, 2021): Fix published in acebase-core v1.4.1, which is now required by acebase v1.5.0 and acebase-client 1.3.2
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/acebase#25
No description provided.