Home › Forums › Classic DFFS › Feature Request: DFFS Session vs Local Storage Option
Tagged: dffs sp2010 browser
- This topic has 9 replies, 4 voices, and was last updated 3 years, 1 month ago by Rick Nichols.
-
AuthorPosts
-
-
November 12, 2021 at 02:12 #35099
Hi Alex,
This is a bit of an odd Feature Request. We are supporting a number of Internet Explorer (sigh) users for whom the implementation of Local Storage is inconsistent at best.
I know that you use Local storage for some of the Backend DFFS Editor features, and wondered if you could modify the DFFS configuration files so that, as the installer of DFFS, I could choose to use Session Storage rather than Local Storage – retaining Local Storage as the default.
Thanks for your assistance.
Mark
-
November 12, 2021 at 17:03 #35113
The only thing I use localStorage for is to remember the selections related to the buttons and theme selector in the ACE code editor. Do you get an error message related to the use of localStorage?
Alexander
-
November 14, 2021 at 23:04 #35129
Hi Alex, I work with Mark and I think what he is recommending is a toggle option in Misc to choose between the use of Session Storage rather than Local Storage.
It is not uncommon for users to get the below error message after DFFS code has been published, resulting in the need to users to call IT Support desk to fix the issue by performing an Appssense Clear
- This reply was modified 3 years, 1 month ago by Rick Nichols.
Attachments:
-
November 15, 2021 at 18:46 #35134
This error occurs when the config (that is stored in JSON format) is parsed and the parsing fails. Are you sure this has anything to do with using localStorage?
In the DFFS frontend localStorage is only used to keep track of which tab is selected if you opt to remember this (set in “Remember selected tab” in the Misc tab).
What kind of mode (Document mode and User agent string) do your Internet Explorer use when this happens? – you find this by hitting F12 and looking at the “Emulation” tab.
Alexander
-
November 17, 2021 at 04:35 #35149
Hi Alexander,
For some reason the environment that is used has an error with any reference to local storage. For example the following would error:
window.localeStorage
Something as simple as this should just display the object in the console, however, there is some issue with the environment with some users not being able to access it.
It’s not caused by DFFS but we have no way of fixing the larger environment issue.
The issue is rare but it does happen in other environments: https://superuser.com/questions/1080011/localstorage-on-edge-produces-an-internal-error-occurred-in-the-microsoft-inter
We’ve had to change all other code for applications to use sessionStorage instead of locale to prevent app crashes…very annoying.
Currently using document mode 10.
-
November 17, 2021 at 06:33 #35154
By rare, we mean several time a week this occurs
-
November 17, 2021 at 14:13 #35162
You can try adding this to the DFFS Loader file you are using – add it to the top of the HTML file in a script tag like this:
<script> var _setItem = Storage.prototype.setItem; var _getItem = Storage.prototype.getItem; Storage.prototype.setItem = function(key, value) { if (this === window.localStorage) { // do what you want if setItem is called on localStorage sessionStorage.setItem(key, value); } else { // fallback to default action _setItem.apply(this, arguments); } } Storage.prototype.getItem = function(key) { if (this === window.localStorage) { // do what you want if getItem is called on localStorage return sessionStorage.getItem(key); } else { // fallback to default action return _getItem.apply(this, arguments); } } </script>
I found this here: https://stackoverflow.com/questions/13612643/is-it-possible-to-override-local-storage-and-session-storage-separately-in-html5
Please note that I cannot guarantee it will work.
Alexander
-
November 19, 2021 at 07:02 #35171
Hi Alex,
Again, thanks for taking time to review this issue – and your suggestion of corrupt profiles being the root cause is very much what we are thinking since the behaviour is unreproduceable except for certain individuals.
As it turns out ( for affected users ) the script snippet you provided results in a DFFS Load timeout- even if wrapped in try/catch. Works fine for other users, works fine in Chrome.
We’re rather a long way down the rabbit hole on this one, so I was wondering if there was a way to override the error text shown above in capture.png – in a way similar to your override of the Storage get/setter – in order to inform the affected user that they should in fact contact the helpdesk and have their profile re-created.
-
November 20, 2021 at 09:38 #35181
I have published a new version that lets you specify a custom message in this error placeholder. See change log for details: https://spjsblog.com/2021/11/20/dffs-package-updated-to-v4-4-5-38/
Alexander
-
-
November 25, 2021 at 10:39 #35236
Thanks heaps Alex, this is great!
-
-
AuthorPosts
- You must be logged in to reply to this topic.