修复审核版本 revision 冲突
Project CI / Backend tests (pull_request) Failing after 33s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m57s
Project CI / Frontend tests (pull_request) Failing after 1m33s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 3m39s
Project CI / Repository checks (pull_request) Failing after 25s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 4m46s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m54s
Project CI / Native shell tests (pull_request) Successful in 6m1s
Project CI / Backend tests (pull_request) Failing after 33s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m57s
Project CI / Frontend tests (pull_request) Failing after 1m33s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 3m39s
Project CI / Repository checks (pull_request) Failing after 25s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 4m46s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m54s
Project CI / Native shell tests (pull_request) Successful in 6m1s
审核队列与版本快照使用所属游戏当前 publication_revision,避免新游戏审核通过时误携带 0。 详情审核动作使用最新详情 revision,并补充后台回归测试。
This commit is contained in:
@@ -68,7 +68,7 @@ const detailResponse: AdminGameDistributionVersionDetailResponse = {
|
||||
inputModes: ['keyboard'],
|
||||
orientation: 'landscape',
|
||||
status: 'unpublished',
|
||||
publicationRevision: 4,
|
||||
publicationRevision: 7,
|
||||
playCount: 0,
|
||||
createdAt: '2026-09-20T08:00:00Z',
|
||||
},
|
||||
@@ -293,4 +293,16 @@ test('详情展示发布者和冻结资料,并试玩当前待审版本', async
|
||||
'http://127.0.0.1:8082/api/game-distribution/admin-previews/preview-1/',
|
||||
);
|
||||
expect(frame.getAttribute('sandbox')).toBe('allow-scripts');
|
||||
fireEvent.click(screen.getByRole('button', { name: '通过' }));
|
||||
await waitFor(() =>
|
||||
expect(reviewAdminGameDistributionVersion).toHaveBeenCalledWith(
|
||||
'admin-token',
|
||||
'version-1',
|
||||
expect.any(String),
|
||||
expect.objectContaining({
|
||||
decision: 'approve',
|
||||
expectedPublicationRevision: 7,
|
||||
}),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -348,12 +348,24 @@ export function AdminGameDistributionReviewPage({
|
||||
onBack={closeDetails}
|
||||
onPreview={() => void startPreview()}
|
||||
onReject={() => {
|
||||
const expectedEntry = detail
|
||||
? {
|
||||
...selectedEntry,
|
||||
publicationRevision: detail.game.publicationRevision,
|
||||
}
|
||||
: selectedEntry;
|
||||
closeDetails();
|
||||
openReasonPrompt(selectedEntry, 'reject');
|
||||
openReasonPrompt(expectedEntry, 'reject');
|
||||
}}
|
||||
onApprove={() => {
|
||||
const expectedEntry = detail
|
||||
? {
|
||||
...selectedEntry,
|
||||
publicationRevision: detail.game.publicationRevision,
|
||||
}
|
||||
: selectedEntry;
|
||||
closeDetails();
|
||||
void submitReview(selectedEntry, 'approve');
|
||||
void submitReview(expectedEntry, 'approve');
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -2929,6 +2929,7 @@ fn private_version_payload(version: &GameDistributionVersionRecord) -> Value {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/// 游戏分发写入开关。
|
||||
///
|
||||
/// 运营在灰度配置里把 `game-distribution:publish` 收紧后,作者写入与新版本激活会返回
|
||||
|
||||
@@ -3286,7 +3286,7 @@ fn list_game_distribution_reviews_tx(
|
||||
versions.truncate(limit);
|
||||
Ok(versions
|
||||
.iter()
|
||||
.map(game_distribution_version_snapshot)
|
||||
.map(|version| game_distribution_version_snapshot_for_game(ctx, version))
|
||||
.collect())
|
||||
}
|
||||
|
||||
@@ -3356,7 +3356,9 @@ fn list_owner_game_distribution_games_tx(
|
||||
GameDistributionOwnerGameSnapshot {
|
||||
versions: versions
|
||||
.iter()
|
||||
.map(|version| game_distribution_version_snapshot(version))
|
||||
.map(|version| {
|
||||
game_distribution_version_snapshot(version, game.publication_revision)
|
||||
})
|
||||
.collect(),
|
||||
game: game_distribution_game_snapshot(&game),
|
||||
}
|
||||
@@ -3716,6 +3718,7 @@ pub(crate) fn game_distribution_asset_has_public_read_grant(
|
||||
|
||||
fn game_distribution_version_snapshot(
|
||||
version: &GameDistributionVersion,
|
||||
publication_revision: u64,
|
||||
) -> GameDistributionVersionSnapshot {
|
||||
GameDistributionVersionSnapshot {
|
||||
version_id: version.version_id.clone(),
|
||||
@@ -3729,7 +3732,7 @@ fn game_distribution_version_snapshot(
|
||||
status: version.status.clone(),
|
||||
review_reason: version.review_reason.clone(),
|
||||
entry_url: version.entry_url.clone(),
|
||||
publication_revision: 0,
|
||||
publication_revision,
|
||||
created_at_micros: version.created_at.to_micros_since_unix_epoch(),
|
||||
updated_at_micros: version.updated_at.to_micros_since_unix_epoch(),
|
||||
metadata_json: version.metadata_json.clone(),
|
||||
@@ -3740,15 +3743,14 @@ fn game_distribution_version_snapshot_for_game(
|
||||
ctx: &ReducerContext,
|
||||
version: &GameDistributionVersion,
|
||||
) -> GameDistributionVersionSnapshot {
|
||||
let mut snapshot = game_distribution_version_snapshot(version);
|
||||
snapshot.publication_revision = ctx
|
||||
let publication_revision = ctx
|
||||
.db
|
||||
.game_distribution_game()
|
||||
.game_id()
|
||||
.find(&version.game_id)
|
||||
.map(|game| game.publication_revision)
|
||||
.unwrap_or_default();
|
||||
snapshot
|
||||
game_distribution_version_snapshot(version, publication_revision)
|
||||
}
|
||||
|
||||
fn public_game_distribution_version(
|
||||
|
||||
Reference in New Issue
Block a user