Fix small web interface nits from the RC smoke test (#1215)

Fix the "Permamently" typo in the delete instance confirm.

The Search Mod Portal dialog now opens on the default mod pack's
Factorio version, or the newest known version when there is no default
pack. It used to always start on 2.0. A version the user picks still
sticks while the page is open.

The mod portal cache key used request.hide_deprecated directly, and the
web interface never sends it, so the controller logged "2.0-undefined".
A missing value now counts as false, the same default
fetchAllModsFromPortal already uses, so "2.1" and "2.1-false" share a
cache entry.

Closes #1209

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
BastiaanandClaude Opus 5.5 authored and GitHub committed 2026-11-17 10:57:32 +00:00
1 parent c6bc81b0df
commit 09d79d775f
4 files changed
+65 -20

No files matched your search

+37
View File
@@ -123,6 +123,43 @@ describe("controller/src/ControlConnection", function() {
});
});
describe(".handleModPortalGetAllRequest()", function() {
let mockController;
let _fetch;
let urls;
beforeEach(function() {
mockController = {
config: new lib.ControllerConfig("controller"),
modPortalCache: new Map(),
};
urls = [];
_fetch = global.fetch;
global.fetch = async url => {
urls.push(new URL(url));
return { ok: true, json: async () => ({ results: [], pagination: { page_count: 1 } }) };
};
});
afterEach(function() {
global.fetch = _fetch;
});
async function getAll(request) {
return await ControlConnection.prototype.handleModPortalGetAllRequest.call(
{ _controller: mockController }, request,
);
}
it("treats a missing hide_deprecated as false", async function() {
await getAll(new lib.ModPortalGetAllRequest("2.1"));
assert.deepEqual([...mockController.modPortalCache.keys()], ["2.1-false"]);
assert.equal(urls[0].searchParams.get("hide_deprecated"), "false");
await getAll(new lib.ModPortalGetAllRequest("2.1", false));
assert.equal(urls.length, 1, "explicit false should hit the cache");
});
});
describe(".handleInstanceCreateRequest()", function() {
let mockController;