fix(portal): resolve hero avatars by user id#447
Conversation
Use the stable GitHub numeric account id to build avatar URLs instead of parsing the metadata username, which could be stale.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app-modules/portal/src/Livewire/HeroSection.php`:
- Around line 84-88: Update the query in the HeroSection data-loading chain to
filter numeric external_account_id values before applying limit(10), using a
database-level numeric predicate where supported; remove the reliance on the
post-pluck ctype_digit filter for enforcing the limit so up to 10 valid IDs can
be selected.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 8d70590a-63b7-4111-8b37-c3eb9623f010
📒 Files selected for processing (2)
app-modules/portal/src/Livewire/HeroSection.phpapp-modules/portal/tests/Feature/HeroAvatarsTest.php
fernanduandrade
left a comment
There was a problem hiding this comment.
Muito boa alteração, garantindo a assertividade da renderização da imagem 🎉
Summary
external_account_id(avatars.githubusercontent.com/u/{id}) instead of parsing themetadatausername/name, which could be stale or renamed.external_account_idpresent, dropping the ad-hoc metadata handle extraction.HeroAvatarsTestfeature coverage for the active-user + GitHub-identity avatar resolution.Coverage (GitHub identities, non-deleted)
external_account_id, new)metadata.username|name, old)Coverage is identical (all 2643 identities carry both), so no users lose their avatar. The change is about stability: numeric user-id URLs survive GitHub username renames, whereas the old username-based URLs break on rename.
Test plan
php artisan test --compact --filter=HeroAvatars