T PHo
T PHo

Reputation: 89

Firebase node unexpectedly delete itself after a update value on node in iOS

It's a weird issue, I still cannot understand the issue,

Basically have a node like this

+ likes
+ posts
... (etc.)

Did a simple firebase update on likes node

DatabaseReference postNode = _rootNode.GetChild("likes").GetChildByAutoId();
var dict = new NSDictionary("examplekey" : "exampledata");
postNode.SetValue<NSDictionary>(dict);

The firebase realtime database behaved weirdly as I observed, just immediately after the SetValue called, the NOSQL nodes lights up with green updates, and then it lights up with red updates and deleted all datas inside node.

No where else I have seen discussed about this issue.

After I changed the node key from "likes" to "Likes", it behaves normally.

What is going wrong with Firebase? I don't think I made any mistake elsewhere.

Upvotes: 0

Views: 100

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 599621

The two most common causes for this are:

  1. The security rules for your database are rejecting the write operation.
  2. You have another process somewhere listening for this data, and updating it right away.

Given that you see this happen in the Firebase console, I expect it's the second case. So I recommend checking your code, and other processes to see which may be causing this.

Upvotes: 1

Related Questions