schibsted / account-sdk-browser

Schibsted Account SDK for browsers
https://schibsted.github.io/account-sdk-browser/
MIT License
16 stars 11 forks source link

hassession: emit proper events and ensure caching works properly #43

Closed torarvid closed 6 years ago

torarvid commented 6 years ago

Fixes #40

There were two things happening here:

  1. The events were not being emitted when we used values from the cache 🤦‍♂️
  2. The cache had a setTimeout that would remove cached items after an expiresIn amount of milliseconds (coming from the Schibsted account backend). When Safari is used, the backend sends 2592000000 (30 days), which exceeds the maximum value for setTimeout and in this case, it executes immediately.
codecov[bot] commented 6 years ago

Codecov Report

Merging #43 into master will increase coverage by 0.04%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #43      +/-   ##
==========================================
+ Coverage      94%   94.04%   +0.04%     
==========================================
  Files          14       14              
  Lines         400      403       +3     
  Branches       83       83              
==========================================
+ Hits          376      379       +3     
  Misses         23       23              
  Partials        1        1
Impacted Files Coverage Δ
src/identity.js 91.03% <100%> (+0.06%) :arrow_up:
src/cache.js 93.02% <100%> (+0.34%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 58aab48...d842ef0. Read the comment docs.