Skip to content

fix: handle multi-source ArgoCD applications#54

Merged
tnm merged 1 commit intomainfrom
fix/multi-source-app-crash
Dec 1, 2025
Merged

fix: handle multi-source ArgoCD applications#54
tnm merged 1 commit intomainfrom
fix/multi-source-app-crash

Conversation

@tnm
Copy link
Contributor

@tnm tnm commented Dec 1, 2025

Summary

  • Add null checks for app.spec.source to prevent UI crash when encountering multi-source applications
  • Multi-source apps use spec.sources[] instead of spec.source, causing the UI to crash with "can't access property repoURL, e.spec.source is undefined"
  • Add defensive-checks.test.ts with test coverage for multi-source app patterns

Changes

  • src/components/-applications/application-card.tsx - Wrap repository section in conditional check
  • src/routes/_authenticated/applications.$name.tsx - Wrap repository section and use optional chaining for targetRevision
  • src/lib/defensive-checks.test.ts - Add tests for defensive null check patterns

Test plan

  • All existing tests pass (273 tests)
  • New defensive-checks.test.ts passes (6 tests)
  • Lint passes
  • Build passes

Fixes #53

@tnm tnm force-pushed the fix/multi-source-app-crash branch 2 times, most recently from 2ecc01e to 7b9ec81 Compare December 1, 2025 18:23
- Add null checks for app.spec.source to prevent UI crash
- Add support for displaying multi-source applications (spec.sources[])
- Update ApplicationSpec type to include optional sources array
- Add defensive-checks.test.ts with test coverage

Multi-source apps now show all repositories in the detail view sidebar,
and show the first repo "+N more" in the card view.

Fixes #53
@tnm tnm force-pushed the fix/multi-source-app-crash branch from 7b9ec81 to a228ebb Compare December 1, 2025 18:24
@tnm tnm merged commit 499b3d5 into main Dec 1, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI crash with multi-source Argo CD apps: can't access property "repoURL", e.spec.source is undefined

1 participant