Commit 8295077
fix(swift): Add request timeout and initialization check for teardown
SDK changes:
- Add timeout parameter to sendRequest (default 30s)
- sendResourceTeardown uses 5s timeout
- Add failPendingRequest helper for clean timeout handling
Host changes:
- Check isReady() before sending teardown
- Skip teardown if bridge not yet initialized (no data to save)
- Simplified logic since SDK handles timeout internally
This prevents cards from getting stuck when closed before initialization.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 2268d5e commit 8295077
File tree
2 files changed
+35
-36
lines changed- examples/basic-host-swift/Sources/BasicHostApp
- swift/Sources/McpApps
2 files changed
+35
-36
lines changedLines changed: 13 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
537 | 529 | | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
| 530 | + | |
| 531 | + | |
544 | 532 | | |
545 | 533 | | |
546 | 534 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
235 | | - | |
| 234 | + | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
251 | | - | |
| 250 | + | |
252 | 251 | | |
253 | 252 | | |
254 | 253 | | |
255 | | - | |
| 254 | + | |
| 255 | + | |
256 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
257 | 266 | | |
258 | 267 | | |
259 | | - | |
260 | | - | |
261 | | - | |
| 268 | + | |
262 | 269 | | |
263 | | - | |
264 | | - | |
| 270 | + | |
265 | 271 | | |
266 | 272 | | |
267 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
268 | 279 | | |
269 | 280 | | |
270 | 281 | | |
| |||
0 commit comments