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

Use the same timer duration validation with server #1121

Merged
merged 14 commits into from
Aug 18, 2021
Merged

Use the same timer duration validation with server #1121

merged 14 commits into from
Aug 18, 2021

Conversation

demirkayaender
Copy link
Contributor

What changed?
Server performs timer duration validation against duration in seconds. However, client performs the same checks against duration type. Although, the client side checks look safe enough, we had a recent incident where server received invalid timer parameters. Although it's unlikely, this validation discrepancy probably happened due to the float to int conversion discrepancies. Therefore, we are applying the same type of validation in client to eliminate that possibility.

Why?

How did you test it?

Potential risks

@demirkayaender demirkayaender requested a review from a team August 17, 2021 22:42
@coveralls
Copy link

Pull Request Test Coverage Report for Build 3ba6deea-18e8-4f67-bcbb-9f4ff8d5c42d

  • 7 of 8 (87.5%) changed or added relevant lines in 1 file are covered.
  • 11 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.1%) to 71.219%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/internal_event_handlers.go 7 8 87.5%
Files with Coverage Reduction New Missed Lines %
internal/common/convert.go 3 84.62%
internal/internal_task_pollers.go 8 80.96%
Totals Coverage Status
Change from base Build 6e7ee6fa-6a5e-4c8b-b873-e06b32984d79: 0.1%
Covered Lines: 12093
Relevant Lines: 16980

💛 - Coveralls

Copy link
Contributor

@mkolodezny mkolodezny left a comment

Choose a reason for hiding this comment

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

do we need this for java sdk as well?

@demirkayaender demirkayaender merged commit 0bb9dc3 into uber-go:master Aug 18, 2021
@demirkayaender demirkayaender deleted the timer_seconds branch August 18, 2021 00:03
@demirkayaender
Copy link
Contributor Author

@mkolodezny Good catch! I checked java client and it seems to have it already: https://github.com/uber/cadence-java-client/blob/master/src/main/java/com/uber/cadence/internal/sync/SyncDecisionContext.java#L494-L515

@Groxx Groxx mentioned this pull request Nov 9, 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.

None yet

5 participants