loopbackio / loopbackio/loopback-connector

Disable default dates encoding for BinaryPacker

Open
#189 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

breaking-change bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.