Skip to content

Temporary disable phase and milestones indexing on create and update #2

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

Merged
merged 4 commits into from
Oct 31, 2019
Merged

Temporary disable phase and milestones indexing on create and update #2

merged 4 commits into from
Oct 31, 2019

Conversation

maxceem
Copy link
Contributor

@maxceem maxceem commented Oct 31, 2019

Temporary disable indexing these objects as for now we keep the logic for this inside Project Service.
It's because creating or updating a phase or milestone may cause cascading updates of other phases or milestones.
In such cases in Project Service we are doing one ES index call instead of multiple calls.
Otherwise, ES may fail with error version conflict.
This would be turned on back, as soon as we get rid of such cascading updates inside Project Service.

Fixed method expectObj() which is used to assert objects. Before it always return true for any passed values.
The reason for that was that "_.pick(obj1, _.identity)" returns an empty object {} for any obj1.
This test failed after the fixing of expectObj() method.
This issue become visible after fixing the expectObj() method.
The thing here is that when we use .empty(null) in Joi then if property is passed as "null" it's stripped from the object.
As a result, we pass an object with "null" value, but we are trying to save in ES the object without value.
This leads to the unit test fails, as saved value doesn't match the object which has been send in the message.
Temporary disable indexing these objects as for now we keep the logic for this inside Project Service.
It's because creating or updating a phase or milestone may cause cascading updates of other phases or milestones.
In such cases in Project Service we are doing one ES index call instead of multiple calls.
Otherwise ES may fail with error `version conflict`.
This would be turned on back, as soon as we get rid of such cascading updates inside Project Service.
@vikasrohit vikasrohit merged commit 180919b into topcoder-platform:develop Oct 31, 2019
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

Successfully merging this pull request may close these issues.

2 participants