Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when protobuf decoder has types with different order of fields compare to the original type #1238

Closed
lewispham opened this issue Aug 22, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request invalid This doesn't seem right

Comments

@lewispham
Copy link

Bug Report

Protobuf decoder is throwing an error when the type has different order of fields compare to the original type.

https://stackblitz.com/edit/typia-order-of-fields?file=index.ts

When the same error occurs even in the @next version, then please fill the below template:

📝 Summary

Write a short summary of the bug in here.
This error occurs when order of fields are different from the order of fields in the original type.

  • Typia Version: 6.9.0
  • Expected behavior: No error
  • Actual behavior:
RangeError: Offset is outside the bounds of the DataView
    at DataView.prototype.getUint8 (<anonymous>)
    at $ProtobufReader.u8 (file:///home/projects/typia-order-of-fields/node_modules/.pnpm/[email protected][email protected]/node_modules/typia/lib/functional/$ProtobufReader.js#cjs:157:26)
    at $ProtobufReader.skip (file:///home/projects/typia-order-of-fields/node_modules/.pnpm/[email protected][email protected]/node_modules/typia/lib/functional/$ProtobufReader.js#cjs:62:25)
    at $ProtobufReader.skipType (file:///home/projects/typia-order-of-fields/node_modules/.pnpm/[email protected][email protected]/node_modules/typia/lib/functional/$ProtobufReader.js#cjs:73:22)
    at $pdo0 (file:///home/projects/typia-order-of-fields/index.js#cjs:95:24)
    at __decode (file:///home/projects/typia-order-of-fields/index.js#cjs:116:12)
    at eval (file:///home/projects/typia-order-of-fields/index.js#cjs:117:45)
    at Object.eval (file:///home/projects/typia-order-of-fields/index.js#cjs:117:81)
    at Object._0x2ebaba (https://typiaorderoffields-qbcl.w-corp-staticblitz.com/blitz.6352fbed.js:40:792388)
    at Module._compile (https://typiaorderoffields-qbcl.w-corp-staticblitz.com/builtins.ddb8d84d.js:144:14246)

Write detailed description in here.

💻 Code occuring the bug

https://stackblitz.com/edit/typia-order-of-fields?file=index.ts

@lewispham lewispham changed the title Error when protobuf decoder has types with different order of fields compare to the encoded type Error when protobuf decoder has types with different order of fields compare to the original type Aug 22, 2024
@samchon samchon self-assigned this Oct 11, 2024
@samchon samchon added the invalid This doesn't seem right label Oct 11, 2024
@samchon
Copy link
Owner

samchon commented Oct 11, 2024

Sequence of properties is important in protobuf.

You may manually configure byte sequence of the properties at next major v7 update.

@samchon samchon added the enhancement New feature or request label Oct 11, 2024
@samchon samchon closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants