also looking at this
fix(ios): report async pool exhaustion as busy
#267
19 files
+53
-65
| @@ -428,7 +428,7 @@ pub const FilePickerBridge = struct { | ||
| 428 | 428 | "pending reply; refusing the second call rather than stranding the first", |
| 429 | 429 | .{}, |
| 430 | 430 | ); |
| 431 | return BridgeError.InvalidParameter; | |
| 431 | return BridgeError.Busy; | |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | const PresentFn = *const fn (Id, Id, Id, bool, Id) callconv(.c) void; |
| @@ -543,7 +543,7 @@ pub const FilePickerBridge = struct { | ||
| 543 | 543 | "downloadFile: no free reply slot; {d} native calls are already awaiting one", |
| 544 | 544 | .{ios_async.max_in_flight}, |
| 545 | 545 | ); |
| 546 | return BridgeError.NativeCallFailed; | |
| 546 | return BridgeError.Busy; | |
| 547 | 547 | }; |
| 548 | 548 | errdefer ios_async.abandon(ticket); |
| 549 | 549 | |
| @@ -562,13 +562,10 @@ pub const FilePickerBridge = struct { | ||
| 562 | 562 | } |
| 563 | 563 | }; |
| 564 | 564 | |
| 565 | /// The answer for a full block pool, in the shape `bridge_mobile_location.zig` | |
| 566 | /// uses: `BridgeError` has no "Busy", `INVALID_PARAMETER` is the migration | |
| 567 | /// notes' designated stand-in, and the point is that the seventeenth concurrent | |
| 568 | /// call gets an explicit rejection instead of a promise that never settles. | |
| 565 | /// Reject a call when every asynchronous reply slot is already in use. | |
| 569 | 566 | fn poolFull() BridgeError { |
| 570 | 567 | std.log.warn("pickFile refused: all {d} async slots in flight", .{ios_async.max_in_flight}); |
| 571 | return BridgeError.InvalidParameter; | |
| 568 | return BridgeError.Busy; | |
| 572 | 569 | } |
| 573 | 570 | |
| 574 | 571 | fn selector(name: [*:0]const u8) !Id { |