0

I got a node named feeder for handling the firebase queue.

Crazy thing is : I post the following payload to the feeder node but after adding several of them . I cannot delete the payload in the node.

If I do delete then the payload in the feeder node then the data in the node re-appears.

P.S: I am going crazing finding out what is the issue from past 2 days. Can anyone point what may be the issue ?

ADDED: If firebase queue has not finished doing the task then can't we forefully delete the payload in the node ????

TO ADD TO NODE::

CODE TO SET VALUE TO FIREBASE NODE

FIRDatabase.database().reference(withPath: "queue/feederer").childByAutoId().setValue(["post": postid , "owner":UserController().userId!,"timestamp":FIRServerValue.timestamp()], withCompletionBlock: { (error, ref) in
                if let err = error {
                    debugPrint(err.localizedDescription)
                    print("ERROR: Posting to feeder  ")
                }
                else {
                    print("Posted to Feeder  successfully")
                }
            })

TO DELETE:

To delete the node I simply : Go to Firebase Console and delete the node

Help Help !! **Why can't I delete the data from the firebase node ?? ** enter image description here

user3804063
  • 809
  • 1
  • 14
  • 32
  • post the code you are using to delete and post the code you used to retrieve. – Ro4ch Mar 10 '17 at 15:25
  • You might want to take a look at Cloud Functions for Firebase - it effectively replaces firebase-queue and should make your backend management a whole lot easier. https://firebase.google.com/docs/functions/ – Doug Stevenson Mar 10 '17 at 17:16
  • There's no repro here. We won't be able to help you troubleshoot a nuanced coding bug without this. See [how to ask](http://stackoverflow.com/help/how-to-ask) and [creating an mcve](http://stackoverflow.com/help/mcve). – Kato Mar 10 '17 at 23:18
  • @Ro4ch : I have added the code which adds data to node and I simply try to delete the node by going to the project from the firebase console. – user3804063 Mar 12 '17 at 04:03
  • @DougStevenson: Can you suggest why my code duplicates data when my device is running the code ? And doesn't allows me to delete data. I have updated the code. – user3804063 Mar 12 '17 at 04:04
  • You put the code in that sets it but what about the code that retrieves it? Also you have duplicate data cause you need to removeObserver and possible need to clear the array with your objects(assuming you are using an array). – Ro4ch Mar 13 '17 at 07:50

1 Answers1

0

@everybody thanks for the comment :

Issue was because of the observer, When there was changes in the node , it fired the notifications so caused an issue.

user3804063
  • 809
  • 1
  • 14
  • 32