loopbackio / loopbackio/loopback-connector
Disable default dates encoding for BinaryPacker
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 35
- Forks
- 102
- Avg merge
- 14h 26m
- Merged PRs (30d)
- 13
Description
Custom `encodeDate`, `decodeDate` functions are not used by _msgpack5_, because custom types encoding happens after `Date` type encoding inside `msgpack.encode` function.
This can be fixed by disabling default `Date`s encoding in [following line](https://github.com/loopbackio/loopback-connector/blob/2fb7979f04f1e94407f525c08228f047f0ac65b1/lib/binary-packer.js#L21) adding `disableTimestampEncoding: true` option.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at lib/binary-packer.js line 21 and inspect how msgpack.encode handles Date values before custom encodeDate and decodeDate functions. Confirm the option is passed in the relevant encoder configuration. Done means custom date functions are used instead of the default Date encoding, with existing behavior otherwise unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100