-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WEB-3100] chore: no load improvement #6375
Conversation
WalkthroughThe changes modify the Changes
Suggested labels
Suggested reviewers
Poem
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
web/core/store/issue/issue.store.ts (2)
1-1
: Consider usingcloneDeep
instead ofclone
The current implementation uses lodash's
clone
which performs shallow cloning. For complex issue objects with nested properties, consider usingcloneDeep
to ensure all nested objects are properly copied.-import clone from "lodash/clone"; +import cloneDeep from "lodash/cloneDeep"; - const issueBeforeUpdate = clone(this.issuesMap[issueId]); + const issueBeforeUpdate = cloneDeep(this.issuesMap[issueId]);Also applies to: 82-82
90-92
: Document the epic exclusion logicThe code excludes epics from persistent layer updates, but the reasoning isn't documented. Please add a comment explaining why epics are handled differently to help future maintainers understand this optimization.
+ // Epics are excluded from persistent layer updates because... if (!issueBeforeUpdate.is_epic) { updatePersistentLayer(issueId); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
web/core/store/issue/issue.store.ts
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
const issueBeforeUpdate = clone(this.issuesMap[issueId]); | ||
runInAction(() => { | ||
set(this.issuesMap, [issueId, "updated_at"], getCurrentDateTimeInISO()); | ||
Object.keys(issue).forEach((key) => { | ||
set(this.issuesMap, [issueId, key], issue[key as keyof TIssue]); | ||
}); | ||
}); | ||
|
||
if (!this.issuesMap[issueId]?.is_epic) { | ||
if (!issueBeforeUpdate.is_epic) { | ||
updatePersistentLayer(issueId); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Inconsistent persistent layer update optimization
The epic-exclusion optimization is not consistently applied across the codebase. While this file skips persistent layer updates for epics, other files update the persistent layer without checking the epic status:
web/core/store/issue/issue-details/sub_issues.store.ts
web/core/store/issue/helpers/base-issues.store.ts
This inconsistency could lead to epics being updated in some places but not others, potentially causing state synchronization issues.
🔗 Analysis chain
Verify persistent layer update optimization
The changes optimize persistent layer updates by:
- Preserving the pre-update state through cloning
- Excluding epics from updates
Let's verify this optimization's impact:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for other persistent layer update calls
rg "updatePersistentLayer" -A 5
# Check for epic-related operations
ast-grep --pattern 'is_epic'
Length of output: 4145
Description
This PR includes following changes:
Type of Change
References
[WEB-3100]
Summary by CodeRabbit