[FR] Algorithm for unique ID generation
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 22/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- firebase, nodejs, typescript
調査の方向性
Firestore の add 例から始め、beforeUserCreated と Firestore blocking functions におけるカスタム ID に関するリンクされたリクエストを確認してください。対象範囲が Authentication、Firestore、またはその両方に及ぶかを明確にし、実装前に、順序付き ID、長さと文字のルール、サーバー生成フィールドについての受け入れ基準を定義してください。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
When there is a time we rely on firebase to generate unique ID for firestore or authentication, sometimes we don't want complete random ID. There should be some option to control the ID generation algorithm
I wish I could generate ID that can be always sorted. At least incremental or any monotonic function should be allow to prepend to the generated ID, such as base64 encoded unix timestamp
Additionally it should allow specifying the length of id, and the allowed encode character such as, is it case-sensitive, only numeric or alphanumeric, is it allow symbol, so on. So we have
Describe the solution you'd like
For authentication, maybe it could have option at the firebase console to specify the detailed algorithm as checkbox/radio
For firestore. Actually I wish I could have ability to do servervalue string formatting. So I could have firestore server generate any field, include ID, with the string I want
For this particular case I think we should have
db.collection("users").add({ // Should allow push new document with __name__ as id
"__name__": ServerValue.calculate("string(request.time.toMillis(),16).reverse() + hashing.crc32(request.path).toHexString()"), // use firebase rule syntax for server generate value
data : "anydata"
});
The above example generate reverse hex string from time and hash of the path. This function guaranteed incremental from server timestamp but also seemingly random at start and the end
(Also I want to request that string() function in firebase rule system should have base argument for int value, and also reverse function)
Describe alternatives you've considered
There is a request to allow set custom ID in beforeUserCreated as requested in https://github.com/firebase/firebase-tools/issues/5675
Same go for firestore blocking function https://github.com/firebase/firebase-admin-node/issues/2077
Additional context
Is it possible to have firebase server issue request in github too?
- 主要言語
- TypeScript
- スター
- 1.7k
- フォーク
- 419
- 平均マージ
- 4日 20時間
- マージ済み PR(30日)
- 16
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
firebase/firebase-admin-node のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
firebase/firebase-admin-node#3234 ·
-
firebase/firebase-admin-node#3221 · コメント 3 件 · 担当者 1 名 ·
-
api: messaging
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
firebase/firebase-admin-node#3215 ·
-
api: messaging
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
firebase/firebase-admin-node#3214 ·
-
api: firestore type: feature request
firebase/firebase-admin-node#3183 · コメント 1 件 · 担当者 1 名 ·
firebase/firebase-admin-node の issue をすべて見る
似ている issue
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Crush オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
ElementsProject/cln-application#167 · コメント 1 件 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Quantco/pnpm-licenses#17 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100