Revert "feat(claim): Rock 同一提货号过期后自动换新二维码"
This reverts commit 9d981c253f.
This commit is contained in:
@@ -8,7 +8,6 @@ import {
|
||||
isAffiliateDashBindSnapshotStale,
|
||||
isAffiliateDashSnapshotFresh,
|
||||
isRockAffiliateDashSku,
|
||||
isRockBindUrlStale,
|
||||
shouldRefuseRockRebind,
|
||||
shouldRefreshAffiliateDashBindStateForSnapshot,
|
||||
} from './kuaishou-cloud-claim-service.js'
|
||||
@@ -273,40 +272,6 @@ test('order snapshot stays fresh for 45s and bind snapshot only for 15s', () =>
|
||||
)
|
||||
})
|
||||
|
||||
test('isRockBindUrlStale only refreshes an unpaid rock qr on the same token', () => {
|
||||
const now = Date.parse('2026-10-06T09:57:00.000Z')
|
||||
const oldTs = Math.floor(Date.parse('2026-10-06T09:10:14.000Z') / 1000)
|
||||
const freshTs = Math.floor(Date.parse('2026-10-06T09:55:00.000Z') / 1000)
|
||||
const stale = {
|
||||
sku: 'rock_black_tshirt',
|
||||
orderNo: 'FO20261006170653afd37ce7e19',
|
||||
bindUrl: `https://gp.qq.com/cp/a20241128mobile/index.html?userId=1×tamp=${oldTs}&nonce=a`,
|
||||
bound: false,
|
||||
bindMismatch: false,
|
||||
}
|
||||
assert.equal(isRockBindUrlStale(stale, now), true)
|
||||
assert.equal(
|
||||
isRockBindUrlStale(
|
||||
{
|
||||
...stale,
|
||||
bindUrl: `https://gp.qq.com/cp/a20241128mobile/index.html?timestamp=${freshTs}&nonce=b`,
|
||||
},
|
||||
now,
|
||||
),
|
||||
false,
|
||||
)
|
||||
assert.equal(isRockBindUrlStale({ ...stale, bound: true }, now), false)
|
||||
assert.equal(isRockBindUrlStale({ ...stale, bindMismatch: true }, now), false)
|
||||
assert.equal(isRockBindUrlStale({ ...stale, sku: 'lewan_black' }, now), false)
|
||||
assert.equal(
|
||||
isRockBindUrlStale(
|
||||
{ ...stale, rockBindUrlCheckedAt: new Date(now - 10_000).toISOString() },
|
||||
now,
|
||||
),
|
||||
false,
|
||||
)
|
||||
})
|
||||
|
||||
test('claim detail skips affiliate-dash sync while the snapshot is fresh', async () => {
|
||||
const { readFile } = await import('node:fs/promises')
|
||||
const src = await readFile(new URL('./kuaishou-cloud-claim-service.ts', import.meta.url), 'utf8')
|
||||
@@ -317,7 +282,6 @@ test('claim detail skips affiliate-dash sync while the snapshot is fresh', async
|
||||
assert.ok(detail.includes('flow.mock?.enabled'))
|
||||
assert.ok(detail.includes('isAffiliateDashSnapshotFresh(flow.lastSyncedAt'))
|
||||
assert.ok(detail.includes('bindFlow.lastBindSyncedAt'))
|
||||
assert.ok(detail.includes('refreshRockBindUrlIfStale'))
|
||||
assert.ok(
|
||||
!detail.includes('snapshotOnly'),
|
||||
'新鲜快照必须直接不调用同步;snapshotOnly 仍会 updateTask',
|
||||
|
||||
Reference in New Issue
Block a user