all-simple-salesforce-mdapi-sync-calls-must-use-asyncio-to-thread
All simple-salesforce mdapi.* methods (deploy, retrieve, check_deploy_status, check_retrieve_status, CustomObject.create, CustomField.create, read_metadata, etc.) are synchronous and block the event loop when called from async functions. Every mdapi call must be wrapped with ‘await asyncio.to_thread(conn.mdapi.method, *args, **kwargs)’. asyncio.to_thread() supports both positional and keyword arguments. Audit found 23+ violations across metadata, security, integration, and utilities modules.
Related
- simple-salesforce-mdapi-sync-must-wrap-asyncio-to-thread
- mdapi-sync-calls-in-async-context-require-asyncio-to-thread
- all-mdapi-sync-calls-must-wrap-asyncio-to-thread
- salesforce-mcp-23-sync-mdapi-calls-in-async-context-law3-vio
- salesforce-mcp-23-mdapi-calls-missing-asyncio-to-thread
- sfdc-mdapi-async-wrapping-law3-requirement