breeze: unexpected error in getEntityGraph -


i use getentitygraph extension , works fine except in following scenario:

  1. add new entity
  2. don't save , call setdeleted on entity
  3. call getentitygraph passing entity , np collection parameters

when makepathsegmentfn called, crashes on line :

 grps.foreach(function(grp) {      vals = vals.concat(grp._entities.filter(function (en) {        return en.getproperty(fkname) === keyvalue;             }));  }); 

en null raises exception. i've worked around problem checking if en null , every seems work fine. perhaps should done in original code if it's bug ? note 1 entity null amongst entities in np collection. guess that's 1 deleted, can't tell sure.

update 29 april 2014

ok ... now. you're talking deleted child entity, not detached root entity.

thanks identifying bug. added test scenario doccode, fixed bug. both changes pushed github. appear in next official release. can get current getentitygraph.js github right now.

original answer

i can't duplicate particular failure describe ... because getentitygraph throws long before gets makepathsegmentfn ... as should do!

getentitygraph supposed throw exception (e.g., "'getentitygraph' root[0] detached entity") when any of root entities passed in 'detached'.

when create new entity , delete (without saving first), state changes 'added' 'detached'; no longer entity in cache. expected behavior (see "entitystate transitions" in "inside entity" documentation topic). that's happens when follow repro steps exactly.

please provide jsfiddle or plunker demonstrates error.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -