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
fix duration parsing #714
fix duration parsing #714
Conversation
@@ -65,8 +89,7 @@ public static String convertDurationToDaprFormat(Duration value) { | |||
|
|||
// return empty string for anything negative, it'll only happen for reminder "periods", not dueTimes. A | |||
// negative "period" means fire once only. | |||
if (value == Duration.ZERO | |||
|| (value.compareTo(Duration.ZERO) == 1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compareTo
can produce any value greater than 1, by contract any positive value means the value is greater. This failed the test when only milliseconds were given ...
Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>
90681be
to
b381f24
Compare
Codecov Report
@@ Coverage Diff @@
## master #714 +/- ##
============================================
+ Coverage 77.98% 78.19% +0.21%
- Complexity 1105 1117 +12
============================================
Files 97 97
Lines 3407 3417 +10
Branches 394 399 +5
============================================
+ Hits 2657 2672 +15
+ Misses 550 547 -3
+ Partials 200 198 -2
Continue to review full report at Codecov.
|
Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Description
Fix the Duration parsing. When reminder dueTime is stored in DB as "30m" or "10s" etc ... Java SDK fails to load the reminder with IndexOutOfBoundException.
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #712
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: