Commit 4 of 5:
4759fb4971
fix(ios): report busy service 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_health.zig modified +3 -3 Changes to packages/zig/src/bridge_mobile_health.zig ⋯ 177 lines Show the 177 lines above this hunk @@ -178,7 +178,7 @@ pub const HealthBridge = struct { 178 178 "requestHealthAuthorization: no free reply slot; {d} native calls are already awaiting one", 179 179 .{ios_async.max_in_flight}, 180 180 ); 181 - return BridgeError. NativeCallFailed ; 181 + return BridgeError. Busy ; 182 182 }; 183 183 errdefer ios_async.abandon(ticket); 184 184 const block = calls.claim(ticket, .{}) orelse { ⋯ 55 lines Show the 55 lines above this hunk @@ -240,7 +240,7 @@ pub const HealthBridge = struct { 240 240 "saveHealthWorkout: no free reply slot; {d} native calls are already awaiting one", 241 241 .{ios_async.max_in_flight}, 242 242 ); 243 - return BridgeError. NativeCallFailed ; 243 + return BridgeError. Busy ; 244 244 }; 245 245 errdefer ios_async.abandon(ticket); 246 246 ⋯ 55 lines Show the 55 lines above this hunk @@ -302,7 +302,7 @@ pub const HealthBridge = struct { 302 302 "getHealthData: no free reply slot; {d} native calls are already awaiting one", 303 303 .{ios_async.max_in_flight}, 304 304 ); 305 - return BridgeError. NativeCallFailed ; 305 + return BridgeError. Busy ; 306 306 }; 307 307 errdefer ios_async.abandon(ticket); 308 308 const block = calls.claim(ticket, .{ .unit = unit }) orelse {
packages/zig/src/bridge_mobile_location.zig modified +2 -5 Changes to packages/zig/src/bridge_mobile_location.zig ⋯ 1,139 lines Show the 1,139 lines above this hunk @@ -1140,16 +1140,13 @@ fn nowMillis() f64 { 1140 1140 return @floatFromInt(compat.milliTimestamp()); 1141 1141 } 1142 1142 1143 - /// The answer for a full block pool, copied from `bridge_mobile_permissions`: 1144 - /// `BridgeError` has no "Busy", INVALID_PARAMETER is the migration notes' 1145 - /// designated stand-in, and the point is that the seventeenth concurrent call 1146 - /// gets an explicit rejection instead of a promise that never settles. 1143 + /// Reject a call when every asynchronous reply slot is already in use. 1147 1144 fn poolFull() bridge_error.BridgeError { 1148 1145 std.log.warn( 1149 1146 "getCurrentPosition refused: all {d} async slots in flight", 1150 1147 .{ios_async.max_in_flight}, 1151 1148 ); 1152 - return bridge_error.BridgeError. InvalidParameter ; 1149 + return bridge_error.BridgeError. Busy ; 1153 1150 } 1154 1151 1155 1152 // =============================================================================
packages/zig/src/bridge_mobile_nfc.zig modified +1 -1 Changes to packages/zig/src/bridge_mobile_nfc.zig ⋯ 155 lines Show the 155 lines above this hunk @@ -156,7 +156,7 @@ const alert_message = "Hold your iPhone near the NFC tag"; 156 156 157 157 fn poolFull() BridgeError { 158 158 std.log.warn("scanNFC refused: all {d} async slots in flight", .{ios_async.max_in_flight}); 159 - return BridgeError. InvalidParameter ; 159 + return BridgeError. Busy ; 160 160 } 161 161 162 162 // =============================================================================
packages/zig/src/bridge_mobile_notifications.zig modified +2 -5 Changes to packages/zig/src/bridge_mobile_notifications.zig ⋯ 293 lines Show the 293 lines above this hunk @@ -294,16 +294,13 @@ pub const NotificationsBridge = struct { 294 294 } 295 295 }; 296 296 297 - /// The answer for a full block pool, copied from `bridge_mobile_permissions`: 298 - /// `BridgeError` has no "Busy", INVALID_PARAMETER is the migration notes' 299 - /// designated stand-in, and the point is that the seventeenth concurrent call 300 - /// gets an explicit rejection instead of a promise that never settles. 297 + /// Reject a call when every asynchronous reply slot is already in use. 301 298 fn poolFull() bridge_error.BridgeError { 302 299 std.log.warn( 303 300 "getPendingNotifications refused: all {d} async slots in flight", 304 301 .{ios_async.max_in_flight}, 305 302 ); 306 - return bridge_error.BridgeError. InvalidParameter ; 303 + return bridge_error.BridgeError. Busy ; 307 304 } 308 305 309 306 // =============================================================================