Hi team,
In my user sidebar app, I'm trying to add handlers for events such as an update of the ticket requester.
My app duplicates some of the default user sidebar fields such as Phone and Locale.
I noticed that if I switch to the user sidebar, change the user's locale, then switch back to my app and try to update the requester (with a test button), I receive an outdated requester json where the locale is the one that requester had before the change.
// We've changed the ticket requester's locale from English to Spanish
// and clicked the button to get refreshed user data:
const testButton = document.getElementById('test-button');
testButton.addEventListener('click', async () =>
{
const freshRequesterId = (await client.get('ticket.requester.id'))['ticket.requester.id'];
const refreshedRequester = await client.request(`/api/v2/users/${freshRequesterId}.json`);
console.log('refreshedRequester: ', refreshedRequester);
// refreshedRequester json shows user locale is still English
});So far my concerns is the locale, not sure if there are other properties affected.
AI suggests that Zendesk might be caching some data and providing outdated data for performance reasons…
Is there away to instantly get refreshed data when I change the user's locale?
Thank you.