## Summary
Resolves all 38 SonarCloud **typescript:S9383** findings ("Promises must
be awaited, end with a call to .catch, end with a call to .then with a
rejection handler or be explicitly marked as ignored with the `void`
operator") in `frontend/apps/artcraft/app`, across 19 files. They are:
- startup calls in `index.tsx`, such as `SyncStorytellerApiConfig()` and
`persistLogin()`
- polling in `useActiveJobs`, `useBackgroundLoadingMedia`,
`signals/activeJobs.ts` and `signals/authentication/fetchers.ts`
- listener cleanups (`unlisten*.then(f => f())`) in `TaskQueue` and
`useDesktopGenerationFeed`
- UI handlers that start uploads or renames, such as
`ImageTo3DExperience`, `UploadFilesMedia`, `SceneTitleInput`,
`ProfileDropdown` and `DesktopGenerationGallery`
- async IIFEs in `useDesktopUsername`, `TaskQueue` and
`BaseImageSelector`
This is part 2 of 3 for artcraft's 157 S9383 findings. Part 1 (Tauri
libraries) is #2805. Part 3 (`libs/components`) is #2807.
Several of these files are also changed by open PRs for unrelated
reasons, for example #2519, #2520, #2615 and #2064. Each change here
inserts one word at the start of a statement, so a rebase either way is
trivial.
## Approach
This ports the approach of storytold/artcraft-services#179, which fixes
the same rule in artcraft-services. **#179 is still open and unmerged.**
This PR follows its approach and does not depend on it.
- Each flagged expression is a fire-and-forget promise: a listener
`setup()`, an `unlisten.then(f => f())` cleanup, a loader called from an
effect, an upload kicked off from a handler, or an async IIFE. Prefixing
it with `void` marks the ignored promise explicitly, which is the fix
the rule documents.
- It deliberately does not add `.catch()` everywhere. These call sites
already handle failures inside the async function or surface them
through their own state, and empty handlers would hide errors.
- Async IIFEs become `void (async () => …)()`. `if (cond) call()`
becomes `if (cond) void call()`.
- There is no behaviour change. `void` only discards the promise value,
which was already being discarded.
Each insertion is placed at the exact `textRange` start offset of the
SonarCloud finding, with no other edits.
## Testing
- Each changed file parses with `esbuild <file>`, using the same check
as #179.
- I parsed each changed file with the TypeScript 5.9 compiler API
(`createSourceFile`). That found no parse errors, and every inserted
`void` is either a whole expression statement or an arrow-function body
applied to a call, never part of a larger expression.
- `frontend/.eslintrc.json` has no `no-void` rule.
- I did not run the full Nx type-check, lint or test targets, because
`frontend/node_modules` is not installed in my environment. Please rely
on CI.
- No tests are added. Discarding an already-discarded promise value is
not observable, so no test can fail before this change and pass after
it.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Chores**
* Updated background tasks across uploads, sign-in, polling, scene
editing, and other app workflows to handle asynchronous operations
consistently.
* Existing workflows and their success and error handling remain
unchanged; no user-facing behavior changes are expected.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Artcraft frontend
This Nx workspace contains the Tauri desktop frontend in apps/artcraft and its
shared libraries in libs. Website and Netlify builds live in artcraft-services.
Use Node.js 20 or newer and npm. Run the following commands from frontend/:
npm ci
npx nx dev artcraft
npx nx build artcraft
The frontend development server uses port 5173. Start the Rust app separately from the repository root:
./script/artcraft/unix_rust_dev.sh
The repository-root frontend launcher installs dependencies and starts the same server:
./script/artcraft/unix_frontend_dev.sh
On Windows, use script/artcraft/windows_frontend_dev.ps1 and
script/artcraft/windows_rust_dev.ps1 in separate terminals. See
development setup for Rust and Tauri prerequisites.
The Vite build writes apps/artcraft/dist, which Tauri bundles. Public resources
come from apps/artcraft/app/public. The app also needs its retained libraries,
root package lock, TypeScript project references, and Nx/Vite configuration.
The aliases in tsconfig.base.json resolve shared libraries to their source for
both development and production. The app's Vite configuration loads this file
explicitly so imports inside shared libraries use the same aliases. The desktop
build does not require library dist/ outputs or a separate library build.
Import shared libraries by the names declared in their package.json files:
import { Button } from "@storyteller/ui-button";
import { Modal } from "@storyteller/ui-modal";
Use the workspace-local Nx version through npx nx. npm ci and the release
workflows use the checked-in lockfile; do not reinstall different Nx versions
inside CI.
clean_modules.sh is an explicit cleanup command that removes build outputs,
Nx caches, and frontend dependencies. Do not run it when preserving local build
outputs during repository pruning.