Skip to content

Conversation

@feruzm
Copy link
Member

@feruzm feruzm commented Jan 14, 2026

Summary by CodeRabbit

  • Refactor

    • Improved draft metadata handling and consistency across draft operations, ensuring beneficiary and poll data are stored and loaded reliably.
  • Documentation

    • Removed the legacy bug report issue template from the repository.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 14, 2026

📝 Walkthrough

Walkthrough

Removed 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 _draftId resolution.

Changes

Cohort / File(s) Summary
GitHub Configuration
\.github/ISSUE_TEMPLATE/bug_report.md
Deleted the GitHub bug report issue template (32 lines removed).
Editor Container Refactoring
src/screens/editor/container/editorContainer.tsx
Unified draft identifier resolution (`_draftId = draft._id

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nudged a template out the door,
I matched draft IDs, so they roar,
Meta stitched from bits and light,
Beneficiaries, polls tucked tight,
A hop, a patch — the editor's more.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main changes: cleaning up TODO comments and fixing beneficiaries loading by introducing unified _draftId resolution across the editor container.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5843642 and 04a36ff.

📒 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 accessing beneficiariesMap.


451-459: LGTM!

Consistent with the _extractBeneficiaries fix - 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:

  • isArray with length check for beneficiaries
  • Truthy checks for optional fields
  • thumbUrl correctly wrapped in array for image field
  • Meta only included when non-empty via Object.keys(meta).length > 0

342-348: No action required. The beneficiary filter correctly uses currentAccount.username, which is the standard property for account identifier comparisons throughout the codebase and synchronized with .name during 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.


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.

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between dec61ee and 5843642.

📒 Files selected for processing (2)
  • .github/ISSUE_TEMPLATE/bug_report.md
  • src/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 draftId from state to support the unified draft identifier resolution below.


618-619: LGTM!

Including thumbUrl in 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 > 0 check before attaching to avoid empty meta objects
  • Properly wraps thumbUrl in an array for the image field to maintain consistency with other meta handling

343-345: No issue: currentAccount.username and currentAccount.name are the same value.

During account initialization, username is explicitly assigned from name across 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.

Copy link

@coderabbitai coderabbitai bot left a 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.username should be currentAccount.name.

This is the same issue as flagged in _loadMeta at line 344. For consistency and correctness, use currentAccount.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

📥 Commits

Reviewing files that changed from the base of the PR and between 5843642 and 04a36ff.

📒 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 accessing beneficiariesMap.


451-459: LGTM!

Consistent with the _extractBeneficiaries fix - 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:

  • isArray with length check for beneficiaries
  • Truthy checks for optional fields
  • thumbUrl correctly wrapped in array for image field
  • Meta only included when non-empty via Object.keys(meta).length > 0

342-348: No action required. The beneficiary filter correctly uses currentAccount.username, which is the standard property for account identifier comparisons throughout the codebase and synchronized with .name during 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.

@feruzm feruzm merged commit 79c7d46 into development Jan 14, 2026
1 of 3 checks passed
@feruzm feruzm deleted the meta branch January 14, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants