Commit 2e3d419
authored
fix: invalid references to http client & cli (#259)
Each environment holds a reference to the http client and the cli
mainly for operations like start, stop, update, etc... performed by
either one or the other.
In the past we recreated the environment instances each time we polled,
effectively updating the references to the cli and http client.
This was really important for the cases where Coder Toolbox was already
running and a URI was executed. In this case we recreate new instances
of
the http client and cli that are the used by the poller to create a new
list of environments. However, not too long we discovered that
recreating
the environments instances each time has unwanted effects. The obvious
fix
was to update the existing env. instances instead of creating new ones.
But the update failed to take into account that the cli and http client
references also need to a refresh after a URI execution.
As a result, environment actions stopped working after new instances
were created
by the URI handler. This fix ensures those references are properly
refreshed.1 parent b3c9bd8 commit 2e3d419
3 files changed
Lines changed: 16 additions & 4 deletions
File tree
- src/main/kotlin/com/coder/toolbox
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
355 | | - | |
356 | 354 | | |
357 | 355 | | |
358 | 356 | | |
| |||
371 | 369 | | |
372 | 370 | | |
373 | 371 | | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
374 | 380 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
| 444 | + | |
444 | 445 | | |
445 | 446 | | |
446 | 447 | | |
| |||
521 | 522 | | |
522 | 523 | | |
523 | 524 | | |
| 525 | + | |
524 | 526 | | |
525 | 527 | | |
526 | 528 | | |
| |||
0 commit comments