Fix: 通知のページネーションで2つ以上読み込めなくなることがある問題 (#15277)
* fix: notifications-groupedのinclude/exclude typesに:groupedを指定できてしまう問題 * refactor: 通知の取得処理を Notification Service に移動 * feat: add function to parse additional part of id * fix: 通知のページネーションが正しく動かない問題 Redisにのページネーションで使用する時間及びidとRedis上のものが混同されていたので、Misskeyが生成するものに寄せました。 * pnpm run build-misskey-js-with-types * chore: XADDをretryするように * fix: notifications-groupedでxrevrangeしているのを消し忘れていた
This commit is contained in:
parent
3ec5bf114b
commit
55d835ad51
12 changed files with 248 additions and 96 deletions
|
|
@ -7,6 +7,7 @@
|
|||
// 長さ8の[2000年1月1日からの経過ミリ秒をbase36でエンコードしたもの] + 長さ2の[ノイズ文字列]
|
||||
|
||||
import * as crypto from 'node:crypto';
|
||||
import { parseBigInt36 } from '@/misc/bigint.js';
|
||||
|
||||
export const aidRegExp = /^[0-9a-z]{10}$/;
|
||||
|
||||
|
|
@ -35,6 +36,12 @@ export function parseAid(id: string): { date: Date; } {
|
|||
return { date: new Date(time) };
|
||||
}
|
||||
|
||||
export function parseAidFull(id: string): { date: number; additional: bigint; } {
|
||||
const date = parseInt(id.slice(0, 8), 36) + TIME2000;
|
||||
const additional = parseBigInt36(id.slice(8, 10));
|
||||
return { date, additional };
|
||||
}
|
||||
|
||||
export function isSafeAidT(t: number): boolean {
|
||||
return t > TIME2000;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue