feat(update): cache fetched release notes and strict-match patch notes version

This commit is contained in:
1jamie
2026-08-16 15:31:19 -05:00
parent 46f73b7bb3
commit e9a4a592a4
3 changed files with 82 additions and 7 deletions
+15
View File
@@ -68,6 +68,12 @@ do
"stashed notes name a release version")
end
do
local notes, ver = PatchNotes.fromRepo("999.999.999")
eq(notes, nil, "fromRepo returns nil when a specific engine version is missing")
eq(ver, nil, "fromRepo version is nil when missing")
end
do
local f = assert(io.open("mobile/ios/app-repo.json", "rb"))
local list = PatchNotes.parseRepo(f:read("*a"))
@@ -78,6 +84,15 @@ do
eq(notes, list[2].notes, "fromRepo returns that version's notes")
end
do
local oldVersion = package.loaded["src.core.Version"]
package.loaded["src.core.Version"] = { engine = "999.999.999" }
local body, ver = PatchNotes.body(nil)
eq(body, "Unable to fetch patch notes.", "returns Unable to fetch patch notes when version is uncached and unlisted")
eq(ver, "999.999.999", "returns the requested engine version")
package.loaded["src.core.Version"] = oldVersion
end
imp._appPatchNotes = true
local modal = drawAndCapture(imp)
check(modal:find("Patch notes", 1, true) ~= nil, "the modal titles itself")