You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**A shared helper under `Anything.Application.Features` must not be named `*Query`, `*Command` or `*Handler`.**`CqrsPatternTests` and `NamingConventionTests` assert that *every* type in that namespace with one of those suffixes implements `IRequest`/`IRequestHandler`, so a plain static helper called e.g. `InventoryThumbnailQuery` fails the architecture tests with nothing wrong in the code itself. Name it for what it does (`InventoryThumbnailLookup`, `*Mapping`).
220
229
-**Filter a nullable FK with a `List<int?>`, not `.Value`.**`ids.Contains(a.ItemId)` where `ids` is `List<int?>` translates to a plain `= ANY(@ids)`; `ids.Contains(a.ItemId.Value)` leans on EF's nullable unwrapping and can throw at translation time. Nothing local catches this — the unit tests' `AsAsyncQueryable` provider is LINQ-to-objects and executes untranslatable expressions happily, and `dotnet build` has no opinion. Same class of trap as the raw-SQL translations `SearchEndpointTests` exists to cover.
221
230
-**Adding a constructor parameter to a query handler breaks its unit tests at compile time**, since `InventoryHandlerTests` and friends construct handlers positionally. A repository substitute also needs `.Query()` stubbed (`Substitute.For<IRepository<T>>()` returns null otherwise, and `ToListAsync` NREs) — `InventoryTestDoubles` in `InventoryHandlerTests.cs` is the shared factory for that.
231
+
-**An ESM-only npm package breaks Jest, and `transformIgnorePatterns` can't fix it — add it to `transpilePackages` in `next.config.ts`.** Packages shipping only ESM (`marked`, `@microsoft/kiota-abstractions`) fail with `SyntaxError: Unexpected token 'export'` in Jest, because next/jest **hardcodes**`/node_modules/` as the first ignore pattern and only *appends* a custom `transformIgnorePatterns` (see `next/dist/build/jest/jest.js`) — a `/node_modules/(?!(pkg)/)` override in `jest.config.mjs` is silently outranked. Listing the package in `transpilePackages` is what makes next/jest emit `/node_modules/(?!.pnpm)(?!(pkg)/)` instead. `npm run build` passes either way, so only the Jest run catches it.
222
232
-**Adding a key to `HomeCardKeys.All` breaks `HomePreferenceEndpointTests`**, which asserts the exact default card list and sort orders. Update it in the same change; the frontend's `DEFAULT_HOME_CARD_ORDER` in `anything-frontend/src/app/HomeCards.tsx` mirrors the same list and needs the matching entry.
223
233
-**Model-changing pushes break `update-api-client` on the first push — this is expected.** When a push adds/changes an entity, `update-ef-migrations` and `update-api-client` run in parallel on the *same* pre-migration commit. `update-api-client` boots the API, whose startup `MigrateAsync` escalates `PendingModelChangesWarning` to a fatal error because the migration doesn't exist yet, so Swagger never comes up and Kiota generation times out (exit 124). `update-ef-migrations` meanwhile commits the migration. To regenerate the client you must re-trigger `update-api-client` on a commit that *already contains* the migration — and it only triggers on `src/Anything.{API,Contracts,Application,Core}/**` (NOT `src/Anything.Database/**`, where migrations live). Fix: after the migration lands, make a small backend-path change (e.g. XML-doc the new contracts) in your next push, then pull/rebase the regenerated client before validating the frontend.
224
234
-**Snapshot bot `[skip ci]` commits don't re-trigger PR checks.** The PR's `Visual Snapshot Tests` check does NOT rerun on the baseline-containing commit — the PR stays red with the pre-baseline failure as its latest check. After the bot commit lands, push a small non-`[skip ci]` commit (docs, comment) to sync the PR and rerun checks on a tip that includes the baselines.
0 commit comments