Return to Responsive profile from Tablet Offline / Phone Offline

2
Hi all, I’m running into an issue where i’m unable to return from an offline profile back to the responsive profile. At the moment we have a case where a offline profile user should be able to navigate back to a responsive profile to do some actions in the responsive part of the app and later return to the offline PWA. But there is no way for me to move from the offline page back to the responsive profile, because it looks like everything is received from cache first. Browser console states no profile kind is passed when i try to open the url https://<base>/index3.html?profile=Responsive. When i look into service-worker.js, i noticed only the offline profiles are there, that explains the issue above, My question is how to open an url from an offline profile that uses a service worker. How to bypass the service worker, or hard reload a page from the server. It works in a local environment because the service worker is not active there. Some smart JS or redirect logic perhaps? Things i tried - Open URL with Responsive profile as parameter → cached offline page is loaded - Close page, Open URL → cached offline page is loaded - location.replace() JS → cached page is loaded
asked
1 answers
3

Fixed it with some help, add these steps before opening the new profile:

Step 1: Setting the cookie manually in JS:
 

		document.cookie = key + "=" + value + ";"
		return true;

 

Step 2: Clear local storage in JS:

 

		try {
			localStorage.clear();
			return true;
		} catch (e) {
			console.error(e);
			return false;
	}


And then using Open URL activity to open URL './index3.html?profile=Responsive'

This works, but it should work by just replacing the URL with ‘profile=Responsive’ suffix like Mendix documented. Support is informed :)

answered