fix: memoryAsyncStorage

This commit is contained in:
devthejo 2025-07-01 13:40:29 +02:00
parent 0001a50a5f
commit 6e290bdb69
2 changed files with 177 additions and 32 deletions

View file

@ -186,7 +186,11 @@
F7ADCC68A8E44BA69FCA849E /* Fix Xcode 15 Bug */,
B1AB92A327A24FB294681EDD /* 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 = (
);
@ -1099,6 +1103,142 @@ fi";
shellScript = "
echo \"Remove signature files (Xcode workaround)\";
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 */

View file

@ -152,19 +152,20 @@ export const memoryAsyncStorage = {
storageLogger.debug("Set in memory cache", { key });
// Try to persist to AsyncStorage
try {
await AsyncStorage.setItem(key, value);
storageLogger.debug("Persisted to AsyncStorage", { key });
} catch (error) {
storageLogger.warn(
"Failed to persist to AsyncStorage, kept in memory only",
{
key,
error: error.message,
},
);
// Continue - value is at least in memory
}
(async () => {
try {
await AsyncStorage.setItem(key, value);
storageLogger.debug("Persisted to AsyncStorage", { key });
} catch (error) {
storageLogger.warn(
"Failed to persist to AsyncStorage, kept in memory only",
{
key,
error: error.message,
},
);
}
})();
},
/**
@ -178,16 +179,18 @@ export const memoryAsyncStorage = {
storageLogger.debug("Deleted from memory cache", { key });
// Try to delete from AsyncStorage
try {
await AsyncStorage.removeItem(key);
storageLogger.debug("Deleted from AsyncStorage", { key });
} catch (error) {
storageLogger.warn("Failed to delete from AsyncStorage", {
key,
error: error.message,
});
// Continue - at least removed from memory
}
(async () => {
try {
await AsyncStorage.removeItem(key);
storageLogger.debug("Deleted from AsyncStorage", { key });
} catch (error) {
storageLogger.warn("Failed to delete from AsyncStorage", {
key,
error: error.message,
});
// Continue - at least removed from memory
}
})();
},
/**
@ -242,14 +245,16 @@ export const memoryAsyncStorage = {
storageLogger.info("Cleared memory cache");
// Try to clear AsyncStorage
try {
await AsyncStorage.clear();
storageLogger.info("Cleared AsyncStorage");
} catch (error) {
storageLogger.warn("Failed to clear AsyncStorage", {
error: error.message,
});
}
(async () => {
try {
await AsyncStorage.clear();
storageLogger.info("Cleared AsyncStorage");
} catch (error) {
storageLogger.warn("Failed to clear AsyncStorage", {
error: error.message,
});
}
})();
},
/**