"Uninstall" button in sample not functional

Hi,

I'm trying to create a new Premium Application install Wizard and have been trying out the GitHub sample. For some reason, the "Uninstall" button seems to be failing.

When I push the Uninstall button is that the screen clears showing the busy dots with the text "Uninstalling OAuth Clients..." then the Wizard appears briefly then I'm immediately redirected back to the app page. Reloading the wizard page after pushing Uninstall just redirects me to the app page as well.

Looking at the network traffic, I see that a call to https://api.usw2.pure.cloud/api/v2/oauth/clients/ec7e9a4f-35d1-401f-b07d-4ca4e9cf28fa is returning a 400 error. Unfortunately, there isn't any addition information on what caused the 400 failure.

This is just using the sample code from GitHub with no modifications.

I'm guessing I must have something misconfigured.

Thoughts?

Posting a follow up here in case anyone else runs into this issue. The root cause seems to be a server side issue stemming from this line in the oauth-client.js file of the wizard sample:

   entity.state = 'inactive';
   let result = await oAuthApi.putOauthClient(entity.id, entity);

This line should be setting the OAuth client to inactive, which is a prerequisite for deleting it. This happens in the next line of code after this one. The issue is that this line is causing the server to return a 400 error which is complaining that the dateToDelete field is a number when it should be a date string. However, when you look at the raw request body, the dateToDelete field is in fact a property formatted ISO-8601 string.

The next thing of note is that in spite of returning a 400 error, the method seems to be actually successfully changing the status to inactive. So the solution is to just swallow the 400 error and pretend that it was actually a 200. I did this by surrounding that call with a try catch block:

    entity.state = 'inactive';
    try {
          let result = await oAuthApi.putOauthClient(entity.id, entity);
    } catch (e) {
          // ignore the error
    }

This allows the code to proceed as if it had been successful. Doing so seems to allow the app to successfully uninstall completely.

Thanks!

I also received the same issue and applied the same fix