Fossil

Check-in [5b9a4c90]
Login

Check-in [5b9a4c90]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Disabled localStorage as a backend option for the fossil.storage JS API after it was painfully discovered that multiple repos on the same hoster actually share that storage, as opposed to it being achored at the repo. That API now uses sessionStorage, if available, before falling back to transient instance-local storage.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5b9a4c90594d8ea64d3e4d2bed3c00e76b8fa029820a46cff5b5f5663e85b945
User & Date: stephan 2020-08-18 18:19:57
References
2020-08-18
18:44
Backported in [5b9a4c90594d8ea6], as explained in detail at https://fossil-scm.org/forum/forumpost/0f56c9edd9. ... (check-in: af383a7b user: stephan tags: branch-2.12)
Context
2020-08-18
20:46
Re-enabled localStorage for fossil.storage but enhanced it to sandbox the keys used by the apps on a per-repo basis, so there is no longer any (immediately visible) cross-repo polution. The underlying localStorage/sessionStorage is still shared per origin/browser profile instance, but fossil.storage clients will only see the state from their own repo. ... (check-in: 923affb9 user: stephan tags: trunk)
18:44
Backported in [5b9a4c90594d8ea6], as explained in detail at https://fossil-scm.org/forum/forumpost/0f56c9edd9. ... (check-in: af383a7b user: stephan tags: branch-2.12)
18:19
Disabled localStorage as a backend option for the fossil.storage JS API after it was painfully discovered that multiple repos on the same hoster actually share that storage, as opposed to it being achored at the repo. That API now uses sessionStorage, if available, before falling back to transient instance-local storage. ... (check-in: 5b9a4c90 user: stephan tags: trunk)
14:00
Allow <del> and <ins> markup in wiki and in markdown. ... (check-in: ae9a9db5 user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/fossil.storage.js.

15
16
17
18
19
20
21



22

23
24
25
26
27
28
29
30
    }catch(e){
      return undefined;
    }
  };

  /** Internal storage impl for fossil.storage. */
  const $storage =



        tryStorage(window.localStorage)

        || tryStorage(window.sessionStorage)
        || tryStorage({
          // A basic dummy xyzStorage stand-in
          $:{},
          setItem: function(k,v){this.$[k]=v},
          getItem: function(k){
            return this.$.hasOwnProperty(k) ? this.$[k] : undefined;
          },







>
>
>
|
>
|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
    }catch(e){
      return undefined;
    }
  };

  /** Internal storage impl for fossil.storage. */
  const $storage =
        /* We must not use localStorage on a multi-repo domain!
          See: https://fossil-scm.org/forum/forumpost/0e794dbb91

          tryStorage(window.localStorage)
          ||*/
        tryStorage(window.sessionStorage)
        || tryStorage({
          // A basic dummy xyzStorage stand-in
          $:{},
          setItem: function(k,v){this.$[k]=v},
          getItem: function(k){
            return this.$.hasOwnProperty(k) ? this.$[k] : undefined;
          },