Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

updated field is set too easily, making audit logs too verbose and difficult to review #890

Open
TanyaStere42 opened this issue Aug 2, 2023 · 5 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@TanyaStere42
Copy link
Member

Expected Behavior
updated timestamp only changes "when it should" (meaningful data changes happen) - not entirely sure what the algorithm for this should be. first impulse is to only change it when a user PATCHes it. however, there are no doubt some other routes to changing data: e.g. a merge of individuals etc. so its subtle. plus there are also cascading considerations: does the updated field on an indivdual change when one of its encounters changes?

Current Behavior
right now this is getting updated by -- something. probably indexing or something automatic like that. so if you look at our data (most/any class), "updated" field is all the same timestamp and very recent. this makes the field effectively useless/meaningless.

@TanyaStere42 TanyaStere42 added enhancement New feature or request question Further information is requested labels Aug 2, 2023
@TanyaStere42 TanyaStere42 changed the title updated field is set too easily updated field is set too easily, making audit logs too verbose and difficult to review Aug 2, 2023
@TanyaStere42
Copy link
Member Author

@naknomum we need to be a bit more specific in the definition of when we want this to be updated. Ideas welcome

@naknomum
Copy link
Member

naknomum commented Aug 2, 2023

i would start with any PATCH for sure. thats pretty universal. then maybe look across all the resources.py files for other things that can change any of the classes. (such as the merging indiv example.) i could work on this exhaustive list or whoever gets this could just start making their own judgement call by looking at these files.

@TanyaStere42
Copy link
Member Author

You want to cut the Patch reports? Or reduce it to be just the patch reports and add to it from there?

@naknomum
Copy link
Member

naknomum commented Aug 3, 2023

well, i first want to find out what the heck this is that is doing all the updating, and then stop it:

right now this is getting updated by -- something. probably indexing or something automatic like that.

then, yeah, make patching be one of the things that does update it. basically, in my mind, the updated timestamp should be when something "significant" changes the thing. i guess it will have to be a case-by-case basis as to what this means. pretty sure its not something that happens every few minutes automatically though. that kinda makes the timestamp useless.

@TanyaStere42
Copy link
Member Author

Okay. So a decent first pass could be:
reduce audit log to only report

  • Create
  • Delete
  • Patch

For objects:

  • asset group sighting
  • sighting
  • encounter/animal
  • individual
  • user
  • bulk import

And if you come up with something more/less, we can adjust it if someone hasn't picked this up yet?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants