JsCommunity / JsCommunity/json-rpc-peer

Suggestion: generate rpc id from cuid instead of a int number

Open
#55 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Currently, we are using a very large negative number as the rpc id, and each time increase by one.

There's another way to generate unique id by using cuid: http://npmjs.com/package/cuid

Personally, I'm using cuid a lot, so I'd like to suggest we use cuid to generate our Peer rpc id too.

  • The good part of using cuid is that we will never get a conflict id of every rpc call.
  • The bad part of using cuid might be that we need to increase the size of the network package a bit(from a number to a string) for every rpc call.

If you agree to use cuid, I'll make it in my pull request.

Contributor guide

No contributing guide indexed for this repository

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

No source files or tests are named. Start by locating the RPC ID generation and network-package serialization, then review how IDs are consumed and whether changing them from numbers to strings affects compatibility. Done means reaching an agreed design for cuid-based IDs and covering the resulting behavior with tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.