2

After doing some debugging of an Aura Component on a real iPhone, I went almost crazy because I needed to kill/restart the Salesforce mobile app at minimum 2 times and sometimes even more often to force the app to reload code changes of my lightning component.

Swiping down never reloads an Aura Component. For sure there is some nasty caching going... Nice for users, bad for developers.

Now I found a better way debug using Simulator and Safari on MacOS as described here: How to Run and Debug Salesforce Mobile App on the desktop? (reloaded 3rd time and many years later...)

At first I thought with the simulator I only need to kill the app once. Unfortunately it is not reliable. Sometime I need to kill the app up to 5 times to get the updates served.

But even killing it once feels so bad and is wasting so much time and useless clicking. For some processes there is the need to navigate to a record to provide context for a component. This might require many clicks.

What is the fastes way of refreshing to get my most recent changes of my Aura Component's code rendered in any kind of debug session for iPhone using as less clicks as even possible? I need to tweak the UI and reload the code many hundred times. Therefore every single second counts!

I need the rendering and CSS applied exactly as on iPhone. The iPhone rendering differs from Desktop and Android. Other CSS is getting applied. Sometimes Desktop vs. iPhone looks only slightly different. But sometime the difference is massive. Additionally I need an inspector to review which CSS is applied in detail. Therefore I use XCode Simulator and Safari for now. But I don't care which toolchain to use as long as it is inspectable and fast and cache-free.

There is another very nasty side effect with this issue:

  • I got a report from a key user that a functionality which worked and works fine is broken.
  • I've tried to reproduce: everything works flawlessly.
  • But the key user did not hallucinate: it really did not work for him.
  • The reason was: The latest version had massive changes in the Component and in the Apex code. Now the key user got served an old version of the Component talking to a new version of the Apex code server side.

Is there a cache clear, hard reload, force refresh or fast killer-reloader to get that done faster? lightning fast preferably ;-)

How to deal with updates for production? How to prevent End-Users from working with an old client side component with new server side Apex? This caching is error prone and even very dangerous for updates of production orgs.

Any ideas?

What do I have tried so far?

  • there is a UserMenu > Settings > Advanced > Clear Cached Data. As an unfortunate using this is resulting into very laggy and unstable response of the app. Reloading takes forever. It looks like this has to be done at least 2 time to get a chance of a refreshed component. But is absolutely awful and way worse compared to kill the app.
  • there is a refresh button in the Safari inspector. This would be where I would expect the function. It is reloading, but it will take a lot of repetitions and in most cases it is not updating the source of the Aura Components at all. Worse than killing the app.
  • why do I need to kill the app sometimes once, sometimes twice and sometimes a lot of times until I got served with the latest component? What is causing this random behavior?
  • How it can be enforced to clear any kind of cached and stale data starting with a freshly served component?

Current Method / Workaround

  • using Simulator and Safari now for a couple of days I found that the reload button in Safari Dev Tools is not perfect but the best what I've found so far.
  • the reload button keeps at least the context and the connected debug window. Killing the app, disconnects the debug window and requires to navigate to the page you need
  • so only the issue to have to reload two or more times remains with this method

enter image description here

2
  • Did you ever figure this out?
    – VarunC
    Mar 21 at 14:15
  • @VarunC no, I did not. This sucks big time
    – Uwe Heim
    Mar 25 at 11:41

0

You must log in to answer this question.

Browse other questions tagged .