-
Notifications
You must be signed in to change notification settings - Fork 3
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
Handle negative user id (m2m user) in project.action.update event #12
Comments
@vikasrohit this is connected with syncing billing account functionality which is already there. Somehow to check if user can access billing account we need to know user handle and for user with id So the issue is not with negative id, but because such user doesn't exists. I guess the solution should be one of these:
|
Apologies for replying late on this @maxceem. I have few concerns and queries here:
|
@maxceem carrying from #13, some improvements that we can do to avoid too many errors of negative user ids:
|
@vikasrohit during the fresh look, it feels that we don't have to make updates as I've suggested before and as you've summed up here #12 (comment). As method I guess the only thing we have to make is to update method const userName = await getUserHandle(connection, userId) it should check if we have a user in the special config as per your suggestion:
|
Stop checking permissions for updating billing account. We cannot do it properly if update has been made using M2M token with a negative userId. Instead we would rely on the fact, that if message to update billing account has been posted to Kafka, than service which posted the message already checked the permissions. And the processor only sync data back to legacy DB without permission check. ref issue #12
@vikasrohit I've created a hotfix for this issue as per discussion on Slack. Let's merge it to DEV first and do the testing on DEV environemnt as it's very time-consuming to make a proper test locally.
Solution SummaryStop checking permissions for updating billing account. We cannot do it properly if update has been made using M2M token with a negative userId. Instead we would rely on the fact, that if message to update billing account has been posted to Kafka, than service which posted the message already checked the permissions. And the processor only sync data back to legacy DB without permission check. |
Merged the branch in dev. I will check if it works or not. |
As now we have removed the permission check in the Legacy Project Processor we have to consider re-enabling it in the Project Service, see related issue topcoder-platform/tc-project-service#581. |
Merging the prod PR as well, as I don't see any specific error in dev though I am not able to verify the exact use case because we don't have quickly accessible data in salesforce which can be used for testing. I would like to monitor it on production in logs, and will revert in case it fails. |
Because now we can have negative values in
updatedBy
field for a project, we have to fix the handling of theproject.action.update
(and may be same forproject.action.create
) to support negative user ids. As of now it is throwing following error:fyi @maxceem
The text was updated successfully, but these errors were encountered: