fix: clear stale nonCurrentRelease even when onlineVersionCode is blank
Enhance the universal cleanup in refreshStoreReviewStatus to also clear stale nonCurrentRelease/preExisting marks when onlineVersionCode is blank but currentSubmissionLive is false. This handles OPPO and other stores that may not return a versionCode in their API response. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
这个提交包含在:
父节点
23390570ef
当前提交
362dbcc638
@ -845,22 +845,36 @@ public class StoreSubmissionService {
|
|||||||
// whenever an online version existed, regardless of whether it was newer or older.
|
// whenever an online version existed, regardless of whether it was newer or older.
|
||||||
// If the online version is OLDER than the submitted version, clear any stale marks
|
// If the online version is OLDER than the submitted version, clear any stale marks
|
||||||
// so the user can submit this newer version.
|
// so the user can submit this newer version.
|
||||||
if (!polled.getOnlineVersionCode().isBlank()) {
|
boolean staleCleared = false;
|
||||||
int cmp = compareVersionCodes(polled.getOnlineVersionCode(), String.valueOf(v.getVersionCode()));
|
if (entry instanceof Map<?, ?> m) {
|
||||||
if (cmp < 0 && entry instanceof Map<?, ?> m) {
|
|
||||||
Object nonCurrentRelease = m.get("nonCurrentRelease");
|
Object nonCurrentRelease = m.get("nonCurrentRelease");
|
||||||
Object preExisting = m.get("preExisting");
|
Object preExisting = m.get("preExisting");
|
||||||
if (Boolean.TRUE.equals(nonCurrentRelease) || Boolean.TRUE.equals(preExisting)) {
|
boolean hasStaleMark = Boolean.TRUE.equals(nonCurrentRelease) || Boolean.TRUE.equals(preExisting);
|
||||||
|
if (hasStaleMark) {
|
||||||
|
if (!polled.getOnlineVersionCode().isBlank()) {
|
||||||
|
int cmp = compareVersionCodes(polled.getOnlineVersionCode(), String.valueOf(v.getVersionCode()));
|
||||||
|
if (cmp < 0) {
|
||||||
log.info("Manual refresh: {}/{} clearing stale nonCurrentRelease/preExisting — online {} < submitted {}",
|
log.info("Manual refresh: {}/{} clearing stale nonCurrentRelease/preExisting — online {} < submitted {}",
|
||||||
v.getId(), storeType, polled.getOnlineVersionCode(), v.getVersionCode());
|
v.getId(), storeType, polled.getOnlineVersionCode(), v.getVersionCode());
|
||||||
storeService.clearStoreReview(v.getId(), storeType);
|
storeService.clearStoreReview(v.getId(), storeType);
|
||||||
|
staleCleared = true;
|
||||||
|
}
|
||||||
|
} else if (!polled.isCurrentSubmissionLive()) {
|
||||||
|
// onlineVersionCode is blank but current submission is not live —
|
||||||
|
// the stored nonCurrentRelease is unverifiable and likely stale.
|
||||||
|
log.info("Manual refresh: {}/{} clearing stale nonCurrentRelease/preExisting — onlineVersionCode blank and not current live",
|
||||||
|
v.getId(), storeType);
|
||||||
|
storeService.clearStoreReview(v.getId(), storeType);
|
||||||
|
staleCleared = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (staleCleared) {
|
||||||
isApproved = false;
|
isApproved = false;
|
||||||
isUnderReview = false;
|
isUnderReview = false;
|
||||||
isRejected = false;
|
isRejected = false;
|
||||||
existingState = "";
|
existingState = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
AppVersionEntity.StoreReviewState mappedState = mapToStoreReviewState(polled.getReviewState());
|
AppVersionEntity.StoreReviewState mappedState = mapToStoreReviewState(polled.getReviewState());
|
||||||
if (mappedState == AppVersionEntity.StoreReviewState.APPROVED) {
|
if (mappedState == AppVersionEntity.StoreReviewState.APPROVED) {
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户