Fix cross-SDK JSON serialization mismatch, httpx resource leak, and missing network error handling#28
Draft
Fix cross-SDK JSON serialization mismatch, httpx resource leak, and missing network error handling#28
Conversation
…etwork error wrapping Co-authored-by: numbers-official <181934381+numbers-official@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [Feature] Fix cross-SDK JSON serialization mismatch, httpx resource leak, and missing network error handling
Fix cross-SDK JSON serialization mismatch, httpx resource leak, and missing network error handling
Mar 15, 2026
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.
Three production reliability issues: silent cross-SDK signature verification failures caused by non-deterministic JSON key ordering, connection pool exhaustion from unheld
httpx.Clientreferences, and unhandledTypeError/Errorescaping the SDK's error hierarchy on network failure.JSON serialization consistency
Both SDKs now serialize integrity proofs with sorted keys and compact separators, guaranteeing identical
integritySharegardless of which SDK signs or verifies.TypeScript (
crypto.ts): newserializeProof()helper used for both hashing and the form payload, eliminating the fragile double-JSON.stringifycoupling:Python (
crypto.py): equivalent_serialize_proof()helper used insign_integrity_proof()and reused inclient.pyfor thesigned_metadatafield:Both now produce
{"asset_mime_type":…,"created_at":…,"proof_hash":…}.Python httpx resource leak
Added
__del__toCaptureas a safety net for callers that don't use the context manager or call.close()explicitly:TypeScript fetch network error wrapping
All five
fetch()call sites (request,getHistory,getAssetTree,searchAsset,searchNft) now catch transport-level failures and rethrow asNetworkError, matching the Python SDK's existinghttpx.RequestErrorhandling:Original prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.