-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
offline data not push in to outbox queue during aeroplane mode of mobile. #484
Comments
Could you provide some snapshots of your store to see what's going on? |
import { createStore, applyMiddleware, compose } from "redux";
import { persistStore, persistReducer } from "redux-persist";
import AsyncStorage from "@react-native-async-storage/async-storage";
import ReduxThunk from "redux-thunk";
import ReduxLogger from "redux-logger";
import hardSet from "redux-persist/lib/stateReconciler/hardSet";
import rootReducer from "@store/store";
//offline
import { createOffline } from "@redux-offline/redux-offline";
import offlineConfig from "@redux-offline/redux-offline/lib/defaults";
const {
middleware: offlineMiddleware,
enhanceReducer: offlineEnhanceReducer,
enhanceStore: offlineEnhanceStore
} = createOffline({
...offlineConfig,
persist: false
});
const persistConfig = {
key: "root",
storage: AsyncStorage,
stateReconciler: hardSet,
whitelist: ["user", "inbox", "app", "offline", "journal", "learning", "todayCount"]
};
// const store: Store<IAppState> = createStore(
// offlineEnhancer.enhanceReducer(rootReducer),
// initialState,
// composeEnhancers(
// offlineEnhancer.enhanceStore,
// applyMiddleware(offlineEnhancer.middleware as any, epicMiddleware),
// )
// );
const persistedReducer = persistReducer(persistConfig, offlineEnhanceReducer(rootReducer));
const isDevMode = Boolean(__DEV__);
const middleWares = isDevMode ? [offlineMiddleware, ReduxThunk, ReduxLogger] : [offlineMiddleware, ReduxThunk];
const store = createStore(persistedReducer, {}, compose(offlineEnhanceStore, applyMiddleware(...middleWares)));
const persistor = persistStore(store);
export default { store, persistor }; |
hey @sorodrigo when i am online but my app treat me as offline "offline": {
"busy": false,
"lastTransaction": 30,
"netInfo": {
"isConnectionExpensive": false,
"reach": "wifi"
},
"online": true,
"outbox": [
],
"retryCount": 0,
"retryScheduled": false
} and thats why my data nor push into outbox and neitther pop ,i have to switch on and off my internet then it will work as offline "offline": {
"busy": false,
"lastTransaction": 34,
"netInfo": {
"isConnectionExpensive": undefined,
"reach": "none"
},
"online": false,
"outbox": [
[
Object
]
],
"retryCount": 0,
"retryScheduled": false
} |
Hmm I'm sorry but it's very hard to tell with the info I have. Are you testing in a simulator? Could you verify this happens in a real device? Also could you send me the state of the outbox:
|
@aadarsh13pathak please redact tokens and personal data before sharing stuff 😳 |
@sorodrigo yes this happens in my real device Before enable aeroplane mode"offline": {
}, after enable aeroplane mode"offline": {
}, after disable aeroplane mode"offline": {
after enable and disable my phone internet and that time my app work fine"offline": {
|
@sorodrigo could you tell me , |
I create a app which have offline and online modes,when i switch to aeroplane mode and open my application and add some data in offline mode after adding data ,i close the app then turn on my mobile internet and then open my application and there is no data which i have added in offline mode and after that my normal data not added in online mode also ...
this redux offline working goood when i normally close my mobile internet and add something in my app it will go in the outbox successfully and showing on the UI in the online mode ,but when i switch my mobile phone in Aeroplane mode and then open my application and add something item it will go in to the offline outbox and when i turn on my mobile internet for checking my offline data is come or not but it not come on the UI and my outbox queue is increasing continously .
**in Aeroplane mode my offline data not push in to offline outbox **
The text was updated successfully, but these errors were encountered: