Skip to content
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

how to trace "blank" edit of dataset visible in dataset page but not in activity stream #4443

Open
lucapelizzo opened this issue Sep 4, 2018 · 2 comments
Assignees

Comments

@lucapelizzo
Copy link
Contributor

CKAN Version if known (or site URL)

I tried with 2.6.2 and 2.8.0 hosted in my company and with 2.6.6 directly on demo.ckan.org

Please describe the expected behaviour

In my company we have the need of executing massive updates of datasets (by using package_patch) without verifying if the edit is already present (e.g. "blank" edit) in the dataset currently being edited, and we need to know if action package_patch has been executed without errors. So I expect, for every dataset, to get the field metadata_modified updated in both api package_show and package_search, and to see this edit in the dataset page in the field Last Updated and in the activity stream.

Please describe the actual behaviour

If the update is already present in the dataset (e.g. I send the string "prova" as title but the dataset has already the title "prova"), only metadata_modified of package_show get updated but NOT the one of package_search. Plus, the field Last Updated in dataset page get updated regardless of the "blank" edit, but i don't get a new entry in activity stream.
I consider this behaviour a bit schizophrenic, if ckan doesn't want to trace "blank" edit, why update only certain fields and not all the fields involved? The field metadata_modified get updated only in one api (package_show) and not in the corresponding one (package_search), this is is misleading.

What steps can be taken to reproduce the issue?

I created this dataset in demo.ckan.org https://demo.ckan.org/dataset/provaprovaprova-354 , as you can see in https://demo.ckan.org/api/3/action/package_show?id=provaprovaprova-354 the field metadata_modified is "2018-09-04T08:41:53.107569", but if I use package_search https://demo.ckan.org/api/3/action/package_search?q=&include_private=true&sort=metadata_created+desc&rows=999 and I search for id: "5637ef6e-115c-424b-b76c-27a9c3e7fc96" (corresponding to previous dataset) I get metadata_modified: "2018-09-04T08:34:18.862575".

@wardi
Copy link
Contributor

wardi commented Sep 4, 2018

+1 to not being schizophrenic

I think the simplest approach would be to move the metadata_modified field update to be triggered just before the search index update code so it doesn't get called when the db values aren't changing.

@lucapelizzo do you have any interest in submitting a PR? I'd be happy to help point you in the right direction.

@lucapelizzo
Copy link
Contributor Author

I never did something similar before, if you can give me some technical hints (which files have to be edited??) I can give it a try. I can run test only on a 2.6.2 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants