fix: memoryAsyncStorage
This commit is contained in:
parent
0001a50a5f
commit
6e290bdb69
2 changed files with 177 additions and 32 deletions
|
@ -186,7 +186,11 @@
|
||||||
F7ADCC68A8E44BA69FCA849E /* Fix Xcode 15 Bug */,
|
F7ADCC68A8E44BA69FCA849E /* Fix Xcode 15 Bug */,
|
||||||
B1AB92A327A24FB294681EDD /* Fix Xcode 15 Bug */,
|
B1AB92A327A24FB294681EDD /* Fix Xcode 15 Bug */,
|
||||||
0E26E4D25E2E49C3AB2723FA /* Fix Xcode 15 Bug */,
|
0E26E4D25E2E49C3AB2723FA /* Fix Xcode 15 Bug */,
|
||||||
8589214E888941E1817F4C9F /* Remove signature files (Xcode workaround) */,
|
5D0A324371BA4A5385A92DF5 /* Fix Xcode 15 Bug */,
|
||||||
|
40472AFA41A8495E9D557630 /* Fix Xcode 15 Bug */,
|
||||||
|
771057F6078145908B36B18B /* Fix Xcode 15 Bug */,
|
||||||
|
7C1CC306C4DF48D4B5E1BDFB /* Fix Xcode 15 Bug */,
|
||||||
|
2401E852B4D64D59BD803280 /* Remove signature files (Xcode workaround) */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
|
@ -1099,6 +1103,142 @@ fi";
|
||||||
shellScript = "
|
shellScript = "
|
||||||
echo \"Remove signature files (Xcode workaround)\";
|
echo \"Remove signature files (Xcode workaround)\";
|
||||||
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
|
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
|
||||||
|
";
|
||||||
|
};
|
||||||
|
5D0A324371BA4A5385A92DF5 /* Fix Xcode 15 Bug */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
name = "Fix Xcode 15 Bug";
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "if [ \"$XCODE_VERSION_MAJOR\" = \"1500\" ]; then
|
||||||
|
echo \"Remove signature files (Xcode 15 workaround)\"
|
||||||
|
find \"$BUILD_DIR/${CONFIGURATION}-iphoneos\" -name \"*.signature\" -type f | xargs -r rm
|
||||||
|
fi";
|
||||||
|
};
|
||||||
|
C637A42109E14A1AA86AF639 /* Remove signature files (Xcode workaround) */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
name = "Remove signature files (Xcode workaround)";
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "
|
||||||
|
echo \"Remove signature files (Xcode workaround)\";
|
||||||
|
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
|
||||||
|
";
|
||||||
|
};
|
||||||
|
40472AFA41A8495E9D557630 /* Fix Xcode 15 Bug */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
name = "Fix Xcode 15 Bug";
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "if [ \"$XCODE_VERSION_MAJOR\" = \"1500\" ]; then
|
||||||
|
echo \"Remove signature files (Xcode 15 workaround)\"
|
||||||
|
find \"$BUILD_DIR/${CONFIGURATION}-iphoneos\" -name \"*.signature\" -type f | xargs -r rm
|
||||||
|
fi";
|
||||||
|
};
|
||||||
|
B79BB2C3F48A4CC4B6830286 /* Remove signature files (Xcode workaround) */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
name = "Remove signature files (Xcode workaround)";
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "
|
||||||
|
echo \"Remove signature files (Xcode workaround)\";
|
||||||
|
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
|
||||||
|
";
|
||||||
|
};
|
||||||
|
771057F6078145908B36B18B /* Fix Xcode 15 Bug */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
name = "Fix Xcode 15 Bug";
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "if [ \"$XCODE_VERSION_MAJOR\" = \"1500\" ]; then
|
||||||
|
echo \"Remove signature files (Xcode 15 workaround)\"
|
||||||
|
find \"$BUILD_DIR/${CONFIGURATION}-iphoneos\" -name \"*.signature\" -type f | xargs -r rm
|
||||||
|
fi";
|
||||||
|
};
|
||||||
|
83ACE65C55FE44EC820FD39A /* Remove signature files (Xcode workaround) */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
name = "Remove signature files (Xcode workaround)";
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "
|
||||||
|
echo \"Remove signature files (Xcode workaround)\";
|
||||||
|
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
|
||||||
|
";
|
||||||
|
};
|
||||||
|
7C1CC306C4DF48D4B5E1BDFB /* Fix Xcode 15 Bug */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
name = "Fix Xcode 15 Bug";
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "if [ \"$XCODE_VERSION_MAJOR\" = \"1500\" ]; then
|
||||||
|
echo \"Remove signature files (Xcode 15 workaround)\"
|
||||||
|
find \"$BUILD_DIR/${CONFIGURATION}-iphoneos\" -name \"*.signature\" -type f | xargs -r rm
|
||||||
|
fi";
|
||||||
|
};
|
||||||
|
2401E852B4D64D59BD803280 /* Remove signature files (Xcode workaround) */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
name = "Remove signature files (Xcode workaround)";
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "
|
||||||
|
echo \"Remove signature files (Xcode workaround)\";
|
||||||
|
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
|
||||||
";
|
";
|
||||||
};
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
|
@ -152,6 +152,7 @@ export const memoryAsyncStorage = {
|
||||||
storageLogger.debug("Set in memory cache", { key });
|
storageLogger.debug("Set in memory cache", { key });
|
||||||
|
|
||||||
// Try to persist to AsyncStorage
|
// Try to persist to AsyncStorage
|
||||||
|
(async () => {
|
||||||
try {
|
try {
|
||||||
await AsyncStorage.setItem(key, value);
|
await AsyncStorage.setItem(key, value);
|
||||||
storageLogger.debug("Persisted to AsyncStorage", { key });
|
storageLogger.debug("Persisted to AsyncStorage", { key });
|
||||||
|
@ -163,8 +164,8 @@ export const memoryAsyncStorage = {
|
||||||
error: error.message,
|
error: error.message,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
// Continue - value is at least in memory
|
|
||||||
}
|
}
|
||||||
|
})();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -178,6 +179,7 @@ export const memoryAsyncStorage = {
|
||||||
storageLogger.debug("Deleted from memory cache", { key });
|
storageLogger.debug("Deleted from memory cache", { key });
|
||||||
|
|
||||||
// Try to delete from AsyncStorage
|
// Try to delete from AsyncStorage
|
||||||
|
(async () => {
|
||||||
try {
|
try {
|
||||||
await AsyncStorage.removeItem(key);
|
await AsyncStorage.removeItem(key);
|
||||||
storageLogger.debug("Deleted from AsyncStorage", { key });
|
storageLogger.debug("Deleted from AsyncStorage", { key });
|
||||||
|
@ -188,6 +190,7 @@ export const memoryAsyncStorage = {
|
||||||
});
|
});
|
||||||
// Continue - at least removed from memory
|
// Continue - at least removed from memory
|
||||||
}
|
}
|
||||||
|
})();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -242,6 +245,7 @@ export const memoryAsyncStorage = {
|
||||||
storageLogger.info("Cleared memory cache");
|
storageLogger.info("Cleared memory cache");
|
||||||
|
|
||||||
// Try to clear AsyncStorage
|
// Try to clear AsyncStorage
|
||||||
|
(async () => {
|
||||||
try {
|
try {
|
||||||
await AsyncStorage.clear();
|
await AsyncStorage.clear();
|
||||||
storageLogger.info("Cleared AsyncStorage");
|
storageLogger.info("Cleared AsyncStorage");
|
||||||
|
@ -250,6 +254,7 @@ export const memoryAsyncStorage = {
|
||||||
error: error.message,
|
error: error.message,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
})();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue