Feature Request: DFFS Session vs Local Storage Option

Forums Dynamic Forms for SharePoint Feature Request: DFFS Session vs Local Storage Option

Viewing 8 reply threads
  • Author
    Posts
    • #35099
      Mark Maconachie
      Participant

      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

    • #35113
      Alexander Bautz
      Keymaster

      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

    • #35129
      Rick Nichols
      Participant

      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

      Attachments:
    • #35134
      Alexander Bautz
      Keymaster

      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

    • #35149
      Ross
      Participant

      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.

      • This reply was modified 2 weeks, 5 days ago by Ross.
      • This reply was modified 2 weeks, 5 days ago by Ross.
    • #35154
      Rick Nichols
      Participant

      By rare, we mean several time a week this occurs

    • #35162
      Alexander Bautz
      Keymaster

      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

    • #35171
      Mark Maconachie
      Participant

      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.

    • #35236
      Rick Nichols
      Participant

      Thanks heaps Alex, this is great!

Viewing 8 reply threads
  • You must be logged in to reply to this topic.