also looking at this
fix(ios): report async pool exhaustion as busy
#267
19 files
+53
-65
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -542,7 +542,7 @@ pub const PermissionsBridge = struct { | ||
| 542 | 542 | "openSettings: no free reply slot; {d} native calls are already awaiting one", |
| 543 | 543 | .{ios_async.max_in_flight}, |
| 544 | 544 | ); |
| 545 | return bridge_error.BridgeError.NativeCallFailed; | |
| 545 | return bridge_error.BridgeError.Busy; | |
| 546 | 546 | }; |
| 547 | 547 | errdefer ios_async.abandon(ticket); |
| 548 | 548 | publishSettingsCall(ticket); |
| @@ -564,13 +564,10 @@ pub const PermissionsBridge = struct { | ||
| 564 | 564 | } |
| 565 | 565 | }; |
| 566 | 566 | |
| 567 | /// The answer for a full block pool. `BridgeError` has no "Busy"; | |
| 568 | /// INVALID_PARAMETER is the designated stand-in from the migration notes, | |
| 569 | /// and the point is that the sixteen-plus-first concurrent prompt gets an | |
| 570 | /// explicit rejection instead of a promise that never settles. | |
| 567 | /// Reject a call when every asynchronous reply slot is already in use. | |
| 571 | 568 | fn poolFull() bridge_error.BridgeError { |
| 572 | 569 | std.log.warn("permission request refused: all {d} async slots in flight", .{ios_async.max_in_flight}); |
| 573 | return bridge_error.BridgeError.InvalidParameter; | |
| 570 | return bridge_error.BridgeError.Busy; | |
| 574 | 571 | } |
| 575 | 572 | |
| 576 | 573 | // ============================================================================= |
| @@ -191,7 +191,7 @@ pub const VisionBridge = struct { | ||
| 191 | 191 | "{s}: no free reply slot; {d} native calls are already awaiting one", |
| 192 | 192 | .{ kind.action(), ios_async.max_in_flight }, |
| 193 | 193 | ); |
| 194 | return BridgeError.NativeCallFailed; | |
| 194 | return BridgeError.Busy; | |
| 195 | 195 | }; |
| 196 | 196 | |
| 197 | 197 | work.* = .{ .handler = handler, .request = request, .kind = kind, .ticket = ticket }; |
| @@ -318,7 +318,7 @@ pub const WatchBridge = struct { | ||
| 318 | 318 | "sendToWatch: no free reply slot; {d} native calls are already awaiting one", |
| 319 | 319 | .{ios_async.max_in_flight}, |
| 320 | 320 | ); |
| 321 | return bridge_error.BridgeError.NativeCallFailed; | |
| 321 | return bridge_error.BridgeError.Busy; | |
| 322 | 322 | }; |
| 323 | 323 | errdefer ios_async.abandon(ticket); |
| 324 | 324 | publishWatchCall(ticket); |