hypha-debugger 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hypha-debugger.mjs
CHANGED
|
@@ -5612,7 +5612,20 @@ class HyphaDebugger {
|
|
|
5612
5612
|
connectConfig.workspace = this.config.workspace;
|
|
5613
5613
|
if (this.config.token)
|
|
5614
5614
|
connectConfig.token = this.config.token;
|
|
5615
|
-
|
|
5615
|
+
try {
|
|
5616
|
+
this.server = await connect(connectConfig);
|
|
5617
|
+
}
|
|
5618
|
+
catch (connErr) {
|
|
5619
|
+
// If connecting to a saved workspace fails (e.g. expired/garbage-collected),
|
|
5620
|
+
// retry without the workspace to get a fresh one.
|
|
5621
|
+
if (this.config.workspace) {
|
|
5622
|
+
console.warn(`[hypha-debugger] Failed to rejoin workspace "${this.config.workspace}", getting a fresh one:`, connErr.message ?? connErr);
|
|
5623
|
+
this.server = await connect({ server_url: this.config.server_url });
|
|
5624
|
+
}
|
|
5625
|
+
else {
|
|
5626
|
+
throw connErr;
|
|
5627
|
+
}
|
|
5628
|
+
}
|
|
5616
5629
|
// Register debug service
|
|
5617
5630
|
this.serviceInfo = await this.server.registerService(this.buildServiceDefinition());
|
|
5618
5631
|
// Update overlay and build session
|
|
@@ -5687,10 +5700,14 @@ class HyphaDebugger {
|
|
|
5687
5700
|
*/
|
|
5688
5701
|
saveConfigToStorage() {
|
|
5689
5702
|
try {
|
|
5703
|
+
// Save workspace so we can rejoin the same one (keeps URL stable),
|
|
5704
|
+
// but never save the token — anonymous workspace tokens expire and
|
|
5705
|
+
// cause "Permission denied" on reconnect. For anonymous workspaces
|
|
5706
|
+
// no token is needed to rejoin; for authenticated workspaces the
|
|
5707
|
+
// user must provide a fresh token via data attributes or config.
|
|
5690
5708
|
const data = {
|
|
5691
5709
|
server_url: this.config.server_url,
|
|
5692
5710
|
workspace: this.server?.config?.workspace ?? this.config.workspace,
|
|
5693
|
-
token: this.config.token,
|
|
5694
5711
|
service_id: this.config.service_id,
|
|
5695
5712
|
service_name: this.config.service_name,
|
|
5696
5713
|
show_ui: this.config.show_ui,
|