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>
这个提交包含在:
XuqmGroup 2026-05-22 19:55:49 +08:00
父节点 23390570ef
当前提交 362dbcc638

查看文件

@ -845,22 +845,36 @@ public class StoreSubmissionService {
// 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
// so the user can submit this newer version.
if (!polled.getOnlineVersionCode().isBlank()) {
int cmp = compareVersionCodes(polled.getOnlineVersionCode(), String.valueOf(v.getVersionCode()));
if (cmp < 0 && entry instanceof Map<?, ?> m) {
boolean staleCleared = false;
if (entry instanceof Map<?, ?> m) {
Object nonCurrentRelease = m.get("nonCurrentRelease");
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 {}",
v.getId(), storeType, polled.getOnlineVersionCode(), v.getVersionCode());
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;
isUnderReview = false;
isRejected = false;
existingState = "";
}
}
}
AppVersionEntity.StoreReviewState mappedState = mapToStoreReviewState(polled.getReviewState());
if (mappedState == AppVersionEntity.StoreReviewState.APPROVED) {