Firebase Error : the data keep duplicate it self instade of update the child values

Viewed 39

the data keep duplicating instade of updating the data , before flutter 3 was working fine without any problems, my code

 var dailydata = database_Reference
    .child("users")
    .child(SharedPref.userUid!)
    .child("dayliRecords")
    .child(date);

  dailydata.set({
  "name": SharedPref.user_id,
  "router_bssid": thisWifiObject!.bssId,
  "date": dailyWorkTime,
  "startingTime": startingTime,
  "endingTime": endingTime,
  "totalWorkTime": SharedPref.hours == 0 ? 0 : SharedPref.hours,
  "percent": SharedPref.percent == 0 ? 0.0 : SharedPref.percent,
  "connectedfrom": thisWifiObject!.macAddress,
});

and in the firebase :

enter image description here

1 Answers

This looks like an artifact in the Firebase console, which shows the set operation as removing the old value of that node (in red) and then adding the new value (in green).

If that is indeed what is happening, the UI should show the correct final state after the animations are done. And on the API level this should not affect the behavior at all, and it should fire a child_changed event for the dayliRecords [sic] node..

Related