Commit 7393a28
authored
Fix decoding of durations in MethodConfig (#2093)
Motivation:
MethodConfig uses a particular string based format for durations based
on the "google.protobuf.duration" message. On some decoding paths a
string was read and then decoded into a `Swift.Duration` rather than
decoding the `GoogleProtobufDuration` message directly.
The string-to-Swift.Duration path had a bug meaning fractional seconds
were incorrectly decoded.
Modifications:
- Add a test
- Remove the string to `Swift.Duration` path and always decode via
`GoogleProtobufDuration` which has a correct implementation.
Result:
Fewer bugs1 parent 945cbf6 commit 7393a28
File tree
3 files changed
+7
-22
lines changed- Sources/GRPCCore/Configuration
- Tests/GRPCCoreTests
- Call/Server/Internal
- Configuration
3 files changed
+7
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | 396 | | |
412 | 397 | | |
413 | 398 | | |
| |||
506 | 491 | | |
507 | 492 | | |
508 | 493 | | |
509 | | - | |
510 | | - | |
| 494 | + | |
| 495 | + | |
511 | 496 | | |
512 | 497 | | |
513 | | - | |
514 | | - | |
| 498 | + | |
| 499 | + | |
515 | 500 | | |
516 | 501 | | |
517 | 502 | | |
| |||
551 | 536 | | |
552 | 537 | | |
553 | 538 | | |
554 | | - | |
555 | | - | |
| 539 | + | |
| 540 | + | |
556 | 541 | | |
557 | 542 | | |
558 | 543 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| |||
0 commit comments