Repository: usergrid Updated Branches: refs/heads/release-2.1.1 f4ae0cb85 -> a6c307b28
Add edge read repair on entity updates. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/a6c307b2 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/a6c307b2 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/a6c307b2 Branch: refs/heads/release-2.1.1 Commit: a6c307b282bbec2399f6dbf5220bb284184eddc3 Parents: f4ae0cb Author: Michael Russo <[email protected]> Authored: Wed Jun 29 15:50:49 2016 -0700 Committer: Michael Russo <[email protected]> Committed: Wed Jun 29 15:50:49 2016 -0700 ---------------------------------------------------------------------- .../usergrid/services/AbstractCollectionService.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/usergrid/blob/a6c307b2/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java ---------------------------------------------------------------------- diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java index 14b1df1..1ed7255 100644 --- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java +++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java @@ -277,6 +277,12 @@ public class AbstractCollectionService extends AbstractService { if ( item != null ) { validateEntityType( item, id ); + + if( context.getOwner().getType().equals(TYPE_APPLICATION)) { + // this will repair any missing edges + em.addToCollection(context.getOwner(), context.getCollectionName(), item); + } + updateEntity( context, item, context.getPayload() ); item = importEntity( context, item ); } @@ -312,7 +318,14 @@ public class AbstractCollectionService extends AbstractService { else { entity = importEntity( context, entity ); checkPermissionsForEntity( context, entity ); + + if( context.getOwner().getType().equals(TYPE_APPLICATION)) { + // this will repair any missing edges + em.addToCollection(context.getOwner(), context.getCollectionName(), entity); + } + updateEntity( context, entity ); + } return new ServiceResults( this, context, Type.COLLECTION, Results.fromEntity( entity ), null, null );
