Files
Lauri Ojansivu 2f626d099d Fix "Utils is not defined"/"ReactiveCache is not defined" in four client files.
Reported directly: clicking a newly created label did not enlarge it or
apply it to the card. The browser console showed "Exception in
Template.cardFlowtime canControlFlow" and the same for
Template.cardPomodoro canControlPomodoro - both call Utils.canModifyCard()
but never import Utils (a plain ES export from client/lib/utils.js, not a
Meteor global), so the helper threw a ReferenceError the moment either
template's reactive computation ran, which broke the surrounding card
render along with it.

Searching the whole tree for the same shape (a client file calling
Utils.<method>() or ReactiveCache.<method>() without importing it) found
two more real, independent instances:
- client/components/settings/notificationSettingsPopup.js's
  currentBoard() called Utils.getCurrentBoardId() unimported.
- client/components/main/bookmarks.js's four helpers/events called
  ReactiveCache.getCurrentUser() unimported - the header bookmarks/Starred
  feature.
- client/lib/tests/Utils.tests.js did `import '../utils';` (a bare
  side-effect import) and then used the bare `Utils` global throughout -
  never actually reached by the fast Node suite (a mocha/browser test),
  but would have thrown the same way if run.

None of this is caught by rspack's build (it does not type-check or
cross-check imports app-wide) or by tests/run-node-suites.cjs (nothing
exercises these code paths with the name deliberately left undefined) -
only the browser, live, the moment that render actually runs.

tests/clientSingletonImports.test.cjs sweeps every client/**/*.js file for
a call to Utils.<method>( or ReactiveCache.<method>( with no matching
import, so this shape cannot reappear anywhere else undetected.

Verified against a real Meteor boot (`meteor run`) in-sandbox.

Thanks to xet7 !
2026-09-11 00:13:10 +03:00
..