Skip to content

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

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

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
@cloud-pi-native-sonarqube

Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant