Commit 2236a4e
authored
feat(ux): client-side connection error modal with algorithm debugging (#476)
* feat(ux): client-side connection error modal with algorithm debugging
Replace server-side HTML error pages with rich client-side error modals.
When SSH connections fail, the client now receives structured error data
via the 'connection-error' WebSocket event and displays a helpful modal
with algorithm debugging information.
Changes:
- Add SSH algorithm capture from ssh2 debug logs during handshake
- Add algorithm analyzer to detect client/server mismatches and suggest fixes
- Add error normalizer for consistent, meaningful SSH error messages
- New 'connection-error' socket event with ConnectionErrorData payload
- Remove server-side HTML error page rendering (error-page.ts deleted)
- SSH validation moved from HTTP request to WebSocket connection
- Update webssh2_client to v3.2.0 (includes ConnectionErrorModal)
New files:
- app/services/ssh/algorithm-capture.ts - Captures algorithm negotiation
- app/services/ssh/algorithm-analyzer.ts - Analyzes compatibility issues
- app/services/ssh/error-normalizer.ts - Normalizes SSH2 error messages
- app/constants/algorithm-env-vars.ts - Environment variable mappings
BREAKING CHANGE: Error responses are now JSON-only. Clients must handle
the 'connection-error' event to display connection failures.
* test: update e2e tests for client-side error modal
Update authentication tests to work with the new ConnectionErrorModal:
- Tests now click "Try Again" button to dismiss error modal before
checking for login form visibility
- Replace tests expecting HTTP 401/502 status codes with tests that
verify error modal appears with appropriate messages
- Remove unused testBasicAuthErrorResponse import
The new behavior serves the client (200) for all Basic Auth requests
and displays connection errors via WebSocket 'connection-error' event.
* fix(lint): use export type...from syntax for re-exports
Replace import-then-export pattern with direct export type...from
syntax to fix SonarQube S7763 warnings in auth-utils.ts.
* refactor(test): extract shared algorithm test fixtures
Move duplicated AlgorithmSet builders from algorithm-analyzer and
algorithm-capture tests into shared fixtures file to reduce code
duplication flagged by SonarQube.
* fix(lint): remove deprecated eslint-env comments
ESLint flat config no longer recognizes /* eslint-env */ comments.
The existing /* global */ comments already declare the needed browser
globals, making eslint-env redundant.
* refactor(test): use credential builders and shared fixtures
- Use validCredentials(), invalidCredentials(), credentialsWithHost(),
and credentialsWithPort() helpers in Playwright tests
- Extract shared algorithm test fixtures to reduce inline definitions
- Use it.each pattern for parametrized test cases
* fix(lint): resolve SonarQube warnings
- S7763: use export...from for type re-exports
- S6571: simplify Error | unknown to just unknown
- S4624: extract nested template literals to variables
- S4144: deduplicate identical createModernClientSet function1 parent 0e1c280 commit 2236a4e
File tree
38 files changed
+2523
-1081
lines changed- DOCS
- api
- configuration
- features
- app
- auth
- config
- connection
- constants
- logging
- middleware
- routes
- adapters
- handlers
- templates
- services/ssh
- socket/adapters
- types/contracts/v1
- tests
- playwright
- unit/services/ssh
38 files changed
+2523
-1081
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
390 | | - | |
391 | 390 | | |
392 | 391 | | |
393 | 392 | | |
| |||
469 | 468 | | |
470 | 469 | | |
471 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
472 | 499 | | |
473 | 500 | | |
474 | 501 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
| |||
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
| 144 | + | |
141 | 145 | | |
142 | 146 | | |
143 | 147 | | |
| |||
149 | 153 | | |
150 | 154 | | |
151 | 155 | | |
| 156 | + | |
152 | 157 | | |
153 | 158 | | |
154 | 159 | | |
155 | 160 | | |
156 | 161 | | |
| 162 | + | |
157 | 163 | | |
| 164 | + | |
158 | 165 | | |
159 | 166 | | |
160 | 167 | | |
| |||
178 | 185 | | |
179 | 186 | | |
180 | 187 | | |
| 188 | + | |
181 | 189 | | |
182 | 190 | | |
183 | 191 | | |
| |||
187 | 195 | | |
188 | 196 | | |
189 | 197 | | |
| 198 | + | |
190 | 199 | | |
191 | 200 | | |
192 | 201 | | |
| |||
265 | 274 | | |
266 | 275 | | |
267 | 276 | | |
268 | | - | |
| 277 | + | |
| 278 | + | |
269 | 279 | | |
270 | 280 | | |
271 | 281 | | |
272 | 282 | | |
273 | 283 | | |
274 | | - | |
| 284 | + | |
| 285 | + | |
275 | 286 | | |
276 | 287 | | |
277 | 288 | | |
| |||
299 | 310 | | |
300 | 311 | | |
301 | 312 | | |
| 313 | + | |
302 | 314 | | |
303 | 315 | | |
304 | 316 | | |
| |||
310 | 322 | | |
311 | 323 | | |
312 | 324 | | |
| 325 | + | |
313 | 326 | | |
314 | 327 | | |
315 | 328 | | |
| |||
328 | 341 | | |
329 | 342 | | |
330 | 343 | | |
331 | | - | |
| 344 | + | |
| 345 | + | |
332 | 346 | | |
333 | 347 | | |
334 | 348 | | |
| |||
342 | 356 | | |
343 | 357 | | |
344 | 358 | | |
| 359 | + | |
345 | 360 | | |
346 | 361 | | |
347 | 362 | | |
| |||
350 | 365 | | |
351 | 366 | | |
352 | 367 | | |
353 | | - | |
| 368 | + | |
0 commit comments