mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
The swimlanes CRUD e2e test (23-rest-api-more.e2e.js:209) regressed on all browsers. Root cause: on the server ReactiveCache.getSwimlanes is async, so board.swimlanes() returns a Promise in the REST handler. The #3624 change read board.swimlanes().map(s => s.sort); .map on a Promise throws, the insert never ran, the error was swallowed by the handler's catch (returned as 200 with no _id), and the test read .title off a null swimlane. The earlier "move the require to a top-level import" commit was not the real cause (the same module.exports import pattern works server-side, e.g. ruleDeletePermission in rulesButton.js). The actual fix is to await board.swimlanes() before mapping. This also means API-created swimlanes now get a real max(existing sort)+1 sort — previously the un-awaited `.length` yielded undefined, so they were stored with no sort at all, which is the #3624 symptom. Verified: the swimlane test passed in every kept local run through 2026-07-09_02-38-07 and failed starting 09-52-25 (right after the #3624 change), confirming the regression window; the tests/swimlaneSort.test.cjs unit test still passes.