CoreBluetooth write request receives .prepareQueueFull

I'm trying a Data value (1438 bytes) to write to a characteristic which exceeds the MTU size. When I issue the write request I receive .prepareQueueFull

According to the documentation: "The prepare queue is full, as a result of there being too many write requests in the queue."

The unfortunate thing is that on the I only call the write request once.

peripheral.writeValue(data, for: characteristic, type: .withResponse)

Any input and possible solution is welcome.

Thank you in advance.

Additon: the MTU size is 512 bytes on the test device

According to the documentation of the characteristic write options, the write with response SHOULD chop up the message and perform a long write. Core spec 4.0 Part G 4.9.4. https://developer.apple.com/documentation/corebluetooth/cbcharacteristicwritetype

I created a feedback for this as I am also encountering the prepareQueueFull unexpectedly. FB13596337

Here are some console logs:

Central (iPadOS 17.2) (client)

error	bluetoothd	21:53:42.361949-0600	com.apple.bluetooth	Stack.GATT	Received error response 9 for write long value - canceling execution (status=65535)
error	bluetoothd	21:53:42.421534-0600	com.apple.bluetooth	Server.GATT	Failed to write long characteristic value at handle 0x001b on device "58B87653-65EE-23CB-2E99-0D70A24D0CE2" - result was 9
error	bluetoothd	21:53:42.421727-0600	com.apple.bluetooth	Server.GATT	Command failed to execute with status 9
error	bluetoothd	21:53:42.422360-0600	com.apple.bluetooth	Server.GATT	Command failed to execute with status 9

Peripheral (macOS 14.2) (server)

error	bluetoothd	21:54:52.323246-0600	com.apple.bluetooth	Server.GATT	Refusing Prepare Write Request as it would exceed the maximum amount of data queued (512) for this connection by 135 byte(s)
error	bluetoothd	21:54:52.323518-0600	com.apple.bluetooth	Stack.ATT	Failed to write value to attribute handle 0x001B with result 9 (status=65535)
CoreBluetooth write request receives .prepareQueueFull
 
 
Q