Skip to content

Bug report: spo tenant recyclebinitem restore --wait flag not functioning as expected #5504

@Saurabh7019

Description

@Saurabh7019

Priority

(Low) Something is a little off

Description

spo tenant recyclebinitem restore command does not behave as expected when using the --wait flag. According to the documentation, the --wait flag should make the command wait until the deleted site collection is fully restored. However, in my testing, the command works the same way whether I use the --wait flag or not.

Steps to reproduce

Use the spo tenant recyclebinitem restore command with and without the --wait flag, as follows:

spo tenant recyclebinitem restore --siteUrl https://contoso.sharepoint.com/sites/team1 --wait
spo tenant recyclebinitem restore --siteUrl https://contoso.sharepoint.com/sites/team1

Expected results

If the wait flag is used, the command should wait until the site collection is fully restored before completing. It should return immediately when the flag is not used with the below output:

{
  "HasTimedout": false,
  "IsComplete": false,
  "PollingInterval": 15000
}

Actual results

The command appears to wait and behaves the same way as when the --wait flag is used.

Diagnostics

Executing command spo tenant recyclebinitem restore with options {"options":{"siteUrl":"https://contoso.sharepoint.com/sites/CSC","debug":true,"output":"json"}}
SPO URL previously retrieved https://contoso.sharepoint.com. Returning...
Existing access token still valid. Returning...
Request:
{
"url": "https://contoso-admin.sharepoint.com/_api/SPOInternalUseOnly.Tenant/RestoreDeletedSite",
"method": "post",
"headers": {
"Accept": "application/json;odata=nometadata",
"Content-Type": "application/json;charset=utf-8",
"user-agent": "NONISV|SharePointPnP|CLIMicrosoft365/7.0.0",
"accept-encoding": "gzip, deflate",
"X-ClientService-ClientTag": "M365CLI:7.0.0",
"authorization": "Bearer "
},
"responseType": "text",
"decompress": true,
"data": {
"siteUrl": "https://contoso.sharepoint.com/sites/CSC"
}
}
Response:
{
"url": "https://contoso-admin.sharepoint.com/_api/SPOInternalUseOnly.Tenant/RestoreDeletedSite",
"status": 200,
"statusText": "OK",
"headers": {
"cache-control": "private, max-age=0",
"transfer-encoding": "chunked",
"content-type": "application/json;odata=nometadata;streaming=true;charset=utf-8",
"expires": "Tue, 05 Sep 2023 10:10:46 GMT",
"last-modified": "Wed, 20 Sep 2023 10:10:46 GMT",
"vary": "Origin,Accept-Encoding",
"p3p": "CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"",
"x-networkstatistics": "0,1051136,0,387,437985,0,1051136",
"x-sharepointhealthscore": "0",
"x-sp-serverstate": "ReadOnly=0",
"dataserviceversion": "3.0",
"spclientservicerequestduration": "759",
"sprequestduration": "760",
"x-aspnet-version": "4.0.30319",
"x-databoundary": "EU",
"x-1dscollectorurl": "https://eu-mobile.events.data.microsoft.com/OneCollector/1.0/",
"x-ariacollectorurl": "https://eu-mobile.events.data.microsoft.com/Collector/3.0",
"sprequestguid": "ef43dca0-305d-7000-66f6-17197cf012b3",
"request-id": "ef43dca0-305d-7000-66f6-17197cf012b3",
"ms-cv": "oNxD710wAHBm9hcZfPASsw.0",
"strict-transport-security": "max-age=31536000",
"x-frame-options": "SAMEORIGIN",
"content-security-policy": "frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com teams.microsoftonline.cn *.powerapps.com *.yammer.com *.officeapps.live.com *.office.com *.stream.azure-test.net *.microsoftstream.com *.dynamics.com *.microsoft.com onedrive.live.com *.onedrive.live.com securebroker.sharepointonline.com;",
"x-powered-by": "ASP.NET",
"microsoftsharepointteamservices": "16.0.0.24030",
"x-content-type-options": "nosniff",
"x-ms-invokeapp": "1; RequireReadOnly",
"x-cache": "CONFIG_NOCACHE",
"x-msedge-ref": "Ref A: 0B27C8A15CF2498C8A1720F58074D0A8 Ref B: STOEDGE1116 Ref C: 2023-09-20T10:10:46Z",
"date": "Wed, 20 Sep 2023 10:10:46 GMT",
"connection": "close"
},
"data": "{"HasTimedout":false,"IsComplete":true,"PollingInterval":15000}"
}
{
"HasTimedout": false,
"IsComplete": true,
"PollingInterval": 15000
}
DONE

CLI for Microsoft 365 version

v7.0.0

nodejs version

v18.17.1

Operating system (environment)

Windows

Shell

PowerShell

cli doctor

No response

Additional Info

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions