Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Partial updates #85
I coulda sworn we had an issue about this. Correct me if I'm just not seeing it. Right now:
I'm reading this like Update replaces the object in its entirety. So of the an attribute of the original object is not present in the object of the Update, it will be dropped.
We should have a way to do partial updates so you don't have to rebuild the entire object every time or risk losing parts. And for attributes which can have multiple values, we need to know how to add or remove specific values, as well as adding/removing them all at once.
Hm. I thought of a reason that this could be a real problem. This seems fine for client to server (I just want to change this field), server to server federation (okay, the other server probably has an instance of this object), but when it comes to server to server federation plus server to client, it could be a real problem!
For instance, say someone on another server changes the name of their post... an object gets sent over the network that contains just that updated name field, nested in the object. Well, I connect to my server, and uhoh! I see an update to an object that my server has seen, but I never have. Furthermore, it might be something that isn't public, in which case I would need something like the proxyUrl in #101 in order for things to happen correctly. I'm not confident that a client will do the right thing here anyway. It's certainly a lot of extra steps.
Updating nested objects is also unclear. If you update an object 3 levels deep in a json structure, are you updating that whole object, or just the outer value?
I think this has real problems and we're likely to get it wrong.
Okay, it looks like I'm wrong: Pump.io allows partial updates.
So, here's what I think then. Client to server should permit partial updates, as discussed above. But! For server to server communications, and server to client communications, servers/clients SHOULD send along the entire object.
There's a bit of asymmetry there, but I think it will result in the least amount of wrong behavior by clients. WDYT?