Skip to content

fix: Получение UUID #529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 23, 2025
Merged

fix: Получение UUID #529

merged 2 commits into from
May 23, 2025

Conversation

MIMBOL22
Copy link
Contributor

Описание PR:

Предпосылки

На данный момент, при извлечении поля с типом Uuid возникает следующая ошибка:

backend\node_modules\@ydbjs\retry\dist\cjs\index.js:92
    if (error instanceof error_1.CommitError) {
              ^

TypeError: Right-hand side of 'instanceof' is not an object
    at Object.isRetryableError [as retry] (backend\node_modules\@ydbjs\retry\dist\cjs\index.js:92:15)
    at retry (backend\node_modules\@ydbjs\retry\dist\cjs\index.js:50:69)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async RefreshTokenRepository.list (backend\src\services\id\refresh_token\refresh_token.repository.ts:18:20)
Emitted 'error' event on Query instance at:
    at backend\node_modules\@ydbjs\query\dist\cjs\query.js:345:18
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async RefreshTokenRepository.list (backend\src\services\id\refresh_token\refresh_token.repository.ts:18:20)

Проблема связана с ньюансами отображения ошибками. Я не стал углубляться в это и перешёл к сути.

Суть

Через debugger я определил действительную ошибку. Ею оказалась:

TypeError: Cannot mix BigInt and other types, use explicit conversions
    at writeBigU_Int64LE (node:internal/buffer:583:25)
    at Buffer.writeBigUInt64LE (node:internal/buffer:603:10)
    at uuidFromBigInts backend\node_modules\@ydbjs\query\node_modules\@ydbjs\value\dist\cjs\uuid.js:10:11)
    at toJs (backend\node_modules\@ydbjs\query\node_modules\@ydbjs\value\dist\cjs\index.js:176:58)
    at backend\node_modules\@ydbjs\query\dist\cjs\query.js:330:120
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async retry (backend\node_modules\@ydbjs\retry\dist\cjs\index.js:37:20)
    at async RefreshTokenRepository.list (backend\src\services\id\refresh_token\refresh_token.repository.ts:18:20)

С помощью нехитрых действий и, опять де, дебаггера, я выяснил, что функция Buffer.writeBigUInt64LE не получает то, что должно, а получает undefined. Суть оказалась в недописанном коде класса Primitive и функции fromYdb.
Собственно, этот PR это исправляет

@polRk polRk merged commit cc46593 into ydb-platform:main May 23, 2025
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants