Skip to content

Commit dc6d906

Browse files
markgohoclaude
andcommitted
fix: clear optimistic profile data when all retries are exhausted
The optimistic profile feature masked the error state when GET requests permanently failed after profile creation. Now clears optimistic data once auto-retries are exhausted so the "Profile Load Error" UI appears. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1787a75 commit dc6d906

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

members/src/app/edit-profile/edit-profile.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export class EditProfile {
4949
setTimeout(() => {
5050
this.profileService.profileResource.reload();
5151
}, RETRY_DELAY_MS);
52+
} else if (status === 'error' && this.autoRetryCount >= MAX_AUTO_RETRIES) {
53+
this.profileService.clearOptimisticProfile();
5254
}
5355
});
5456
}

members/src/app/services/profile.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ export class ProfileService {
217217
return firstValueFrom(this.http.get<ProfileData>(`/api/profiles/${slug}`));
218218
}
219219

220+
clearOptimisticProfile(): void {
221+
this.optimisticProfile.set(undefined);
222+
}
223+
220224
getTagUrl(tag: string): string {
221225
return tag.toLowerCase().replaceAll(/\s+/g, '-');
222226
}

0 commit comments

Comments
 (0)