diff --git a/CHANGELOG.md b/CHANGELOG.md index b2a2a5f44..cef2ba68b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [8.8.4](https://github.com/NativeScript/android/compare/v8.8.3...v8.8.4) (2024-09-06) + + +### Bug Fixes + +* ensure same mtime for js and code cache to prevent loading old code caches ([#1822](https://github.com/NativeScript/android/issues/1822)) ([3d6e101](https://github.com/NativeScript/android/commit/3d6e10115227ad556e5bbe1764217716ab5bdac7)) + + + ## [8.8.3](https://github.com/NativeScript/android/compare/v8.8.2...v8.8.3) (2024-09-02) diff --git a/package.json b/package.json index 58e85dc74..5cf1360fc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@nativescript/android", "description": "NativeScript for Android using v8", - "version": "8.8.3", + "version": "8.8.4", "repository": { "type": "git", "url": "https://github.com/NativeScript/android.git" diff --git a/test-app/runtime/src/main/cpp/ModuleInternal.cpp b/test-app/runtime/src/main/cpp/ModuleInternal.cpp index 07f2588cd..a7779cc50 100644 --- a/test-app/runtime/src/main/cpp/ModuleInternal.cpp +++ b/test-app/runtime/src/main/cpp/ModuleInternal.cpp @@ -23,6 +23,8 @@ #include #include #include +#include +#include using namespace v8; using namespace std; @@ -478,8 +480,9 @@ ScriptCompiler::CachedData* ModuleInternal::TryLoadScriptCache(const std::string auto cacheLastModifiedTime = result.st_mtime; if (stat(path.c_str(), &result) == 0) { auto jsLastModifiedTime = result.st_mtime; - if (jsLastModifiedTime > 0 && cacheLastModifiedTime > 0 && jsLastModifiedTime > cacheLastModifiedTime) { - // The javascript file is more recent than the cache file => ignore the cache + if (jsLastModifiedTime != cacheLastModifiedTime) { + // files have different dates, ignore the cache file (this is enforced by the + // SaveScriptCache function) return nullptr; } } @@ -508,6 +511,16 @@ void ModuleInternal::SaveScriptCache(const Local