learning_ai_common_plat/packages/fastify-core
saravanakumardb1 3a5196417d fix(errors): make ServiceError instanceof cross-instance-safe
When docker-prep packs @bytelyst/* as tarballs, a second physical copy of
@bytelyst/errors can be created, breaking prototype identity. The
fastify-core error handler's 'error instanceof ServiceError' then returned
false, mis-mapping ConflictError/BadRequestError/etc. to HTTP 500.

Fix: brand ServiceError instances with a global Symbol.for() key and add a
Symbol.hasInstance that recognizes any branded instance for the base class,
while preserving prototype-chain semantics for subclasses. Resilient to
duplicated module copies without touching call sites.

- errors: brand + custom hasInstance (+3 cross-instance unit tests)
- fastify-core: regression test (duplicated-copy ServiceError -> 409 not 500)
- bump @bytelyst/errors 0.1.11 -> 0.1.13, published to Gitea registry
2026-05-28 22:02:35 -07:00
..
src fix(errors): make ServiceError instanceof cross-instance-safe 2026-05-28 22:02:35 -07:00
package.json fix(gitea): set ROOT_URL=host.docker.internal, NO_PROXY for host (F17) 2026-05-27 01:51:43 -07:00
tsconfig.json feat: add package tests (58 new) + @bytelyst/fastify-core package 2026-02-12 22:17:17 -08:00