Title: fix(http): defensively handle missing optional fields and snake_case keys in HttpRetryOptions.from_json by hardikkaurani · Pull Request #353 · microsoft/durabletask-python · GitHub
Open Graph Title: fix(http): defensively handle missing optional fields and snake_case keys in HttpRetryOptions.from_json by hardikkaurani · Pull Request #353 · microsoft/durabletask-python
X Title: fix(http): defensively handle missing optional fields and snake_case keys in HttpRetryOptions.from_json by hardikkaurani · Pull Request #353 · microsoft/durabletask-python
Description: Summary of Changes Closes #351 In azure.durable_functions.http.models.HttpRetryOptions.from_json(), deserialization previously accessed optional retry fields (maxRetryIntervalInMilliseconds, retryTimeoutInMilliseconds, and backoffCoefficient) using direct dictionary subscripting value["..."]. When a wire payload omits these optional fields (for example, when serialized with default options or across language SDK boundaries), from_json() raised KeyError (e.g. KeyError: 'maxRetryIntervalInMilliseconds'), causing the built-in HTTP orchestrator polling loop (builtin_http_poll_orchestrator) to fail during replay. Furthermore, unlike DurableHttpResponse.from_json() which defensively handles both status_code and statusCode, HttpRetryOptions.from_json() only recognized camelCase keys, rejecting snake_case dictionaries. This change: Defensively extracts fields with .get(), defaulting backoff_coefficient to 1.0, max_retry_interval to timedelta(days=6) (matching the HttpRetryOptions constructor default when omitted), and preserving explicit None for unbounded intervals. Supports both camelCase and snake_case key naming (first_retry_interval_in_milliseconds, max_number_of_attempts, backoff_coefficient, max_retry_interval_in_milliseconds, retry_timeout_in_milliseconds, and status_codes_to_retry). Adds unit and orchestrator execution tests covering partial wire payloads, explicit None max intervals, and snake_case configurations. Changes Across Commits Commit 1: fix(http): handle missing optional fields in HttpRetryOptions.from_json Safely extract maxRetryIntervalInMilliseconds, retryTimeoutInMilliseconds, and backoffCoefficient in HttpRetryOptions.from_json(). Commit 2: fix(http): support snake_case keys in HttpRetryOptions.from_json Add defensive fallback lookup for snake_case dictionary keys across all policy properties. Commit 3: test(http): verify HttpRetryOptions.from_json with missing optional fields Add unit test verifying that minimal payloads and payloads with explicit None max intervals reconstruct correctly. Commit 4: test(http): verify HttpRetryOptions.from_json with snake_case keys Add unit test verifying reconstruction from snake_case wire payloads. Commit 5: docs(http): document defensive payload parsing in HttpRetryOptions.from_json Update docstring in models.py and document the fix in azure-functions-durable/CHANGELOG.md. Commit 6: test(http): verify orchestrator execution with partial retry options payload Add an execution test verifying that builtin_http_poll_orchestrator successfully runs when provided with a partial retryOptions dictionary. Verification pytest tests/azure-functions-durable/test_http_retry.py (81/81 passed) ruff check . (All checks passed)
Open Graph Description: Summary of Changes Closes #351 In azure.durable_functions.http.models.HttpRetryOptions.from_json(), deserialization previously accessed optional retry fields (maxRetryIntervalInMilliseconds, retryT...
X Description: Summary of Changes Closes #351 In azure.durable_functions.http.models.HttpRetryOptions.from_json(), deserialization previously accessed optional retry fields (maxRetryIntervalInMilliseconds, retryT...
Opengraph URL: https://github.com/microsoft/durabletask-python/pull/353
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4074c2aa-cb04-ca3f-16c2-2dc46abba304 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B52E:3A7773:3430B3:4817E8:6AFE2E54 |
| html-safe-nonce | 217dc786a6f92b87e5c1bd59ee61d4ea1c5089d8f9acf8c85a4a94df76662320 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTJFOjNBNzc3MzozNDMwQjM6NDgxN0U4OjZBRkUyRTU0IiwidmlzaXRvcl9pZCI6IjgzNDIyMjc1NjgwNjQwNTcxNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6c300cb074de538fccb25edde1a3b8254043c6222656e42e3d3627e06faee4b6 |
| hovercard-subject-tag | pull_request:5250335154 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/microsoft/durabletask-python/pull/353/files |
| twitter:image | https://avatars.githubusercontent.com/u/224249943?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/224249943?s=400&v=4 |
| og:image:alt | Summary of Changes Closes #351 In azure.durable_functions.http.models.HttpRetryOptions.from_json(), deserialization previously accessed optional retry fields (maxRetryIntervalInMilliseconds, retryT... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | e973f9ec3625f3faad8cac5c2d11a214b7ffe45f3cc563b828459b290ecaeed3 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/microsoft/durabletask-python git https://github.com/microsoft/durabletask-python.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 627664515 |
| octolytics-dimension-repository_nwo | microsoft/durabletask-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627664515 |
| octolytics-dimension-repository_network_root_nwo | microsoft/durabletask-python |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1f92c367595b9190e0be293896078033886b1913 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width