Search before asking
I searched existing issues and couldn't find a duplicate.
Version
- Apache Fory commit:
33e0dc06 (upstream main as of 2026-05-11)
- Component: JavaScript (
@apache-fory/core)
- Node.js:
v22.18.0
- OS: macOS (Darwin 24.6.0)
Minimal reproduce step
const core = require("./javascript/packages/core/dist/index.js");
const Fory = core.default;
const { Type } = core;
const fory = new Fory({ compatible: true });
const serializer = fory.typeResolver.regenerateReadSerializer(
Type.struct({ namespace: "demo", typeName: "repro_struct" }, {
id: Type.int32(),
}),
);
console.log("typeof getTypeInfo =", typeof serializer.getTypeInfo);
serializer.getTypeInfo(); // throws
Observed output on upstream main:
typeof getTypeInfo = undefined
TypeError: serializer.getTypeInfo is not a function
What did you expect to see?
regenerateReadSerializer() should return a serializer that preserves the required serializer interface methods, including getTypeInfo.
What did you see instead?
In javascript/packages/core/lib/typeResolver.ts, regenerateReadSerializer() only forwards a subset of methods (getHash/read/...) to registerSerializer(...) and misses getTypeInfo.
This can crash runtime paths that call original.getTypeInfo(), for example in javascript/packages/core/lib/context.ts (getRegeneratedReadSerializerCache / genSerializerByTypeMetaRuntime).
Anything Else?
I have a local fix ready and can submit a PR:
return this.registerSerializer(typeInfo, {
getHash: serializer.getHash,
getTypeInfo: serializer.getTypeInfo,
...
});
Are you willing to submit a PR?
Search before asking
I searched existing issues and couldn't find a duplicate.
Version
33e0dc06(upstreammainas of 2026-05-11)@apache-fory/core)v22.18.0Minimal reproduce step
Observed output on upstream main:
What did you expect to see?
regenerateReadSerializer()should return a serializer that preserves the required serializer interface methods, includinggetTypeInfo.What did you see instead?
In
javascript/packages/core/lib/typeResolver.ts,regenerateReadSerializer()only forwards a subset of methods (getHash/read/...) toregisterSerializer(...)and missesgetTypeInfo.This can crash runtime paths that call
original.getTypeInfo(), for example injavascript/packages/core/lib/context.ts(getRegeneratedReadSerializerCache/genSerializerByTypeMetaRuntime).Anything Else?
I have a local fix ready and can submit a PR:
Are you willing to submit a PR?