kamranahmedse / redux-persist-expire

Expiring transformer for redux-persist
MIT License
78 stars 12 forks source link

expireSeconds useless in case of page refresh #1

Closed pastinepolenta closed 5 years ago

pastinepolenta commented 5 years ago

redux-persist fires at initial action persist/PERSIST at page refresh. This causes the persistedAtKey to set to the current time and so expireSeconds loses of meaning because it would work only if the user stares at the page for X seconds without refreshing.

Is this a bug, the desired behavior or am I missing something?

kamranahmedse commented 5 years ago

Fixed, thanks for reporting 👍

pastinepolenta commented 5 years ago

I am not sure why but I can still reproduce. The persistedAt time get reset at every page refresh so the expiration never happens.

EDIT: ok never mind. I found out that I was using it together with a whitelist filter and I was filtering out the property 'persistedAt' . The library could not find the property and so it was resetting it to the current time.