Freshdesk Issue with App Uninstall Set-Up Events

Hi Team,

I’m facing issues with disallowing the app uninstallation based on certain conditions. On Local Env its working fine as expected but after deployment it throws the default error message instead of the custom message given in the app file.
Error message - “There was an error during uninstallation”. If this issue persists, please contact support."

I have attached screenshots of the code snippet and error message for reference.
Can someone help resolve this issue ASAP.

Regards,
Shobana


Hi @shobana,

Greetings!

Do you make API calls in that event?

Hi Benny,

Thanks for your reply, No I’m not making any API Calls as for now.

As mentioned in the previous post code snippet i’m just trying to show a simple error message. But can you confirm if I can include API calls inside it and based on that I can show an error message?

Regards,
Shobana

Hey @shobana,
I see that in the onAppUninstall event you have a console.log, do you see that in the app logs?

Yes, you can make API calls and post which renderData() is used for returning the execution.

Note - renderData({message:"Any error message"}) will result in unsuccessful app uninstallation. For a successful uninstallation, use renderData().
https://developers.freshworks.com/docs/app-sdk/v2.3/freshservice/serverless-apps/app-set-up-events/#configure-onappuninstall

Hi @jones

Thanks for your reply. Yes, I can see the logs in the app logs section.

Regards,
Shobana

Hi @shobana,
I hope changing to renderData() has resolved this.

Hi @joneszachariah.noeln@freshworks.com

Yes, using renderData() has resolved this, but I need to display an error message based on certain conditions on uninstall click.

Regards,
Shobana

1 Like

Hey @shobana,

Ideally, using the below snippet should show the message -

renderData({message: "Uninstallation failed due to network error."});

Can you share the HAR logs when you click on uninstall? So that I can check it internally?

Hi jones,

Thanks for your response, please refer to the below HAR logs attached.

Regards,
Shobana

ctpcr.freshdesk.com.har (138 KB)

Hi @shobana,
I don’t see the error message “network error” in the HAR logs so for deeper investigation, I’ve created a support ticket about this query.

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.