Commit 0be0ce7
authored
fix(sftp): close persistent SFTP channel on page dispose and guard async race (#1173)
* fix(sftp): close persistent SFTP channel on page dispose and guard async race
- Close _status.client in dispose() to prevent channel leak when
navigating away from the SFTP browser page.
- Replace ??= with explicit null check to avoid concurrent
double-open race when multiple _listDir calls overlap.
- Add catch block to close and null-out stale client on
non-SftpStatusError, allowing recovery on next call.
* fix(sftp): add single-flight future guard for SFTP session init
- Introduce _openingClientFuture to prevent multiple concurrent
_client.sftp() calls when rapid navigation races the lazy
_status.client initialisation.
- Reset _openingClientFuture on dispose and after errors.
- Add mounted check after awaiting the future so unmounted
pages do not attempt further UI operations.1 parent 2df593c commit 0be0ce7
1 file changed
Lines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
| 92 | + | |
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
| |||
1033 | 1036 | | |
1034 | 1037 | | |
1035 | 1038 | | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
1040 | 1048 | | |
1041 | 1049 | | |
1042 | 1050 | | |
1043 | 1051 | | |
1044 | 1052 | | |
1045 | 1053 | | |
1046 | 1054 | | |
| 1055 | + | |
1047 | 1056 | | |
1048 | 1057 | | |
1049 | 1058 | | |
| |||
1054 | 1063 | | |
1055 | 1064 | | |
1056 | 1065 | | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
1057 | 1073 | | |
1058 | 1074 | | |
1059 | 1075 | | |
| |||
0 commit comments