Commit 3 of 5:
c4c682a854
fix(ios): report busy data and picker pools
previous
next
whole branch
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.
packages/zig/src/bridge_mobile_calendar.zig modified +2 -5 Changes to packages/zig/src/bridge_mobile_calendar.zig ⋯ 418 lines Show the 418 lines above this hunk @@ -419,16 +419,13 @@ fn requestAccess(store: Id, sels: Sels, ticket: ios_async.Ticket) void { 419 419 request(store, sels.request_access, ek_entity_type_event, accessBlock(ticket)); 420 420 } 421 421 422 - /// The answer for a full block pool, copied from `bridge_mobile_location`: 423 - /// `BridgeError` has no "Busy", `INVALID_PARAMETER` is the migration notes' 424 - /// designated stand-in, and the point is that the caller gets an explicit 425 - /// rejection instead of a promise that never settles. 422 + /// Reject a call when every asynchronous reply slot is already in use. 426 423 fn poolFull(action: []const u8) bridge_error.BridgeError { 427 424 std.log.warn( 428 425 "{s} refused: all {d} async slots are in flight", 429 426 .{ action, ios_async.max_in_flight }, 430 427 ); 431 - return bridge_error.BridgeError. InvalidParameter ; 428 + return bridge_error.BridgeError. Busy ; 432 429 } 433 430 434 431 // =============================================================================
packages/zig/src/bridge_mobile_display.zig modified +1 -1 Changes to packages/zig/src/bridge_mobile_display.zig ⋯ 267 lines Show the 267 lines above this hunk @@ -268,7 +268,7 @@ fn requireBundleIdentifier() !void { 268 268 269 269 fn poolFull(action: []const u8) bridge_error.BridgeError { 270 270 std.log.warn("{s} refused: all {d} async slots in flight", .{ action, ios_async.max_in_flight }); 271 - return bridge_error.BridgeError. InvalidParameter ; 271 + return bridge_error.BridgeError. Busy ; 272 272 } 273 273 274 274 /// What a slot's block will answer. The ticket is stored, not rebuilt from the
packages/zig/src/bridge_mobile_filepicker.zig modified +4 -7 Changes to packages/zig/src/bridge_mobile_filepicker.zig ⋯ 427 lines Show the 427 lines above this hunk @@ -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; ⋯ 108 lines Show the 108 lines above this hunk @@ -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 ⋯ 12 lines Show the 12 lines above this hunk @@ -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 {