connectbase-client 3.11.0 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -0
- package/dist/connect-base.umd.js +4 -4
- package/dist/index.d.mts +135 -8
- package/dist/index.d.ts +135 -8
- package/dist/index.js +99 -3
- package/dist/index.mjs +99 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,58 @@
|
|
|
3
3
|
본 SDK 의 모든 주요 변경사항을 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/) 형식으로 기록합니다.
|
|
4
4
|
버전은 [Semantic Versioning](https://semver.org/lang/ko/) 을 따릅니다.
|
|
5
5
|
|
|
6
|
+
## [3.12.0] - 2026-05-13
|
|
7
|
+
|
|
8
|
+
### Fixed — `cb.database.batch()` / `cb.database.transaction()` silent success 회귀 (platform-issue 019e1c9c)
|
|
9
|
+
|
|
10
|
+
서버가 `success: false` + 개별 op `error` 로 부분 실패를 표현해도 SDK 가 그냥 Promise 를 resolve 해
|
|
11
|
+
호출자가 "성공" 으로 오해하던 문제 수정. 이제 첫 실패 op 의 error 메시지로 `throw`.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
try {
|
|
15
|
+
await cb.database.batch([{
|
|
16
|
+
type: 'update',
|
|
17
|
+
table_id: '019d86bf-...',
|
|
18
|
+
doc_id: '019de33a-...',
|
|
19
|
+
operators: { like_count: { type: 'increment', value: 1 } },
|
|
20
|
+
}])
|
|
21
|
+
} catch (e) {
|
|
22
|
+
// 이제 RLS 거부, table_id 오타, 검증 실패 등이 명확히 throw 됨
|
|
23
|
+
console.error(e.message)
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Added — `BatchWriteResult` / `TransactionResult` / `BatchOperationResult` / `TransactionWriteResult` 타입 export
|
|
28
|
+
|
|
29
|
+
batch/transaction 응답이 `{ results: Record<string, unknown>[] }` 에서 정형 타입으로 변경:
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import type { BatchWriteResult, BatchOperationResult } from 'connectbase-client'
|
|
33
|
+
|
|
34
|
+
const r: BatchWriteResult = await cb.database.batch(ops)
|
|
35
|
+
// r.success: boolean
|
|
36
|
+
// r.results[i]: { index, success, doc_id?, error? }
|
|
37
|
+
// r.total_count / success_count / failed_count
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Behavior change — batch/transaction 부분 실패가 더 이상 silent 통과되지 않음
|
|
41
|
+
|
|
42
|
+
이전: `success: false` 응답도 `await cb.database.batch(...)` 가 정상 resolve → 호출자가 매번
|
|
43
|
+
`response.success` 와 `response.results[i].success` 를 직접 확인해야 했음.
|
|
44
|
+
|
|
45
|
+
본 버전부터: `success: false` 면 즉시 `throw new Error(<첫 실패 op error>)`. 부분 실패를
|
|
46
|
+
silent 처리하던 코드가 있다면 try/catch 로 감싸야 한다.
|
|
47
|
+
|
|
48
|
+
### Backend wiring (참고)
|
|
49
|
+
|
|
50
|
+
본 fix 는 data-server 의 다음 변경과 짝을 이룬다 (별도 배포 필요):
|
|
51
|
+
- `transaction_service` 의 3 callsite (executeRead / RunTransaction commit / BatchWrite) 가
|
|
52
|
+
`table_id` (UUID) 를 title 로 잘못 lookup → 항상 "ent: table not found" 회귀를 함께 수정
|
|
53
|
+
(platform-issue 019e1c9c/eba6).
|
|
54
|
+
- batch/transaction 이 RLS 평가를 통째로 건너뛰던 보안 회귀 수정. operators 가 머지된 finalData
|
|
55
|
+
를 newData 로 RLS 에 전달해 `.update` predicate 가 실제 변경 결과 기준으로 평가됨
|
|
56
|
+
(platform-issue 019e1c9c/c155).
|
|
57
|
+
|
|
6
58
|
## [3.11.0] - 2026-05-10
|
|
7
59
|
|
|
8
60
|
### Fixed — `cb.game.createClient().createRoom()` 의 `scriptName` / 기타 wire 필드 매핑 (platform-issue 019e123a)
|