Comments (3)
Yup, looks like a bug & looks like your proposed fix should work. Sloppy of me to not have unit tested this. Feel free to add a test, update the code & send a pull request. Will otherwise try to get to this in a couple of days...
On a note, I'm not entirely happy with this particular routine. I had tried to eliminate construction of the throw-away ref object here by refactoring the entire library to use pass-by-reference (byref) - see this branch: https://github.com/ctaggart/froto/tree/pass-by-reference-and-record-serializer. Would be great to get that working, but I don't think it is possible to eliminate the runtime-error because .NET simply does not support byref and generic parameters
from froto.
I've fixed the above & added a unit test, but there is now an O(n^2) performance issue.
While writing the unit tests, I noticed that repeated fields were not being kept in order (packed-repeated works, though). As a quick fix, hydrateRepeated does an append to the end of the list for every new element added.
Not sure how to fix this long term without adding additional abstract methods to MessageBase, but that's probably going to be the solution.
from froto.
@tathanhdinh - please update your client code to rename hydrateRepeated
to hydrateOneRepeatedInstance
. Sorry for the inconvenience, but even I was confused at first, thinking that this function would deserialize the entire list of repeated objects (not just a single instance).
from froto.
Related Issues (20)
- Span<T> HOT 4
- Are there any plans for a proto3 canonical json serialization? HOT 1
- Are the methods mentioned in Serialization.fs currently consumed anywhere in code? HOT 1
- UnknownFields in the serializer seems to be unused, can this be removed or is it unimplemented? HOT 14
- Proto2 required fields are not properly serialized HOT 1
- Would it be possible to get a 0.51 nuget release of the parser and serializer? HOT 21
- Proto3 oneOf type does not parse HOT 4
- gRPC on top of ASP.NET Core 3.0 HOT 4
- Add interface implementation of IMessage to Froto.Serialiation to make code gen have less dependencies HOT 6
- Enum in message body error HOT 4
- Allow identifiers to start with underscore HOT 1
- SourceLink seems to fail while building HOT 3
- position in ProtoField are defined differently
- gRPC on Alpine docker requires libc6-compat
- Make TP work with .NET Core tooling HOT 2
- PulsarApi.proto HOT 3
- need stable CI builds on master HOT 5
- new maintainer please HOT 4
- Parse error when optional/required/repeated is missing HOT 3
- Support for proto3? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from froto.