Skip to content

[re-created]implement local event handling #85

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

Conversation

imcaizheng
Copy link
Contributor

No description provided.

Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @imcaizheng. I've merged the PR for ES processor.

  1. I guess all the logic with status would work every time we update objects, no matter if status really changed or no. For the resource bookings we've previously fixed it, so automatic update only happenes one time when status really changed from one status to another. Can we keep the same logic here for all the cases?

  2. I've tested all the cases, some of them work, but some no:

@imcaizheng
Copy link
Contributor Author

imcaizheng commented Dec 30, 2020

I guess all the logic with status would work every time we update objects

Actually when a resource booking is updated, the event handler does check if status changed or not.
It was done with two steps:

You could see when status is not updated the condition payload.status !== 'assigned' would be evaluated to false(that is, undefined !== 'assigned') so it keeps the logic like what we already fixed.

@maxceem You assumption is correct for the job status updating logic. We can fix it like we did mentioned above. Is it fine to do that?

For the test result, it is wired it does not work for you even I validated all the cases before submitted the PR. I will check it again.

@maxceem
Copy link
Contributor

maxceem commented Dec 30, 2020

Actually when a resource booking is updated, the event handler does check if status changed or not.
It was done with two steps:

@imcaizheng Ah, I missed this. I would suggest making this logic more clear and universal. Because now it actually couples service with event processor. As a general solution, we can send the original and updated object to the event. So in even handler we can compare if staus has changed.

This way we can implement any logic in the handler, and check if the date changed or any other field if need in the future.

For the test result, it is wired it does not work for you even I validated all the cases before submitted the PR. I will check it again.

If it works for you, I can try to give you exact steps to reproduce it.

@imcaizheng
Copy link
Contributor Author

@maxceem The commit fix inconsistence by interating all jobs found filtering by projectId should fix the issues. Please check and suggest.

@imcaizheng
Copy link
Contributor Author

As a general solution, we can send the original and updated object to the event. So in even handler we can compare if staus has changed.

@maxceem The commit enhancement: encapsulate old value to the event payload as well is the implementation.

Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imcaizheng looking at the code it seems that logic is not what is expected. Could you please, have a look.

@maxceem
Copy link
Contributor

maxceem commented Jan 4, 2021

@imcaizheng As I've already merged another PR, could you please resolve the merge conflict here?

@imcaizheng
Copy link
Contributor Author

@maxceem Conflict resolved.

@maxceem
Copy link
Contributor

maxceem commented Jan 4, 2021

@imcaizheng just in case, we still have this issue in this PR:

image

@imcaizheng
Copy link
Contributor Author

@maxceem Good catch. it is fixed now.

Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imcaizheng works perfectly now.

@maxceem maxceem merged commit 13f5669 into topcoder-platform:dev Jan 4, 2021
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