fix(promotion): copy bundleReady and downloadReady when promoting skill to global

When approving a promotion, the new SkillVersion was created without copying
bundleReady and downloadReady from the source version, causing the download
button to be permanently disabled for promoted skills.
This commit is contained in:
dongmucat 2026-05-14 11:38:35 +08:00
parent 5ccb7f9cf7
commit 2af0bf184b
2 changed files with 6 additions and 0 deletions

View file

@ -234,6 +234,8 @@ public class PromotionService {
newVersion.setManifestJson(sourceVersion.getManifestJson());
newVersion.setFileCount(sourceVersion.getFileCount());
newVersion.setTotalSize(sourceVersion.getTotalSize());
newVersion.setBundleReady(sourceVersion.isBundleReady());
newVersion.setDownloadReady(sourceVersion.isDownloadReady());
newVersion = skillVersionRepository.save(newVersion);
// Update skill's latest version

View file

@ -91,6 +91,8 @@ class PromotionServiceTest {
sv.setManifestJson("{\"version\":\"1.0.0\"}");
sv.setFileCount(3);
sv.setTotalSize(1024L);
sv.setBundleReady(true);
sv.setDownloadReady(true);
return sv;
}
@ -466,6 +468,8 @@ class PromotionServiceTest {
assertEquals(3, newVersion.getFileCount());
assertEquals(1024L, newVersion.getTotalSize());
assertEquals(Instant.now(CLOCK), newVersion.getPublishedAt());
assertTrue(newVersion.isBundleReady());
assertTrue(newVersion.isDownloadReady());
// Verify files copied
@SuppressWarnings("unchecked")