Skip to content

Commit 4c09893

Browse files
committed
Fix backend startup and render budget
1 parent 5705316 commit 4c09893

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

backend/src/main/java/net/modtale/ModtaleApplication.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
55
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
66
import org.springframework.cache.annotation.EnableCaching;
7+
import org.springframework.context.annotation.ComponentScan;
8+
import org.springframework.context.annotation.FilterType;
79
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
810

911
@SpringBootApplication
12+
@ComponentScan(excludeFilters = @ComponentScan.Filter(
13+
type = FilterType.REGEX,
14+
pattern = "net\\.modtale\\.status\\..*"
15+
))
1016
@ConfigurationPropertiesScan
1117
@EnableMethodSecurity
1218
public class ModtaleApplication {

backend/src/test/java/net/modtale/status/DetachedStatusServiceTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class DetachedStatusServiceTest {
2525

2626
@Test
2727
void refreshBuildsStatusSnapshotWithoutDependingOnMainApplication() {
28-
StatusHistoryEntry entry = entry(Instant.parse("2026-06-26T20:00:00Z"), SystemStatus.DEGRADED);
28+
StatusHistoryEntry entry = entry(Instant.now().minusSeconds(60), SystemStatus.DEGRADED);
2929
DetachedStatusService service = serviceWith(entry);
3030

3131
service.refreshSnapshots();
@@ -41,8 +41,9 @@ void refreshBuildsStatusSnapshotWithoutDependingOnMainApplication() {
4141

4242
@Test
4343
void hydratePreservesExistingHistoryBeforeCurrentProbe() {
44-
StatusHistoryEntry previous = entry(Instant.parse("2026-06-26T19:00:00Z"), SystemStatus.OPERATIONAL);
45-
StatusHistoryEntry current = entry(Instant.parse("2026-06-26T20:00:00Z"), SystemStatus.OUTAGE);
44+
Instant now = Instant.now();
45+
StatusHistoryEntry previous = entry(now.minusSeconds(60 * 60), SystemStatus.OPERATIONAL);
46+
StatusHistoryEntry current = entry(now.minusSeconds(60), SystemStatus.OUTAGE);
4647
when(snapshotFileStore.readHistory()).thenReturn(List.of(previous));
4748
when(mongoStatusStore.findHistoryAfter(any())).thenReturn(List.of());
4849
when(mongoStatusStore.findLatestHistory()).thenReturn(Optional.empty());

frontend/src/modules/project/views/ProjectDetails.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export const ProjectDetails: React.FC<ProjectDetailViewProps> = ({
127127
const scrollPosRef = useRef(0);
128128
const downloadFxTimeoutRef = useRef<number | null>(null);
129129
const changelogFetchKeyRef = useRef('');
130+
const gameVersionCatalogProjectRef = useRef<string | null>(null);
130131
const [galleryIndex, setGalleryIndex] = useState(0);
131132
const galleryItems = useMemo(
132133
() => resolveGalleryImages(project?.galleryImages || [], project?.galleryImageCaptions || {}),
@@ -176,10 +177,11 @@ export const ProjectDetails: React.FC<ProjectDetailViewProps> = ({
176177
}, [wikiLookupKey]);
177178

178179
useEffect(() => {
179-
if (!project?.versions?.length) return;
180-
if (orderedGameVersions.length > 0 || preReleaseGameVersions.length > 0) return;
180+
if (!isDownloadOpen || !project?.id || !project.versions?.length) return;
181+
if (gameVersionCatalogProjectRef.current === project.id) return;
181182

182183
let isCancelled = false;
184+
gameVersionCatalogProjectRef.current = project.id;
183185

184186
projectClient.getMetaGameVersionCatalog()
185187
.then((catalog) => {
@@ -196,7 +198,7 @@ export const ProjectDetails: React.FC<ProjectDetailViewProps> = ({
196198
return () => {
197199
isCancelled = true;
198200
};
199-
}, [project?.versions?.length, orderedGameVersions.length, preReleaseGameVersions.length]);
201+
}, [isDownloadOpen, project?.id, project?.versions?.length]);
200202

201203
useEffect(() => {
202204
if (!isDownloadOpen) return;

0 commit comments

Comments
 (0)