Commit 60be0fa
committed
fix: stop settings hang caused by blocking XPC call on main thread
SMAppService.mainApp.status makes a synchronous XPC call to smd that
can block for 5+ seconds. The async version was already written and used
in init/bootstrapDefaultPreference, but onAppear was calling the sync
refreshStatus() instead. Switch to refreshStatusAsync() so the XPC call
runs off the main actor.
Confirmed via `sample`: 100% of samples during the hang were blocked in
mach_msg2_trap inside SMAppService's XPC pipe.1 parent dea1d3a commit 60be0fa
2 files changed
Lines changed: 6 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
44 | 33 | | |
45 | 34 | | |
46 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
| |||
0 commit comments