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

Remove deleted views #59

Open
lpatiny opened this issue Aug 3, 2021 · 5 comments
Open

Remove deleted views #59

lpatiny opened this issue Aug 3, 2021 · 5 comments

Comments

@lpatiny
Copy link
Member

lpatiny commented Aug 3, 2021

It seems that currently the flavor-builder is not taking into account the '$delete' property.

For instance this view was deleted: https://www.cheminfo.org/couch/_utils/document.html?cheminfo-public/59dec54d14e5e206142256823efa2d1c

But it is still available at: https://www.cheminfo.org/flavor/cheminformatics/SMILES/Smiles/index.html even after deleting the whole build folder and running node bin/build.js --config=/usr/local/flavor-builder/config/www.cheminfo.org.json --forceUpdate

Not sure if the change should be at this level ?

flavor-builder/src/index.js

Lines 405 to 415 in ea3e2c5

// Remove deleted views
const savedIds = revisionById[flavorName]
? Object.keys(revisionById[flavorName])
: [];
for (let i = 0; i < savedIds.length; i++) {
if (!flavorIds[savedIds[i]]) {
hasDeleted = true;
delete revisionById[flavorName][savedIds[i]];
}
}

@stropitek could you help me on this ?

@lpatiny
Copy link
Member Author

lpatiny commented Aug 3, 2021

It is related to this ticket: https://github.com/cheminfo/eln.epfl.ch/issues/423

@stropitek stropitek self-assigned this Aug 3, 2021
@stropitek
Copy link
Contributor

The $deleted property was never supported in rest-on-couch, except for allowing it to be used as a first level property
See cheminfo/rest-on-couch#116

The property is specifically supported in the visualizer's view editor.

I think the way to go is to update the visualizer database couchdb views so that they don't emit when $deleted is true. I will do a PR that does that and link it here. It should fix the problem without any changes needed in flavor-builder.

@stropitek
Copy link
Contributor

@targos
Copy link
Member

targos commented Aug 4, 2021

the change is deployed

@stropitek stropitek removed their assignment Aug 4, 2021
@stropitek
Copy link
Contributor

You should test if the change has any effect. It's been a long time since I wrote this so I don't remember if I handled the case of a deleted view correctly.

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

3 participants