Using fdk dev=true when jumping between tickets

Hi,

When building our app for Freshdesk we use the fdk. With the command fdk run we can test how our app behavior and debug it into tickets by appending ?dev=true to the ticket url.

This is working perfectly when we’re into a ticket, but I have one thing I cannot debug:

When testing the app when the agent jumps between tickets, using the Next / Previous ticket buttons: the ?dev=true is removed and the fdk debug is lost, thus I cannot test how the app is refreshing when jumping between tickets (and we have issues to fix in this situation)

Any advice to make it work?

Hey @jba1

Welcome to the community!

As far as I know, the app should still be running and activated although the dev=true disappears, as the page itself is not reloaded.

I just tried it with a small test app:

let client;

init();

async function init() {
  client = await app.initialized();
  console.log("app, which is running in debug mode, initialized");
  client.events.on('app.activated', onAppActivate);
  client.events.on('ticket.propertiesUpdated', onPropertiesUpdated, {intercept: true});
}

async function onAppActivate() {
  
  ticket = await client.data.get("ticket");
  console.log("app, which is running in debug mode activated with ticket " + ticket.ticket.id);
}

Output when clicking next button a few times:

So as far as I can tell, it should still work when switching between tickets.

I am running 9.3.1.

HTH
Tom

Hi ThomasH, thanks a lot for your answer.

As the ticket_conversation_editor disappears during navigation I thought first we lost the dev connection, however you’re right it still works.
My mistake was here just in case it could help anyone else, is that I was passing a parameter in the callback, like this:
this.client.events.on('app.activated', this.refreshInfos(true)); // buggy one
This ended up by not triggering my refreshInfos method at all except at the initialization time.
The fix was to remove any extra parameter from the callback, and it works as expected:
this.client.events.on('app.activated', this.refreshInfos); // working one

Thank you again for your kind and helpful input ThomasH!!