Open Bug 1597374 Opened 5 years ago Updated 2 years ago

redux-presist not updating local storage a browser

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: daisyhadden93, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36

Steps to reproduce:

I'm using redux-persist for my e-commerce project.

When I updated my app to new version I found a new bug.

I changed my initialState from array into object.

My app in Chrome (browser that i test and run my app on it) crashed !! because my initialState still array(NOT UPDATE) and new method was not returned anything. (Of course).

But in Mozilla and other Browsers that I not use before them my app working currently !

why!?

My Store Config :
import { createStore, applyMiddleware } from 'redux'
import { persistStore } from 'redux-persist'
import logger from 'redux-logger'

import RootReducer from './RootReducer'

const middleware = [logger]

export const store = createStore(RootReducer, applyMiddleware(...middleware))

export const persistore = persistStore(store)
My rootReducer Config :

import { combineReducers } from 'redux'
import { persistReducer } from 'redux-persist'
import storage from 'redux-persist/lib/storage'

import UserReducer from './User/UserReducer'
import ShoppingBagDropdownReducer from './ShoppingBagDropdown/ShoppingBagDropdownReducer'
import DirectoryReducer from './Directory/DirectoryReducer'
import ShopDataReducer from './ShopData/ShopDataReducer'

const persistConfig = {
key: 'root',
storage,
whileList: ['shoppingBagDropdown']
}

const rootReducer = combineReducers({
user: UserReducer,
shoppingBagDropdown: ShoppingBagDropdownReducer,
shopData: ShopDataReducer,
directory: DirectoryReducer
})

export default persistReducer(persistConfig, rootReducer)

Hi,
This seems a bit to technical for me but maybe one of our devs can take a look and might be able to reproduce on their end. I'm not sure if DOM: Core & HTML is the correct component for it but it seems like a good place to start.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Version: 3.6 Branch → unspecified
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.