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
~.000008sec difference between 'created' and 'updated' field in API #4411
Comments
Thanks @perezfr , I can confirm that I can reproduce this bug. @chdorner @fatbusinessman Should we fix this issue? When you create an annotation, I guess the model code calls The result is that, for an annotation that has never been edited, The obvious fix to me would be for Perhaps there is some declarative way to tell sqlalchemy to set Or we find the user code outside of the model class and have it run Or we decide not to fix this. As for existing annotations in the db that have never been edited but that have different created and updated times, if we wanted to fix those retrospectively all I can think of is a database migration that looks for annotations whose created and updated are within some tiny fraction of a second delta of each other and changes them to be the same. |
Looking at the code this actually looks like a bug, the code does try to set it to the same timestamp: here and here. We should look into fixing this for new annotations, I'm not sure how if it's worth the effort for old annotations. It might be fairly straightforward if we are okay with making the decision that if the updated is not more than one second ahead of created than we set the updated timestamp to the same as created. |
The issue only seems to affect annotation data from before August/September 2016. Newer records don't seem to be affected by this issue. |
I think this was fixed a long time ago |
Steps to reproduce
Expected behaviour
'created' and 'updated' field should not be different for annotations that aren't updated.
Actual behaviour
There are messages with ~.000008sec difference between 'created' and 'updated' field
Browser/system information
Using the API search feature https://hypothes.is/api/search
Additional details
attached csv of list of messages affected by the issue
augCreateUpdate.txt
The text was updated successfully, but these errors were encountered: