Document Timestamps

Is there a way to find the timestamp of the last edit made to a Document?
C
Calego1,009d ago
I also am not seeing anything for this from the api docs
DT
Daniel Thorp1,009d ago
Yeah I want to know if something's been updated while my module is disabled
C
Calego1,009d ago
Iiiinnnnteresting Oof, that's a brain teaser Spitballing from left-field: You could generate a hash of some sort from the document data and store that as a flag. It would theoretically not be as heavy as storing the whole thing. Is this something you want to do a "is anything different" on ready or would "is this particular thing different" when that particular thing is opened? because I can't imagine generating and comparing a hash for every document on ready would be very performant
DT
Daniel Thorp1,009d ago
I'm brainstorming a world update manager, so that content providers can provide updates to content without the user having to overwrite the entire world It has an export function which creators can initiate whenever they are about to release a new version. It would create a hash of every document and save that to the worlds flags. Then, whenever that module is enabled during a world's load on a client, it will check for those static world flags and compare them to hashes of the current version. It can prompt the user if it wants to get the modified version, or delete the old version, etc.
C
Calego1,009d ago
oof Ok, dumb question "Does it matter if the document has changed?"
DT
Daniel Thorp1,009d ago
@surged20 join us
UU
Unknown User1,009d ago
C
Calego1,009d ago
Publisher pushes an update to the world. Doesn't the user want to update to that new version? Picking some things to not update makes sense
UU
Unknown User1,009d ago
DT
Daniel Thorp1,009d ago
The timestamps were to be able to know whether the Document has been deleted and readded
C
Calego1,009d ago
Here's why I ask if it matters: Without needing to generate hashes, "all this updater has to do" is keep track of a Document version number. If the version number increments, it prompts the user if they want to update.
DT
Daniel Thorp1,009d ago
That might work, yes
UU
Unknown User1,009d ago
DT
Daniel Thorp1,009d ago
Indeed, I feel silly for overlooking a simple solution like this
UU
Unknown User1,009d ago
DT
Daniel Thorp1,009d ago
Yeah, using the db files makes this an external (non-module) tool, so not a fan
UU
Unknown User1,009d ago
DT
Daniel Thorp1,009d ago
We just tell Creators that all updates must be versioned using semver
UU
Unknown User1,009d ago
DT
Daniel Thorp1,009d ago
The issue is managing what happens if the module is disabled
UU
Unknown User1,009d ago
DT
Daniel Thorp1,009d ago
No, that would defeat the purpose
UU
Unknown User1,009d ago
DT
Daniel Thorp1,009d ago
Maybe we only create hashes on load for Documents whose ID is in the flags with the same version Yes, but it would become confusing for users if they ever disable it for any reason and then have their changes overwritten on update i.e. it would mean that changes made with the module enabled are the only ones not always overwritten
UU
Unknown User1,009d ago
DT
Daniel Thorp1,009d ago
I have to step out for an appointment, but would love to continue brainstorming this later with y'all A mix of hashing and version numbers would avoid this: https://discord.com/channels/732325252788387980/875016328786903041/875025603504504832 We could test how it is on performance and perhaps provide a performance option for users which requires the module to never be disabled. This could be enabled or disabled at the user's whim even Or maybe instead of always running on load, we add a button to run the checks. I.e. "Update World"
C
Calego1,009d ago
IMO a User knows what scenes they've changed and what changes they care to keep vs override with an update. Making these updates not automatic is important. Having a user flow (prompted or otherwise) which asks the user which updated documents they want to import would be pretty sufficient in my mind. Although... My main concern with the hash idea was how performant that would be on world load. There's already a lot going on during world load (including migrations for system/module updates usually) and IMO it would be smarter to ask the user to start an update process. If the hash + compare was only done during the 'update flow', and especially only for the documents whose versions incremented, it would help immensely with the performance. Semver is kinda overkill IMO. The world updater (and the user doing the import) only needs to know that a document has been changed, the magnitude of that change on a per-document level is more or less irrelevant.
DT
Daniel Thorp1,009d ago
Not semver for the individual Documents, just for the world itself. i.e. the version in the manifest, etc. Yes, we don't want it completely automatic and there will be a prompt before each change, but I do want avoid implementing git merge which is what is in the Epic on GitLab
C
Calego1,009d ago
gotchya
DT
Daniel Thorp1,009d ago
GitLab
[PROPOSAL] A World Merge conflict system for world updates; or migr...
Include a server side solution for worlds to be updatable from the provider. With the onset of the marketplace/premium...
C
Calego1,009d ago
If you want to put more eyes on this kind of thing in the future, don't hesitate to make a workgroup and pull people in to get more feedback. One of the things we do here is identify pain points and distill many devs feedback into one "League Proposal".
DT
Daniel Thorp1,009d ago
Is there a functional difference between this thread and a workgroup? Another thing about this is that I've participated in this discussion on two other servers, so not everything/everyone is in one vote making a League proposal, although I don't know exactly how to do that
UU
Unknown User1,008d ago
L
Lyra1,008d ago
#158-world-updating