@jetthai/cuora 1.1.431 → 1.1.433
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/.claude/commands/create-branch.md +142 -0
- package/.husky/pre-push +11 -2
- package/AI_PROMPT_SOURCE.md +64 -0
- package/CHANGELOG.md +14 -0
- package/docs/kibana/crypto-way-deposit-amount-bug-analysis.md +1003 -0
- package/docs/kibana/play-providerId-error.md +202 -0
- package/docs/kibana/play-selectedWalletType.md +1 -0
- package/docs/kibana/play-selectedWalletType_2.md +1 -0
- package/docs/kibana/play-selectedWalletType_analysis.md +565 -0
- package/package.json +1 -1
- package/scripts/check-version.sh +36 -0
- package/scripts/clean-tags.sh +48 -60
- package/src/machine/auth.js +2 -1
- package/src/machine/deposit/crypto_way_cash.js +20 -4
- package/src/machine/game_v2_1.js +6 -4
- package/src/machine/user_sign_up.js +2 -1
- package/src/machine/websocket.js +0 -8
package/scripts/clean-tags.sh
CHANGED
|
@@ -1,71 +1,59 @@
|
|
|
1
1
|
#!/usr/bin/env sh
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
#
|
|
3
|
+
# 刪除不符合規範格式的本地與遠端 tag
|
|
4
|
+
# 規範格式:v1.2.3(例如 v0.1.0、v1.12.123)
|
|
5
5
|
#
|
|
6
|
-
#
|
|
7
|
-
# 1.
|
|
8
|
-
# 2.
|
|
9
|
-
# 3.
|
|
6
|
+
# 不符合規範 tag 的刪除規則:
|
|
7
|
+
# 1. commit 不屬於任何分支 → 刪除(remote + local)
|
|
8
|
+
# 2. commit 存在於 origin/master → 刪除(remote + local)
|
|
9
|
+
# 3. commit 在其他分支上 → 跳過保留
|
|
10
10
|
PATTERN="^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"
|
|
11
11
|
|
|
12
|
-
#
|
|
13
|
-
|
|
12
|
+
# 確保遠端 ref 為最新,避免本地 master 落後造成誤判
|
|
13
|
+
git fetch origin --prune --tags
|
|
14
14
|
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if [ -z "$TAGS" ]; then
|
|
23
|
-
echo "No non-compliant tags found."
|
|
24
|
-
exit 0
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
echo "Latest tag (preserved): $LATEST_TAG"
|
|
28
|
-
|
|
29
|
-
# 逐一檢查每個不合規的 tag
|
|
30
|
-
for TAG in $TAGS; do
|
|
31
|
-
# 最新的 tag 一律跳過,避免誤刪正在使用的版本
|
|
32
|
-
if [ "$TAG" = "$LATEST_TAG" ]; then
|
|
33
|
-
echo "Skipping tag $TAG (latest tag)"
|
|
34
|
-
continue
|
|
15
|
+
# 刪除遠端 tag;若遠端本來就不存在則視為成功,其他失敗回傳非零並輸出錯誤訊息
|
|
16
|
+
delete_remote_tag() {
|
|
17
|
+
TAG=$1
|
|
18
|
+
ERR=$(git push origin --no-verify --delete "$TAG" 2>&1)
|
|
19
|
+
STATUS=$?
|
|
20
|
+
if [ $STATUS -eq 0 ]; then
|
|
21
|
+
return 0
|
|
35
22
|
fi
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
23
|
+
# 遠端本來就沒有此 tag → 視為成功
|
|
24
|
+
case "$ERR" in
|
|
25
|
+
*"remote ref does not exist"*|*"unable to delete"*"remote ref does not exist"*)
|
|
26
|
+
return 0
|
|
27
|
+
;;
|
|
28
|
+
esac
|
|
29
|
+
echo " ⚠ 遠端 tag $TAG 刪除失敗,跳過本地刪除:$ERR" >&2
|
|
30
|
+
return 1
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
# 安全刪除:先刪遠端,遠端成功才刪本地
|
|
34
|
+
safe_delete_tag() {
|
|
35
|
+
TAG=$1
|
|
36
|
+
REASON=$2
|
|
37
|
+
echo "刪除 tag $TAG($REASON)"
|
|
38
|
+
if delete_remote_tag "$TAG"; then
|
|
39
|
+
git tag -d "$TAG"
|
|
44
40
|
fi
|
|
41
|
+
}
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
TAGS=$(git tag -l | grep -vE "$PATTERN")
|
|
44
|
+
if [ -n "$TAGS" ]; then
|
|
45
|
+
echo "檢查不符合規範的 tag"
|
|
46
|
+
for TAG in $TAGS; do
|
|
47
|
+
TAG_COMMIT=$(git rev-list -n 1 "$TAG" 2>/dev/null)
|
|
48
|
+
BRANCHES=$(git branch -a --contains "$TAG_COMMIT" 2>/dev/null)
|
|
49
49
|
if [ -z "$BRANCHES" ]; then
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
safe_delete_tag "$TAG" "commit 不屬於任何分支"
|
|
51
|
+
elif git merge-base --is-ancestor "$TAG_COMMIT" origin/master 2>/dev/null; then
|
|
52
|
+
safe_delete_tag "$TAG" "commit 存在於 origin/master"
|
|
53
|
+
else
|
|
54
|
+
echo "跳過 tag $TAG(commit 在其他分支上)"
|
|
52
55
|
fi
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if git merge-base --is-ancestor "$TAG" master 2>/dev/null; then
|
|
58
|
-
SHOULD_DELETE=true
|
|
59
|
-
REASON="merged into master"
|
|
60
|
-
fi
|
|
61
|
-
fi
|
|
62
|
-
|
|
63
|
-
# 執行刪除:先刪遠端再刪本地,遠端刪除失敗不中斷流程
|
|
64
|
-
if [ "$SHOULD_DELETE" = true ]; then
|
|
65
|
-
echo "Deleting tag $TAG ($REASON)"
|
|
66
|
-
git push origin --delete "$TAG" --no-verify 2>/dev/null || true
|
|
67
|
-
git tag -d "$TAG"
|
|
68
|
-
else
|
|
69
|
-
echo "Keeping tag $TAG"
|
|
70
|
-
fi
|
|
71
|
-
done
|
|
56
|
+
done
|
|
57
|
+
else
|
|
58
|
+
echo "未發現不符合規範的 tag"
|
|
59
|
+
fi
|
package/src/machine/auth.js
CHANGED
|
@@ -486,7 +486,8 @@ export default function (request) {
|
|
|
486
486
|
affiliateCode,
|
|
487
487
|
nickname,
|
|
488
488
|
}
|
|
489
|
-
|
|
489
|
+
|
|
490
|
+
sentry?.captureMessage(`[Auth] RedirectTo3Party Data: ${JSON.stringify(messages)}`, { level: 'info' })
|
|
490
491
|
|
|
491
492
|
const referralObj = {}
|
|
492
493
|
if (![undefined, 'undefined', null, 'null'].includes(affiliateCode)) {
|
|
@@ -56,8 +56,9 @@ export default function (request, context) {
|
|
|
56
56
|
target: 'calculated',
|
|
57
57
|
actions: 'setCalculation',
|
|
58
58
|
},
|
|
59
|
+
// 計算失敗回到 loaded,避免進入 calculated 造成 UI 與 state 不一致
|
|
59
60
|
onError: {
|
|
60
|
-
target: '
|
|
61
|
+
target: 'loaded',
|
|
61
62
|
},
|
|
62
63
|
},
|
|
63
64
|
},
|
|
@@ -167,8 +168,10 @@ export default function (request, context) {
|
|
|
167
168
|
setAmount: assign((context, event) => {
|
|
168
169
|
// 現金網可自由填額度,grandTotalEnable 欄位感覺不再需要?
|
|
169
170
|
if (context.selectedCrypto?.grandTotalEnable === 1) {
|
|
171
|
+
// 累加模式:用 Math.max 確保累加結果不低於 0
|
|
172
|
+
const result = preciseAdd(`${parseFloat(context.selectedAmount || 0)}`, `${parseFloat(event.data || '0')}`)
|
|
170
173
|
return {
|
|
171
|
-
selectedAmount:
|
|
174
|
+
selectedAmount: Math.max(result, 0),
|
|
172
175
|
}
|
|
173
176
|
} else {
|
|
174
177
|
return { selectedAmount: event.data }
|
|
@@ -231,9 +234,17 @@ export default function (request, context) {
|
|
|
231
234
|
const { selectedCrypto, selectedAmount } = context
|
|
232
235
|
return selectedCrypto && selectedAmount && selectedCrypto.minimum <= +selectedAmount && +selectedAmount <= selectedCrypto.maximum
|
|
233
236
|
},
|
|
237
|
+
// 提交前最後一道 guard:重新驗證 amount 的合法性(與 isCalculable 同等嚴格)
|
|
234
238
|
isSubmittable: (context, event) => {
|
|
235
239
|
const { selectedCrypto, selectedAmount, calculation } = context
|
|
236
|
-
return
|
|
240
|
+
return (
|
|
241
|
+
selectedCrypto &&
|
|
242
|
+
selectedAmount &&
|
|
243
|
+
+selectedAmount > 0 &&
|
|
244
|
+
selectedCrypto.minimum <= +selectedAmount &&
|
|
245
|
+
+selectedAmount <= selectedCrypto.maximum &&
|
|
246
|
+
calculation
|
|
247
|
+
)
|
|
237
248
|
},
|
|
238
249
|
},
|
|
239
250
|
services: {
|
|
@@ -250,10 +261,15 @@ export default function (request, context) {
|
|
|
250
261
|
},
|
|
251
262
|
submitDeposit: async (context, event) => {
|
|
252
263
|
const { selectedCrypto, selectedAmount, sourceAddress, promotion } = context
|
|
264
|
+
// 防禦性檢查:將 amount 轉為數字型別,並驗證範圍合法性,避免非法金額送出 API
|
|
265
|
+
const amount = +selectedAmount
|
|
266
|
+
if (!amount || amount <= 0 || amount < selectedCrypto.minimum || amount > selectedCrypto.maximum) {
|
|
267
|
+
throw new Error('INVALID_AMOUNT')
|
|
268
|
+
}
|
|
253
269
|
return await request.send(
|
|
254
270
|
payment.submitDepositTransactionCrypto({
|
|
255
271
|
method: selectedCrypto.method,
|
|
256
|
-
amount:
|
|
272
|
+
amount: amount,
|
|
257
273
|
cryptoCurrency: selectedCrypto.channel,
|
|
258
274
|
cryptoNetwork: selectedCrypto.networkCode,
|
|
259
275
|
sourceAddress: sourceAddress,
|
package/src/machine/game_v2_1.js
CHANGED
|
@@ -465,8 +465,10 @@ export default function (request) {
|
|
|
465
465
|
const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name, gameName } = context.switchGame
|
|
466
466
|
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name, gameName } }
|
|
467
467
|
}),
|
|
468
|
+
// 頁面刷新或深層連結時,event.data.walletType 可能為 undefined/null
|
|
469
|
+
// 使用 ?? 確保不會覆蓋 context 中已有的 walletType,避免後端收到 selectedWalletType=null
|
|
468
470
|
setWalletType: assign((context, event) => {
|
|
469
|
-
return { walletType: event.data.walletType }
|
|
471
|
+
return { walletType: event.data.walletType ?? context.walletType }
|
|
470
472
|
}),
|
|
471
473
|
setLang: assign((context, event) => {
|
|
472
474
|
const lang = event.data.locale.replace('-', '_')
|
|
@@ -638,9 +640,9 @@ export default function (request) {
|
|
|
638
640
|
}
|
|
639
641
|
},
|
|
640
642
|
connectGame: async (context, event) => {
|
|
641
|
-
// [防呆] 確保有 providerId 和 gameId
|
|
643
|
+
// [防呆] 確保有 providerId 和 gameId(含字串 "null"/"undefined" 檢查)
|
|
642
644
|
const { providerId, gameId } = context.game || {}
|
|
643
|
-
if (!providerId || !gameId) {
|
|
645
|
+
if (!providerId || !gameId || providerId === 'null' || providerId === 'undefined' || gameId === 'null' || gameId === 'undefined') {
|
|
644
646
|
return
|
|
645
647
|
}
|
|
646
648
|
const returnProviders = ['RSG', 'KP', 'EPICWIN', 'AMBSLOT', 'SEXY_VENUS', 'SEXY_SEXYBCRT', 'PG', 'NPG']
|
|
@@ -654,7 +656,7 @@ export default function (request) {
|
|
|
654
656
|
is_demo: false,
|
|
655
657
|
is_mobile: isMobile === 'mobile' ? 'y' : null,
|
|
656
658
|
lang,
|
|
657
|
-
selected_wallet_type: walletType,
|
|
659
|
+
selected_wallet_type: walletType || null, // 統一 undefined → null,確保後端收到一致的值
|
|
658
660
|
return_url: returnProviders.includes(providerId)
|
|
659
661
|
? `${window.location.origin}${context.base}return`
|
|
660
662
|
: window.location.href?.split('?')?.[0], // For providers to return.
|
|
@@ -216,7 +216,8 @@ export default function (request) {
|
|
|
216
216
|
],
|
|
217
217
|
affiliateCode,
|
|
218
218
|
}
|
|
219
|
-
|
|
219
|
+
|
|
220
|
+
sentry?.captureMessage(`[SignUp] Authenticate Data: ${JSON.stringify(messages)}`, { level: 'info' })
|
|
220
221
|
|
|
221
222
|
const referralObj = {}
|
|
222
223
|
if (![undefined, 'undefined', null, 'null'].includes(affiliateCode)) {
|
package/src/machine/websocket.js
CHANGED
|
@@ -124,14 +124,6 @@ export default function (request) {
|
|
|
124
124
|
}),
|
|
125
125
|
setConnectError: assign((context, event) => {
|
|
126
126
|
const error = event.data
|
|
127
|
-
const { analytics, connectError } = context
|
|
128
|
-
if (connectError === null) {
|
|
129
|
-
sentry?.captureException(`[socket] connectError ${error}`)
|
|
130
|
-
analytics?.push({
|
|
131
|
-
event: 'connect_error',
|
|
132
|
-
message: error,
|
|
133
|
-
})
|
|
134
|
-
}
|
|
135
127
|
return {
|
|
136
128
|
connectError: error,
|
|
137
129
|
connectStatus: 0, // 0: 未連線, 1: 連線中, 2: 連線成功
|