-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retrieve full revision history in all record responses #40
Comments
Should be aware of #9. |
OK. I'm good adding a creating user and date-time to all records. I think those will be different than the small number of If you are also thinking it will be a user, then yes we need to figure out how to make that more universal in terms of the graphql, let's discuss. |
I'm thinking it's either a user or a group agent- basically some (REA) agent to which the record might be considered a record of interest, in that they somewhat have stewardship over it, given that they created it. They might have edit permissions by default, for example (at least for a short duration). I concede that this is somewhat of an antiquated notion in distributed systems design. Does And all of this is getting into permissions & notifications territory... |
To try to sort out the agents involved:
I'd like to keep "user" and "agent" separated conceptually. Group agents don't have user credentials, and some person agents tend to have many user credentials, even within one technical infrastructure or application. But I think you probably do mean agents in this case?
I was thinking of this more as just informational, if you need to know who created something to track something down or whatever, this was standard database practice back in the day. Not sure how that relates to distributed stuff. But seems like generally a good idea, irrespective of the functional requirements of HoloREA and agents.
Is there something not covered in the list at the top of this comment? If so, let's take a look at it. |
Check. What's unknown there is which data to anchor such roles & access control to. Perhaps it's the network ID, and anyone with an Maybe we just don't know yet until we start getting user-level requirements coming in. We certainly don't have to explicitly store the authoring agent address, since Holochain does that by itself. But it might be worth having it injected anyway; as this prevents other agents from being able to mess with things that have been entered by others (they can't pass someone else's agent key). |
Agree.
Agree also. BTW, I'm not arguing we shouldn't have created date and created by agent or user (let's figure that out), I think that is a good idea, although I'd also like to understand what HC gives us for free. And then think about how to put that into graphql in a fairly universal way. OT, seems also like we need to chat about what is an agent, even sticking just with a person for now. Although group agent plays in here also. And also perhaps what our requirements might be for the ocaps permissions. |
My thinking at present is that maybe the metadata should be returned as its own object, a sub-record of the main VF records. That way, those details only need to be resolved and returned if the UI is specifically interested in returning them; and we avoid clouding the main records with a bunch of repeated fields. It might not just be author & date stuff, I can see us adding previous revision IDs and updating user IDs down the track to enable querying of a full provenance of each record. That would be a good springboard to locate archival versions for retrieval, which is something we need to do eventually. In any event this is all data that Holochain records for us automatically, so implementation is confined to reads. The other part of this which I don't think I quite elaborated on properly in that last post is getting uniqueness of new records to avoid accidental conflicts. For example, I create an event which is just |
That seems like a good idea. I like the idea of being able to expand on the data too.
Not sure I understand this. Won't every record have a unique identifier (a hash)? Or is this about getting the same hash on records that have say identical action, time, provider, etc.? If so, then yes, having the creation time would certainly help that. Also a side note: we do have more required fields than we have documented, because we have several "either or" things. Should I document those somewhere?
We could fix that by not putting it on mutations, and just saving the server time when we save any record. |
You've got it RE hashes- records will share the same hash if their content is the same; so we should probably ensure it is always different.
Yes please! Ideally log a new issue for "add validation for 'either or' fields" or something.
Unfortunately we can't- there is no "server time"; only node time. And the user's machine can set that however it wants whether the data comes from the browser or from the DNA. But this is a minor issue if providing the wrong time only hurts the caller (which it will, if agent hash is also injected). |
Then sounds like node time makes sense. OK with you? And we use the user token? I'm not sure if we want it in the graphql reference or not. Do you think it is something that should be standardized across implementation technologies? |
Maybe we could just standardise parts of it: I think We can have the core VF schema extended with custom fields by the Holochain implementation; and the structure of the codebase will make it clear what of that is part of the VF spec and what is additional metadata for this implementation specifically. Would be good to proof that setup, too- lots of others will want examples to follow. |
Prior to #75, this might be a good flow for using "trusted time", i.e. the time of the write operation: https://forum.holochain.org/t/how-to-provide-time-of-entry-authoring-automatically/1410/7 |
Figured out the simple flow now, it looks like this:
It would necessitate an extra link read to provide |
Can probably ignore the above, the HDK has changed significantly since this was written and there will be new (probably native) ways to retrieve this metadata in HDK3.x. Something related which now has to be done, now that the protocol spec has stabilised enough to proceed-
|
Note also that this should be implemented in a transparent way within |
@pospi since you just mentioned this elsewhere that you were working on it, and consequently I was just reviewing this issue I just 'assigned' it to you, based on our chat about ways of working, if that's ok. |
Ah, thankyou for being on top of it! :) |
Work on this started in Note that the complicated parts of the implementation have been done, most of the work remaining will be the gruntwork of adding appropriate API endpoints and record metadata to all the existing datatypes. |
@pospi is the work for creation times and author metadata considered one-and-the-same as the 'revision history' work? Is it possible to get creation times and author metadata without going full on revision history? |
Yeah. We can split this if you like or I can just do those quickly, actually they might just be this conversion. So we could merge that branch (feature/40-record-revisions-metadata) and import |
I think I like that path, I recommend proceeding that way. There's a lot of utility in just having 'who created and when' at a basic level, before having, "and who updated and when" |
@pospi do we consider this work done? |
I don't think we have anything logged separately for full revision metadata, so I'll update the issue title to reflect what's needed. |
Nice, love the work breakdown. |
With the remaining two issues (#347 & #348), because they are quite heavy in terms of DHT ops it will be best to implement them as optional return data. To support these changes, and
We can also further optimise updates by returning the previous revision's metadata from For read API requests (whether loading individual records or lists of them), we should add an extra parameter for determining whether to load full metadata for the record. This parameter should be set in the |
The text was updated successfully, but these errors were encountered: