Skip to content

fix(client): guard syncRepository against cleared selectedRepo after await - #2603

Closed
shikanime wants to merge 1 commit into
mainfrom
fix/repo-sync-selectedrepo-race
Closed

fix(client): guard syncRepository against cleared selectedRepo after await#2603
shikanime wants to merge 1 commit into
mainfrom
fix/repo-sync-selectedrepo-race

Conversation

@shikanime

@shikanime shikanime commented Aug 26, 2026

Copy link
Copy Markdown
Member

Contexte

Le snackbar affichait can't access property "internalRepoName", h.value is undefined au lancement d'une synchronisation de dépôt.

Issues liées : #2602
Refs: #2602

Cause

syncRepository() accédait à selectedRepo.value.internalRepoName après l'await de Repositories.sync(...). La fermeture de la modale pendant l'appel (save / delete / reload) vide selectedRepo, rendant la lecture undefined et produisant le TypeError capturé en snackbar.

Correction

Fige const repo = selectedRepo.value avant l'await et l'utilise pour .id et .internalRepoName. Une seule lecture avant l'appel asynchrone, aucun accès post-await sur une référence volatile.

Fichier

apps/client/src/components/ProjectResources.vue — syncRepository()

…await

Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr>
Change-Id: I6faf7012b6113dbdadf4f952023c73a46a6a6964
@shikanime shikanime added the bug Something isn't working label Aug 26, 2026
@shikanime shikanime self-assigned this Aug 26, 2026
@shikanime shikanime added this to the 9.24.5 milestone Aug 26, 2026
@github-actions github-actions Bot added the built label Aug 26, 2026
@shikanime shikanime modified the milestones: 9.24.5, 9.25.0 Aug 26, 2026
@StephaneTrebel StephaneTrebel modified the milestones: 9.25.0, 9.26.0, 10.0.0 Sep 1, 2026
@shikanime
shikanime marked this pull request as ready for review September 1, 2026 08:23
@shikanime
shikanime requested a review from a team as a code owner September 1, 2026 08:23
@shikanime shikanime added the preview Deploy preview app with Argo-cd label Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🤖 Hey !

A preview of the application is available at : https://console-pr-2603.dso.cpin-hp.numerique-interieur.fr

Please be patient, deployment may take a few minutes.

@cloud-pi-native-sonarqube

Copy link
Copy Markdown

@shikanime shikanime closed this Sep 1, 2026
@shikanime
shikanime deleted the fix/repo-sync-selectedrepo-race branch September 1, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working built preview Deploy preview app with Argo-cd

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants