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.
@@ -14069,7 +14069,20 @@
14069
14069
  connectConfig.workspace = this.config.workspace;
14070
14070
  if (this.config.token)
14071
14071
  connectConfig.token = this.config.token;
14072
- this.server = await connect(connectConfig);
14072
+ try {
14073
+ this.server = await connect(connectConfig);
14074
+ }
14075
+ catch (connErr) {
14076
+ // If connecting to a saved workspace fails (e.g. expired/garbage-collected),
14077
+ // retry without the workspace to get a fresh one.
14078
+ if (this.config.workspace) {
14079
+ console.warn(`[hypha-debugger] Failed to rejoin workspace "${this.config.workspace}", getting a fresh one:`, connErr.message ?? connErr);
14080
+ this.server = await connect({ server_url: this.config.server_url });
14081
+ }
14082
+ else {
14083
+ throw connErr;
14084
+ }
14085
+ }
14073
14086
  // Register debug service
14074
14087
  this.serviceInfo = await this.server.registerService(this.buildServiceDefinition());
14075
14088
  // Update overlay and build session
@@ -14144,10 +14157,14 @@
14144
14157
  */
14145
14158
  saveConfigToStorage() {
14146
14159
  try {
14160
+ // Save workspace so we can rejoin the same one (keeps URL stable),
14161
+ // but never save the token — anonymous workspace tokens expire and
14162
+ // cause "Permission denied" on reconnect. For anonymous workspaces
14163
+ // no token is needed to rejoin; for authenticated workspaces the
14164
+ // user must provide a fresh token via data attributes or config.
14147
14165
  const data = {
14148
14166
  server_url: this.config.server_url,
14149
14167
  workspace: this.server?.config?.workspace ?? this.config.workspace,
14150
- token: this.config.token,
14151
14168
  service_id: this.config.service_id,
14152
14169
  service_name: this.config.service_name,
14153
14170
  show_ui: this.config.show_ui,