fix(activity-feed-v2): resolve avatar URLs via getAvatarUrl callback#4644
fix(activity-feed-v2): resolve avatar URLs via getAvatarUrl callback#4644jackiejou wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughNew ChangesAvatar URL resolution in ActivityFeedV2
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 `@src/elements/content-sidebar/activity-feed-v2/useAvatarUrls.ts`:
- Around line 88-104: The cleanup function in the useEffect (the arrow function
at lines 102-104) currently only sets cancelled to true, but fails to clear the
in-flight IDs that were being tracked in inFlightIdsRef.current. When
dependencies change and the cleanup runs, the pendingIds remain in
inFlightIdsRef, causing them to be skipped in the next effect run and never
retried. Modify the cleanup function to iterate through pendingIds and delete
each ID from inFlightIdsRef.current in addition to setting cancelled to true,
ensuring these IDs can be fetched again when the effect re-runs with new
dependencies.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f9809241-bfe4-404d-8477-97f9bd946a43
📒 Files selected for processing (6)
src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsxsrc/elements/content-sidebar/activity-feed-v2/__tests__/transformers.test.tssrc/elements/content-sidebar/activity-feed-v2/__tests__/useAvatarUrls.test.tsxsrc/elements/content-sidebar/activity-feed-v2/transformers.tssrc/elements/content-sidebar/activity-feed-v2/types.tssrc/elements/content-sidebar/activity-feed-v2/useAvatarUrls.ts
Summary
useAvatarUrlshook that walks the activity feed, collects unique author/assignee/version-actor ids, and resolves their avatar URLs via the existinggetAvatarUrlcallback (same path v1 uses for tokenized avatar URLs).user.avatar_urlpayload fallback. The Box API embeds users asUser--Minion Comment/Annotation/Task/Versioncreated_by, which does not includeavatar_url, so the fallback was alwaysundefinedin practice.GetAvatarUrlandAvatarUrlMapto the sharedtypes.tsso the prop, the hook, and the transformers all share one signature.Hook behavior
Users.getAvatarUrlWithAccessTokencache is still in effect.Test plan
yarn test --watchAll=false --testPathPattern="activity-feed-v2"-> 252/252 passingyarn test --watchAll=false --testPathPattern="SidebarFileProperties"-> 4/4 passingSummary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests