mozfet / ExpertBox

ExpertBox.com is a knowledge automation platform that is used by experts from different domains to create constructs of systematic conversations that converse with users, for free or for a fee.
0 stars 0 forks source link

Examples are not visible to regular users #147

Closed mozfet closed 6 years ago

mozfet commented 6 years ago

Environment: PROD Expected: Regular users should see example constructs in design view Perceived: Examples are not visible to regular users, only admin. Clue1: Probably server publication issue, because no examples available via browser console query. Clue2: Not happening on DEV when creating a new example, perhaps it has to do existing constructa.

mozfet commented 6 years ago

New public Media Example was created, it and The Gambler is shown on the stage for Admin, but not Cold and Flu and not Building. It seems that The Gambler is a private example?

mozfet commented 6 years ago

Set the Gambler to the public stage, and it still shows for Admin, Cold and Flu still does not show!

mozfet commented 6 years ago

It seems that Cold and Flu is not deployed... perhaps its an issue with the construct migration script, that only updated The Gambler...

mozfet commented 6 years ago

Yet again, the classic MongoDB update mistake! To update multiple documents the multi setting is needed, else it will update only the first record found! Thus, in the migration script setting the isDeployed flag:

Constructs.update(masterConstruct._id, modifier, {multi: true});

Should be

Constructs.update(masterConstruct._id, modifier, {multi: true});
mozfet commented 6 years ago

It was not happening on DEV, because there are no Constructs to be migrated.

mozfet commented 6 years ago

Ok, that was not the full trick, the problem was also that only constructs on private and public stages were being marked as deployed, but autodeployed should alway be marked as deploy initially, and thus also in the migration script, to avoid when you try and show a auto deploy construct on a stage, that they are deployed and visibile on the stage.