fix(backend): ULIDを正しく処理できない問題を修正#17310
Merged
kakkokari-gtyih merged 1 commit intomisskey-dev:developfrom Apr 15, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #17310 +/- ##
===========================================
- Coverage 63.67% 63.66% -0.02%
===========================================
Files 1162 1162
Lines 116490 116497 +7
Branches 8470 8461 -9
===========================================
- Hits 74175 74162 -13
- Misses 40110 40130 +20
Partials 2205 2205 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
このPRによるapi.jsonの差分 |
Contributor
Backend memory usage comparisonBefore GC
After GC
After Request
|
Contributor
Author
|
このCIの失敗はPRの変更と無関係のflaky testです |
1 task
kakkokari-gtyih
added a commit
that referenced
this pull request
Apr 15, 2026
Member
|
🙏🏻 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
parseUlidFullがULIDのランダム部のパースにparseBigInt32(内部でparseInt(chunk, 32)を使用)を呼んでいた実装を、Crockford Base32に対応したparseBigIntCrockfordに置き換える。Why
parseInt(str, 32)が認識する文字は標準base-32の0–9, A–Vのみで、ULIDが採用するCrockford Base32固有のW, X, Y, Zを無効文字として扱う。W/X/Y/Zがチャンク先頭に現れると
parseIntがNaNを返して例外が発生し、NotificationService#toXListIdを経由して伝播した後、本番環境ではtrackPromiseがno-opであるためエラーログにも残らず通知が消滅していた。発生確率は訳23.4%また、チャンク先頭以外にW/X/Y/Zが現れる場合も
parseIntが途中で解析を停止して誤値を返すため、Redis StreamのIDが不正な値となりソート順が壊れる問題もあった。Related: #17309
Additional info (optional)
parseBigIntCrockfordは既存のCHARS定数(Crockford Base32)を使ってCHARS.indexOfで各文字を変換する。タイムスタンプ部のparseBase32がすでに同方針で正しく実装されており、それと一貫した実装となっているChecklist