I have an issue with Flutter SDK when using Realtime Database.
After removing all listeners from event handle, I still receive the log related to that removed listener. See below log from Android:
I/cketIOConnectionManager( 3648): Got sub res
I/RTClient( 3648): subscription result [[B@bfcaebc]
I/RTClient( 3648): Got result for subscription 14057C0C-5E3C-D981-FFBA-994197FF8D00
I/cketIOConnectionManager( 3648): Got sub res
I/RTClient( 3648): subscription result [[B@10490fd]
I/RTClient( 3648): Got result for subscription 304F1440-DD4A-16F8-FFAA-D772F8C7A600
I/cketIOConnectionManager( 3648): Got sub res
I/RTClient( 3648): subscription result [[B@b26dd4a]
I/RTClient( 3648): Got result for subscription 213AA179-0F7A-58CC-FFF6-9025483BD400
I/flutter ( 3648): New Event object has been created. Object ID - 8D8F500C-0519-4BDD-81C2-104E4194D3EC
Steps:
1, Create EventHandler
EventHandler<Map> eventChangesHandler = Backendless.data.of(BLEvent.tableName).rt();
2, Add create listener:
eventChangesHandler?.addCreateListener((createdEvent) {
print(
"New Event object has been created. Object ID - ${createdEvent['objectId']}");
}, whereClause: query);
it will show this log - generate RTSubscription{id=‘14057C0C-5E3C-D981-FFBA-994197FF8D00’:
try to subscribe RTSubscription{id='14057C0C-5E3C-D981-FFBA-994197FF8D00', callback=com.backendless.rt.data.EventHandlerImpl$5@60c56b9, subscriptionName=OBJECTS_CHANGES, options={whereClause=(age >= 3 and age <= 20), event=created, tableName=BLEvents}}
I/cketIOConnectionManager( 3648): Socket is connected
2, Remove all create listener
eventChangesHandler?.removeCreateListeners();
3, Add create listener:
eventChangesHandler?.addCreateListener((createdEvent) {
print(
"New Event object has been created. Object ID - ${createdEvent['objectId']}");
}, whereClause: query);
it will show this log - generate RTSubscription{id=‘304F1440-DD4A-16F8-FFAA-D772F8C7A600’
try to subscribe RTSubscription{id='304F1440-DD4A-16F8-FFAA-D772F8C7A600', callback=com.backendless.rt.data.EventHandlerImpl$5@e2350c8, subscriptionName=OBJECTS_CHANGES, options={whereClause=(age >= 3 and age <= 20), event=created, tableName=BLEvents}}
I/cketIOConnectionManager( 3648): Socket is connected
4, Remove all create listener
eventChangesHandler?.removeCreateListeners();
5, Add create listener:
eventChangesHandler?.addCreateListener((createdEvent) {
print(
"New Event object has been created. Object ID - ${createdEvent['objectId']}");
}, whereClause: query);
it will show this log - generate RTSubscription{id=‘213AA179-0F7A-58CC-FFF6-9025483BD400’
try to subscribe RTSubscription{id='213AA179-0F7A-58CC-FFF6-9025483BD400', callback=com.backendless.rt.data.EventHandlerImpl$5@a568561, subscriptionName=OBJECTS_CHANGES, options={whereClause=(age >= 3 and age <= 20), event=created, tableName=BLEvents}}
I/cketIOConnectionManager( 3648): Socket is connected
6, Create a new object to trigger create event.
it will show this log:
I/cketIOConnectionManager( 3648): Got sub res
I/RTClient( 3648): subscription result [[B@bfcaebc]
I/RTClient( 3648): Got result for subscription 14057C0C-5E3C-D981-FFBA-994197FF8D00
I/cketIOConnectionManager( 3648): Got sub res
I/RTClient( 3648): subscription result [[B@10490fd]
I/RTClient( 3648): Got result for subscription 304F1440-DD4A-16F8-FFAA-D772F8C7A600
I/cketIOConnectionManager( 3648): Got sub res
I/RTClient( 3648): subscription result [[B@b26dd4a]
I/RTClient( 3648): Got result for subscription 213AA179-0F7A-58CC-FFF6-9025483BD400
I/flutter ( 3648): New Event object has been created. Object ID - 8D8F500C-0519-4BDD-81C2-104E4194D3EC
You can see, we still receive the log “Got result for subscription…” for subscription 14057C0C-5E3C-D981-FFBA-994197FF8D00 and 304F1440-DD4A-16F8-FFAA-D772F8C7A600 even they are removed.
My questions are:
1, Does it affect our usage? Are we still charged for data received from the removed events?
2, How to remove those events completely?
Thanks,