@@ -400,12 +400,7 @@ func (b BrowsersCmd) Delete(ctx context.Context, in BrowsersDeleteInput) error {
400400 return nil
401401 }
402402
403- var confirmMsg string
404- if found .Persistence .ID == in .Identifier {
405- confirmMsg = fmt .Sprintf ("Are you sure you want to delete browser with persistent ID \" %s\" ?" , in .Identifier )
406- } else {
407- confirmMsg = fmt .Sprintf ("Are you sure you want to delete browser with ID \" %s\" ?" , in .Identifier )
408- }
403+ confirmMsg := fmt .Sprintf ("Are you sure you want to delete browser \" %s\" ?" , in .Identifier )
409404 pterm .DefaultInteractiveConfirm .DefaultText = confirmMsg
410405 result , _ := pterm .DefaultInteractiveConfirm .Show ()
411406 if ! result {
@@ -414,21 +409,20 @@ func (b BrowsersCmd) Delete(ctx context.Context, in BrowsersDeleteInput) error {
414409 }
415410
416411 if found .Persistence .ID == in .Identifier {
417- pterm .Info .Printf ("Deleting browser with persistent ID: %s\n " , in .Identifier )
418412 err = b .browsers .Delete (ctx , kernel.BrowserDeleteParams {PersistentID : in .Identifier })
419413 if err != nil && ! util .IsNotFound (err ) {
420414 return util.CleanedUpSdkError {Err : err }
421415 }
422- pterm .Success .Printf ("Successfully deleted browser with persistent ID : %s\n " , in .Identifier )
416+ pterm .Success .Printf ("Successfully deleted browser: %s\n " , in .Identifier )
423417 return nil
424418 }
425419
426- pterm .Info .Printf ("Deleting browser with ID : %s\n " , in .Identifier )
420+ pterm .Info .Printf ("Deleting browser: %s\n " , in .Identifier )
427421 err = b .browsers .DeleteByID (ctx , in .Identifier )
428422 if err != nil && ! util .IsNotFound (err ) {
429423 return util.CleanedUpSdkError {Err : err }
430424 }
431- pterm .Success .Printf ("Successfully deleted browser with ID : %s\n " , in .Identifier )
425+ pterm .Success .Printf ("Successfully deleted browser: %s\n " , in .Identifier )
432426 return nil
433427 }
434428
@@ -443,7 +437,7 @@ func (b BrowsersCmd) Delete(ctx context.Context, in BrowsersDeleteInput) error {
443437 }
444438 }
445439
446- // Attempt by persistent ID
440+ // Attempt by persistent ID (backward compatibility)
447441 if err := b .browsers .Delete (ctx , kernel.BrowserDeleteParams {PersistentID : in .Identifier }); err != nil {
448442 if ! util .IsNotFound (err ) {
449443 nonNotFoundErrors = append (nonNotFoundErrors , err )
@@ -2571,7 +2565,7 @@ func truncateURL(url string, maxLen int) string {
25712565 return url [:maxLen - 3 ] + "..."
25722566}
25732567
2574- // resolveBrowserByIdentifier finds a browser by session ID or persistent ID.
2568+ // resolveBrowserByIdentifier finds a browser by session ID or persistent ID (backward compatibility) .
25752569func (b BrowsersCmd ) resolveBrowserByIdentifier (ctx context.Context , identifier string ) (* kernel.BrowserListResponse , error ) {
25762570 page , err := b .browsers .List (ctx , kernel.BrowserListParams {})
25772571 if err != nil {
0 commit comments