-
Notifications
You must be signed in to change notification settings - Fork 74
Cleanup todo, make sure beneficiaries load properly #3096
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
Conversation
📝 WalkthroughWalkthroughRemoved a GitHub bug report template and refactored editor container draft/meta handling to consistently resolve draft identifiers and persist/load beneficiaries, poll, rewardType, description, and image via a unified Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)src/screens/editor/container/editorContainer.tsx (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (4)
✏️ Tip: You can disable this entire section by setting 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/screens/editor/container/editorContainer.tsx`:
- Around line 339-352: Stored beneficiaries/poll data use the fallback key built
as DEFAULT_USER_DRAFT_ID + currentAccount.name but _extractBeneficiaries and
_extractPollDraft use only DEFAULT_USER_DRAFT_ID, causing a key mismatch; update
those extraction functions to compute the same draft id as in this file (use
draft._id || draftId || DEFAULT_USER_DRAFT_ID + currentAccount.name) or accept
currentAccount and build the same fallback string, then use that computed
_draftId when calling the selectors/dispatchers so storage and retrieval keys
match.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/ISSUE_TEMPLATE/bug_report.mdsrc/screens/editor/container/editorContainer.tsx
💤 Files with no reviewable changes (1)
- .github/ISSUE_TEMPLATE/bug_report.md
🧰 Additional context used
🧬 Code graph analysis (1)
src/screens/editor/container/editorContainer.tsx (1)
src/redux/constants/constants.ts (1)
DEFAULT_USER_DRAFT_ID(126-126)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: iOS Build
- GitHub Check: Android Build
🔇 Additional comments (4)
src/screens/editor/container/editorContainer.tsx (4)
315-316: LGTM!Clean extraction of
draftIdfrom state to support the unified draft identifier resolution below.
618-619: LGTM!Including
thumbUrlin the destructuring to support comprehensive meta construction below.
629-661: LGTM - well-structured meta construction.The conditional meta building is clean and defensive:
- Only includes fields when they have meaningful values
- Uses
Object.keys(meta).length > 0check before attaching to avoid empty meta objects- Properly wraps
thumbUrlin an array for theimagefield to maintain consistency with other meta handling
343-345: No issue:currentAccount.usernameandcurrentAccount.nameare the same value.During account initialization,
usernameis explicitly assigned fromnameacross the codebase (confirmed in migrationHelpers.ts, dhive.ts, and applicationContainer.tsx). Both properties contain identical values, so using either in the filter (line 344) produces the correct result.Likely an incorrect or invalid review comment.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/screens/editor/container/editorContainer.tsx (1)
570-573: Same property mismatch:currentAccount.usernameshould becurrentAccount.name.This is the same issue as flagged in
_loadMetaat line 344. For consistency and correctness, usecurrentAccount.name.Suggested fix
const filteredBeneficiaries = beneficiaries.filter( - (item) => item.account !== currentAccount.username, + (item) => item.account !== currentAccount.name, ); // remove default beneficiary from array while saving
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/screens/editor/container/editorContainer.tsx
🧰 Additional context used
🧬 Code graph analysis (1)
src/screens/editor/container/editorContainer.tsx (1)
src/redux/constants/constants.ts (1)
DEFAULT_USER_DRAFT_ID(126-126)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Android Build
- GitHub Check: iOS Build
🔇 Additional comments (4)
src/screens/editor/container/editorContainer.tsx (4)
441-449: LGTM!The fix correctly aligns the draft ID resolution with
_loadMeta, using the same fallback pattern (draftId || DEFAULT_USER_DRAFT_ID + currentAccount.name) to prevent key mismatches when accessingbeneficiariesMap.
451-459: LGTM!Consistent with the
_extractBeneficiariesfix - both extraction methods now use the same draft ID resolution logic, ensuring poll data is retrieved with the correct key.
636-667: LGTM!The meta object construction is well-structured with appropriate defensive checks:
isArraywith length check for beneficiaries- Truthy checks for optional fields
thumbUrlcorrectly wrapped in array forimagefield- Meta only included when non-empty via
Object.keys(meta).length > 0
342-348: No action required. The beneficiary filter correctly usescurrentAccount.username, which is the standard property for account identifier comparisons throughout the codebase and synchronized with.nameduring initialization.Likely an incorrect or invalid review comment.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Summary by CodeRabbit
Refactor
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.