The GitHub Actions job "Fory CI" on fory.git/main has succeeded.
Run started by GitHub user chaokunyang (triggered by chaokunyang).

Head commit for run:
a603ff1bb1d9eb308b80daa79aaf3cddae88bc02 / Shin Xiahou <[email protected]>
fix(javascript): preserve getTypeInfo in regenerated read serializer (#3669)

## Why?

`TypeResolver.regenerateReadSerializer()` returned a partial serializer
object that missed `getTypeInfo`.

When runtime paths later call `original.getTypeInfo()` (for example in
`ReadContext` type-meta regeneration flow), it can throw:

```text
TypeError: original.getTypeInfo is not a function
```

## What does this PR do?

- Add `getTypeInfo: serializer.getTypeInfo` when registering the
regenerated serializer in
`javascript/packages/core/lib/typeResolver.ts`.
- Keep regenerated serializer interface consistent with normal
serializer instances.

Minimal reproduction:

```js
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 serializer.getTypeInfo); // before: undefined, after: 
function
serializer.getTypeInfo();
```

## Related issues

Fixes #3668

## AI Contribution Checklist

- [x] Substantial AI assistance was used in this PR: `no`
- [x] If `yes`, I included a completed [AI Contribution
Checklist](https://github.com/apache/fory/blob/main/AI_POLICY.md#9-contributor-checklist-for-ai-assisted-prs)
in this PR description and the required `AI Usage Disclosure`.
- [x] If `yes`, my PR description includes the required `ai_review`
summary and screenshot evidence of the final clean AI review results
from both fresh reviewers on the current PR diff or current HEAD after
the latest code changes.

## Does this PR introduce any user-facing change?

- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?

## Benchmark

N/A (bug fix, no protocol/perf-path behavior change expected).

---------

Co-authored-by: xiahouzhen <[email protected]>
Co-authored-by: Claude Opus 4.7 <[email protected]>

Report URL: https://github.com/apache/fory/actions/runs/25719399206

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to