Closed rythos42 closed 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Closing the issue due to inactivity. Feel free to re-open
I have a JSON tree like:
When trying to listen to changes on the sub-tree of "id1", I started with the following code:
What happens with this, is that the REST API call sends a path of "/" back on my subscribe, which made the code in
FirebaseCache
skip lines 60 to 99, treated the object as a dictionary and tried to parse usingGetObjectCollection
on line 119, which failed because my object is a complex type, not a dictionary of that type.Reading through code, I realized I needed to use the
elementRoot
parameter. I started with it as a value ofBattle/id1
. (I used a parameter, but this string is more useful for the example). This madeFirebaseCache
go into lines 60-99, but ultimately failed on line 85, because there is no propertyid1
on my typeBattleData
, that is the ID of my object.What worked was using
elementRoot
ofid1
. This goes into lines 60-99, and leaves the private variableobj
as my class. This starts to treatFirebaseCache
as just a cache ofBattleData
objects though, which doesn't look like it's intended purpose (although it's fine for me), and I'm not sure if this works for other scenarios?I'm writing an issue for discussion, maybe leading to me understanding that I'm wrong, which has led to an inconsistency. :) Or maybe others using this library have a similar problem. (or maybe they needed to have the
ContinueExceptionEventArgs
parameter pointed out, which was the pin that cracked this case open for me...no errors were coming out of the observable, which was maddening...)