Skip to content

fix: override default delete confirmation dialog #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 3, 2025

Conversation

fioan89
Copy link
Collaborator

@fioan89 fioan89 commented Apr 2, 2025

fioan89 added 2 commits April 2, 2025 23:20
- right now there are two confirmation dialogs when removing a workspace from Toolbox
- with this patch we force Toolbox to discard its default dialog and show a custom one with
  the Coder titles and messages.
- no longer valid after delete confirmation dialog is using the new api
@fioan89 fioan89 requested review from matifali and bcpeinhardt April 2, 2025 20:27
fioan89 added 2 commits April 2, 2025 23:50
- workspace status is usually updated every 5 seconds by the polling loop.
- that's a bit problematic because when we delete a workspace we have to wait a
  couple of seconds until we have some visual feedback.
- with this patch we force the workspace status to be in "deleting" if the REST api call
  was succesfull.
- right now we depend on the underlying okhttp/moshi marshaller on which order
  the workspaces are listed.
- instead we can sort them by name and guarantee some consistency
@fioan89 fioan89 merged commit b24a324 into main Apr 3, 2025
5 checks passed
@fioan89 fioan89 deleted the fix-delete-confirmation-dialog branch April 3, 2025 07:55
fioan89 added a commit that referenced this pull request Aug 11, 2025
When the plugin is upgraded while JBClient is connected to a remote dev
server via the Coder SSH proxy/tunnel, the upgrade process kills and
re-establishes the SSH connection. However, JBClient/Toolbox fails to
detect the restored connection and reports "Toolbox: Target environment
com.coder.toolbox:bobiverse-bob.dev not found" error.

While digging into the Toolbox bytecode—specifically
`ClientOverSshTunnelConnector` — I realized the issue likely stems from
an incorrect equals implementation in our custom SSH connection info
object. In short, when a plugin upgrade terminates the SSH tunnel, the
connector’s monitoring logic correctly detects the lost connection and
waits. But when the SSH connection is re-established, the monitoring
logic fails to recognize it as a valid replacement, because equals is
still using the default `Object#equals` rather than a proper value-based
implementation.

Unfortunately, I wasn’t able to properly test this—specifically,
upgrading from a version without the fix to one that includes it—because
all Toolbox marketplace feeds are signed, preventing us from using a
tool like mitmproxy to serve a locally modified plugin version. Given
that, I propose releasing the change first and then performing the
upgrade test to confirm the fix.

- resolves #61
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

There are two confirmation dialogs shown when deleting a workspace
2 participants