xhzq233 opened a new pull request, #3669:
URL: https://github.com/apache/fory/pull/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).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to