Skip to content

fix(activity-feed-v2): use newest version number for multi-version activities#4600

Merged
mergify[bot] merged 2 commits into
box:masterfrom
jackiejou:fix/activity-feed-v2-multi-version-number
May 29, 2026
Merged

fix(activity-feed-v2): use newest version number for multi-version activities#4600
mergify[bot] merged 2 commits into
box:masterfrom
jackiejou:fix/activity-feed-v2-multi-version-number

Conversation

@jackiejou
Copy link
Copy Markdown
Contributor

@jackiejou jackiejou commented May 29, 2026

Summary

  • When /file_activities returns a single versions activity spanning multiple versions, Feed.js only assigns version_number if start === end. For ranges, only version_end and version_start are populated.
  • transformVersionToProps was producing versionNumber: 0 in that case, causing onVersionHistoryClick to receive 0.
  • Fall back to version_end (the newest version number in the range) when version_number is unset.

Test plan

  • Added unit test covering the multi-version fallback in transformers.test.ts
  • yarn test --watchAll=false --testPathPattern="activity-feed-v2/__tests__/transformers" (62 passed)

Summary by CodeRabbit

  • Bug Fixes
    • Improved version number handling with enhanced fallback logic to ensure proper version identification when primary version data is unavailable.

Review Change Stack

@jackiejou jackiejou requested review from a team as code owners May 29, 2026 00:12
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f67e061b-e930-4f7f-bc83-d44c017d87ea

📥 Commits

Reviewing files that changed from the base of the PR and between 2f781e5 and ea23517.

📒 Files selected for processing (2)
  • src/elements/content-sidebar/activity-feed-v2/__tests__/transformers.test.ts
  • src/elements/content-sidebar/activity-feed-v2/transformers.ts

Walkthrough

The PR updates the version transformation logic in the activity feed to handle missing version numbers more gracefully. transformVersionToProps now uses version_end as a fallback before defaulting to 0, with a corresponding test case verifying the new behavior.

Changes

Version Number Fallback

Layer / File(s) Summary
Version number fallback logic and tests
src/elements/content-sidebar/activity-feed-v2/transformers.ts, src/elements/content-sidebar/activity-feed-v2/__tests__/transformers.test.ts
transformVersionToProps updated to fall back to version_end when version_number is falsy, with a new test case verifying the fallback behavior when version_number is undefined.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • box/box-ui-elements#4570: Both PRs modify src/elements/content-sidebar/activity-feed-v2/transformers.ts within transformVersionToProps, specifically changing how versionNumber is derived and falls back when version_number is missing.

Suggested labels

ready-to-merge

Suggested reviewers

  • ahorowitz123
  • kduncanhsu
  • zhirongwang

Poem

🐰 A version that wanders, now knows where to go,
When numbers go missing, it asks version_end first,
Then zeros await if all paths are dry,
A fallback so gentle, a fallback so wise! 📋

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing the activity feed to use the newest version number for multi-version activities.
Description check ✅ Passed The description adequately explains the problem, the fix, and includes a test plan, though it does not strictly follow the provided template structure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mergify mergify Bot added the queued label May 29, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 29, 2026

Merge Queue Status

  • Entered queue2026-05-29 16:09 UTC · Rule: Automatic strict merge
  • Checks skipped · PR is already up-to-date
  • Merged2026-05-29 16:10 UTC · at 0856ad02e32760fa10f0fef5603552d8927bf9d7 · squash

This pull request spent 1 minute 4 seconds in the queue, including 19 seconds running CI.

Required conditions to merge

@mergify mergify Bot merged commit e201650 into box:master May 29, 2026
10 of 11 checks passed
@mergify mergify Bot removed the queued label May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants