[8790] Update rxjs NEVER vs EMPTY usages#4915
Conversation
WalkthroughChangesThe PR replaces selected RxJS RxJS no-op observable completion
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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.
🧹 Nitpick comments (1)
ui/app/src/state/epics/mappedDialogs.ts (1)
186-186: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winUse
switchMaphere soEMPTYis flattened
ui/app/src/state/epics/mappedDialogs.ts:175still returns anEMPTYObservable frommap, so the epic emits the Observable object itself. Switch this toswitchMapand wrappushDialog(...)inof(...), matchingdialogs.ts.🤖 Prompt for 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. In `@ui/app/src/state/epics/mappedDialogs.ts` at line 186, The mappedDialogs epic is returning an EMPTY Observable from a map-like branch, so the stream emits the Observable itself instead of flattening it. Update the epic logic around showEditDialog.type and showCodeEditorDialog.type to use switchMap, and wrap the pushDialog(...) result in of(...) so EMPTY is properly flattened, matching the pattern used in dialogs.ts.
🤖 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.
Nitpick comments:
In `@ui/app/src/state/epics/mappedDialogs.ts`:
- Line 186: The mappedDialogs epic is returning an EMPTY Observable from a
map-like branch, so the stream emits the Observable itself instead of flattening
it. Update the epic logic around showEditDialog.type and
showCodeEditorDialog.type to use switchMap, and wrap the pushDialog(...) result
in of(...) so EMPTY is properly flattened, matching the pattern used in
dialogs.ts.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 95838f93-95f3-4d4e-8946-8800fbd29f58
📒 Files selected for processing (10)
ui/app/src/state/epics/dialogs.tsui/app/src/state/epics/itemVersions.tsui/app/src/state/epics/mappedDialogs.tsui/app/src/state/epics/misc.tsui/app/src/state/epics/pathNavigator.tsui/app/src/state/epics/pathNavigatorTree.tsui/app/src/state/epics/system.tsui/guest/src/controls/rte.tsui/guest/src/store/epics/root.tsui/guest/src/store/util.ts
|
@coderabbitai can you check if everything looks good? Please give it a final review before I hand over for human review |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
gh pr diff 4915 --repo craftercms/studio-ui > /tmp/pr.diff
wc -l /tmp/pr.diff
cat /tmp/pr.diffLength of output: 15012 🏁 Script executed: #!/bin/bash
set -euo pipefail
sed -n '90,160p' ui/app/src/state/epics/dialogs.ts 2>/dev/null || echo "file not found, need to clone"Length of output: 2812 🏁 Script executed: #!/bin/bash
set -euo pipefail
for f in ui/app/src/state/epics/dialogs.ts ui/app/src/state/epics/itemVersions.ts ui/app/src/state/epics/mappedDialogs.ts ui/app/src/state/epics/misc.ts ui/app/src/state/epics/pathNavigator.ts ui/app/src/state/epics/pathNavigatorTree.ts ui/app/src/state/epics/system.ts ui/guest/src/controls/rte.ts ui/guest/src/store/epics/root.ts ui/guest/src/store/util.ts; do
echo "== $f =="
rg -n 'NEVER' "$f" || echo "no NEVER usages left"
doneLength of output: 1226 🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n "\bNEVER\b" --type=ts -g '!**/node_modules/**' ui | rg -v '\.spec\.' || echo "none found"Length of output: 275
I didn't find any remaining This looks solid and ready for human review. ✅ Action performedReview finished.
|
craftercms/craftercms#8790
Summary by CodeRabbit