Fix idempotency key default value handling in LedgerClient#93
Merged
Conversation
…ult value This commit modifies the `LedgerClient` class to set the `idempotency_key` parameter to a predefined `UNSET` value when it is `None`. This change enhances the robustness of the API by ensuring that the key is always defined, preventing potential issues during journal entry creation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a bug where the idempotency key in
LedgerClientcould be left unset (e.g.,None) instead of being assigned a proper default value. This ensures that all ledger requests consistently carry a valid idempotency key, preventing potential issues with duplicate request processing or API errors due to missing keys.Key Accomplishments
LedgerClientto ensure a proper default value is always set when one is not explicitly provided by the caller.test_ledger_client.pyto validate the corrected default behavior, ensuring the fix is properly covered.Breaking Changes
None. This is a backward-compatible bugfix. Callers that were already providing an explicit idempotency key will see no change in behavior. Callers relying on the default will now get the correct, expected default value instead of an unset/
Nonevalue.Testing Notes
Infrastructure Considerations
🤖 Generated with Claude Code
Branch Info:
bugfix/idempotency-key-unsetmainCo-Authored-By: Claude noreply@anthropic.com