can-connect icon indicating copy to clipboard operation
can-connect copied to clipboard

Relationship problems with `withRelated` service layer. ~34

Open justinbmeyer opened this issue 10 years ago • 1 comments
trafficstars

In bitballs, I load a game's data, which gets saved in localStorage. Then later, I load the same item "withRelated" data. I get the game's data without related data from localStorage. This breaks things.

One solution would be to include other params in .getData related caching. This would save two different versions of the same item's data. Another would be to say one request {id: 4, withData: ["stats"]} actually represents a superset of data, so save that. Another, more difficult, but awesome, solution would be to support relationships. This would be able to get stats for {gameId: 5}

justinbmeyer avatar Sep 06 '15 02:09 justinbmeyer

I think Ref type would fix this, though we'd need to document how. I think the problem with ref type in this case is that there isn't a single property to get either the id or the referenced object.

justinbmeyer avatar Sep 01 '16 14:09 justinbmeyer