netcreateorg / netcreate-itest

Developing the 2.0 version of NetCreate
https://github.com/netcreateorg/netcreate-2018
Other
0 stars 0 forks source link

Handling `created`, `updated`, and `revision` with exports and imports #127

Closed benloh closed 5 months ago

jdanish commented 5 months ago

My pitch is:

If that revision to the schema doesn't make sense, using revision count for the save function is fine by me, but I think this might do similar work and keep some things up to date / easier to interpret?

@benloh @kalanicraig does this work?

benloh commented 5 months ago

Heh, sorry I didn't realize setting the assignee would send this to you right away...there are some interacting issues that I'm still working out. I'll update later tonight or tomorrow.

jdanish commented 5 months ago

Ok - I thought that was code for “tell me what you want” 😂

benloh commented 5 months ago

We need to work out a couple of disconnects related to created, updated, and revision.

In our transition from the 1.0 UI to the current 1.5 UI, the Created, Updated, and Revision values were not fully implemented. As a result there might be missing values or "Invalid Dates" on some project and export files.

There was a disconnect with the way we were handling these fields. The created, updated, and revision fields are all generated and updated automatically by loki with every database operation. These fields are saved as meta fields (e.g. node.meta.created, and edge.meta.created). In our UI overhaul, we had flattened the fields and removed the use of the meta subproperties. This conflicted with the way the loki database was handling those updates, resulting in mixed up times and revisions. This should now be resovled.

  1. revision Revision behavior is now slightly different.
    • When a new node/edge is created, the revision is set to 0.
    • If you click "Cancel" before saving the new node/edge, the new node/edge will be removed.
    • If you click "Save" the revision will be incremented to 1.
    • Any imported node/edge that does not have a revision value defined will default to 0, and then increment to 1 upon saving the import to the database.

Note that -1 is no longer used.

See also #125.

  1. created and updated

When exporting data, we export created and updated fields as human-readable text. e.g. 1/25/2024, 4:22:06 PM This can be useful for browsing the exported CSV file.

The internal data format used in the db is actually an integer representing the number of milliseconds elapsed since the epoch, which is defined as the midnight at the beginning of January 1, 1970, UTC. The importer/exporter automatically does this conversion.

The overall import and export behavior has been refined.

Exports

Imports

Filters

Caveats

We'll probably want to bump the version number to 1.6.0 to reflect the change in data format.

This should be more robust in case anyone uses updated for a filter?

@jdanish We do not currently support filtering based on the meta date data. Do we need to add support for filtering based on created and updated fields? revision too? Adding filters for dates is a little complicated -- we'd probably have to add a date picker.

jdanish commented 5 months ago

OK, great. I think let's stop there. I'm tempted to add 3 issues that we revisit later: 1) Adding date fields (would be generally nice, and also needed for 3, but not urgent) 2) Making provenance elements visible in the node / edge tables (nice but not urgent) 3) filtering by updated / created (nice, and no clue who would use, so definitely not urgent)

One of the things we'll be discussing with the teachers who just used Net.Create as well as our advisory board is what design priorities they felt would help students most next, etc. With those discussions coming, and then the comment fields being developed among other things, I think we are far enough on provenance to leave it be for the moment and see how things come together. Does that work? Otherwise, this fix seems good, but I'll test locally a bit more before officially reviewing and I'd say let's tag then because it impacts import / export.

Flagging for @kalanicraig to sign off

benloh commented 5 months ago

Yeah, punting on date fields and filtering on created/updated sounds good. I'll add that as an issue.

Adding provenance to tables is easy, but I think we hadn't because I had expected us to make changes to it. But this is a 5 minute change, so I'll go ahead and add it.

jdanish commented 5 months ago

Is it possible to put provenance all in one cell / column for space purposes on display?

benloh commented 5 months ago

Is it possible to put provenance all in one cell / column for space purposes on display?

I'm not sure I understand. You want it on one line?

This is what it currently looks like: Image

I'd rather not introduce horizontal scrolling because it becomes really hard to manage.

jdanish commented 5 months ago

No, that’s fine. I was thinking of adding update and revisions into those cells but that’s too much. Go with that thanks!

benloh commented 5 months ago

If we have time we probably need to do an overhaul of the tables anyway to better handle column widths.

jdanish commented 5 months ago

Yeah that’s part of why I suggested it for the comment list - having better column setup and adjustment would be nice!