Skip to content

fix: load the profile once per switch and show an error for unknown users - #91

Open
devin-ai-integration[bot] wants to merge 1 commit into
devin/task-25-angular-boot3-contract-v2from
devin/task-25-profile-load-once
Open

devin-ai-integration[bot] wants to merge 1 commit into
devin/task-25-angular-boot3-contract-v2from
devin/task-25-profile-load-once

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Summary

Stacked on #85 (base devin/task-25-angular-boot3-contract-v2) so #85 stays as approved; restacked on #85's rebase onto #87 (#85 head 0de77c5), merges cleanly with #88. Fixes the two follow-ups found when checking #85 at c427cf7:

  • 3 profile requests per navbar switch → 1. ProfileArticlesComponent and ProfileFavoritesComponent each fetched GET /profiles/:username only to read profile.username for the article filter. The parent also clears profile on switch, which tears down and recreates the <router-outlet>, so the old and new child each fetched again. The tabs now read username from route.parent.paramMap and fetch nothing; only ProfileComponent loads the profile. Direct load also drops from 2 requests to 1.
  • Unknown username showed a blank page. ProfileComponent stored error.errors (the inner map) in errors, but <app-list-errors> expects { errors: {...} }, so it rendered an empty <ul>. It now sets { errors: { profile: ['not found'] } } on 404 (rendered "profile not found") and wraps other failures correctly.

Verified locally against #1258 on seed data (jake): direct load 1 request, sam → jake via navbar 1 request with jake's content and 10 posts, Favorited tab 0 extra requests, sam/favorites → jake 1 request, /profile/nobodyxyz shows "profile not found", and navigating back to a real profile recovers. bun run format:check, bun run test -- --run (180/180) bun run build and bun run lint pass.

Devin-Org: engineering


Migration Engineer opened this PR for Matthew
Implemented in session Wire Angular RealWorld app to Boot 3 backend
Review with Devin · Open in Devin Desktop


@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Custom reviewers

  • 🧪 Test 2 reviewer: no findings · View
  • 🚩 TD Enterprise Architecture: no findings · View
  • 👁️ TD Information Security: no findings · View
  • 🧠 TD French Language (Bill 96): 1 finding · View
  • ⏱️ TD API Contracts: no findings · View

Devin Review

this.articlesConfig.set({
type: 'all',
filters: {
author: params.get('username')!,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Profile tabs use unverified URL usernames

When a profile lookup resolves a username differently from the URL, articlesConfig uses the URL value instead of the returned username. Check whether profile lookup and article filtering apply the same username matching rules; the favorites tab makes the same change.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +51 to +52
? { errors: { profile: ['not found'] } }
: { errors: error.errors ?? { profile: ['could not be loaded'] } },

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧠 TD French Language (Bill 96): English-only profile error messages

On lookup failures, ProfileComponent hard-codes “profile not found” and the fallback “profile could not be loaded”. ListErrorsComponent renders these without translation. Canadian French equivalents are profile.notFound: « Profil introuvable » and profile.loadFailed: « Impossible de charger le profil ».

View in Devin Review · Custom reviewer

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/task-25-angular-boot3-contract-v2 branch from c427cf7 to 0de77c5 Compare November 17, 2026 06:09
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/task-25-profile-load-once branch from 7bd746a to 7e09c9d Compare November 17, 2026 06:09
@devin-ai-integration

Copy link
Copy Markdown
Author

CHECKED in the browser: #91 at 7e09c9d (includes #85), run against spring-boot-realworld #1258 + #1259 (94dab597) on seed data, after a fresh bun install and bun run start:local.

  • Navbar switch from sam to own profile: 1 profile GET (was 3). Heading, bio, avatar, Edit Profile Settings and posts update.
  • Direct /profile/sam: 1 GET (was 2). Favorited tab: 0 extra GETs, correct list.
  • Unknown username shows "profile not found". Navbar and browser Back recovery clear it.
  • Regressions pass: favorites-tab user switch, author links, back/forward, per-user follow state. No CSP/SRI/console errors from the rebase. The only failing requests are the seeded external avatars, which were already failing.
Before switch After switch
Unknown profile Recovered

Recording

Written by Devin

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.

0 participants