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 */, 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 */

View file

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