> On Dec. 4, 2013, 1:39 p.m., Stanton Sievers wrote: > > trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/spi/JsonDbOpensocialService.java, > > line 626 > > <https://reviews.apache.org/r/15960/diff/1/?file=393003#file393003line626> > > > > Is it possible for getJSONObject(recipient) to be null?
Interesting question. For the canonicaldb.json/JsonDbOpensocialService there's no method for creating new persons, so I could argue that that "creation of new persons" is responsible for setting up all data for that person, including any and all related structures such as message collections. The same in a way is also true for the message collection part: the service doesn't support creating them. Spec-wise (2.5.1): creating a message is not actually taking an arbitrary collection, but rather only "@outbox". The message itself can however contain an arbitrary number of collections it is "contained in", and collections are user specific. I've not found anything that would describe what should happen to created messages (should the sender be able to find it back by doing a GET on the @outbox collection?), or how failures in sending them are to be handled. As such I'd rather avoid too much change here, mixing "better implementation of the standard" with "making things at least work with the current structure". - Andreas ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/15960/#review29724 ----------------------------------------------------------- On Dec. 4, 2013, 3:53 p.m., Andreas Kohn wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/15960/ > ----------------------------------------------------------- > > (Updated Dec. 4, 2013, 3:53 p.m.) > > > Review request for shindig. > > > Bugs: SHINDIG-1960 > https://issues.apache.org/jira/browse/SHINDIG-1960 > > > Repository: shindig > > > Description > ------- > > Fix #createMessage(): > * assign a random message id if it wasn't done from the outside (no checks > for uniqueness are done if one is given) > * properly access the json data > > Note: this contains the functional fixes from > https://reviews.apache.org/r/15420/ / SHINDIG-1951 without the method > signature changes. > > > Diffs > ----- > > > trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/spi/JsonDbOpensocialService.java > 1547796 > > trunk/java/social-api/src/test/java/org/apache/shindig/social/sample/spi/JsonDbOpensocialServiceTest.java > 1547796 > > Diff: https://reviews.apache.org/r/15960/diff/ > > > Testing > ------- > > Unit test exercises both changed parts. > > > Thanks, > > Andreas Kohn > >
