-
Notifications
You must be signed in to change notification settings - Fork 13k
fix: startup iframe event
#37718
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
fix: startup iframe event
#37718
Conversation
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: de9d15d The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe PR moves the global Changes
Sequence Diagram(s)sequenceDiagram
participant App as AppLayout (React)
participant StartupHook as useStartupEvent
participant Global as fireGlobalEvent / postMessage
participant Parent as Parent window (iframe listener)
App ->> StartupHook: mount (useEffect)
StartupHook ->> Global: fireGlobalEvent('startup', true)
Global ->> Parent: window.postMessage({ eventName: 'startup', ... })
Parent -->> Parent: parent receives startup event
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (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). (3)
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
.changeset/tender-wolves-promise.md(1 hunks)apps/meteor/client/startup/startup.ts(0 hunks)apps/meteor/client/views/root/AppLayout.tsx(2 hunks)apps/meteor/client/views/root/hooks/useStartupEvent.ts(1 hunks)
💤 Files with no reviewable changes (1)
- apps/meteor/client/startup/startup.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
apps/meteor/client/views/root/hooks/useStartupEvent.tsapps/meteor/client/views/root/AppLayout.tsx
🧬 Code graph analysis (1)
apps/meteor/client/views/root/AppLayout.tsx (1)
apps/meteor/client/views/root/hooks/useStartupEvent.ts (1)
useStartupEvent(5-11)
⏰ 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). (7)
- GitHub Check: 🔨 Test Unit / Unit Tests
- GitHub Check: 🔎 Code Check / TypeScript
- GitHub Check: 🔎 Code Check / Code Lint
- GitHub Check: 🔨 Test Storybook / Test Storybook
- GitHub Check: 📦 Meteor Build (coverage)
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🔇 Additional comments (2)
.changeset/tender-wolves-promise.md (1)
1-5: LGTM!The changeset properly documents this as a patch-level fix for the missing startup iframe event dispatch.
apps/meteor/client/views/root/AppLayout.tsx (1)
33-33: LGTM! Hook integration is correct.The
useStartupEventhook is properly imported and invoked in the AppLayout component. While it's called late in the hook sequence (line 73), all hooks execute during the render phase before the component mounts, so the startup event will still fire when the component mounts.Also applies to: 73-73
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #37718 +/- ##
===========================================
+ Coverage 67.78% 67.80% +0.02%
===========================================
Files 3449 3450 +1
Lines 113987 113976 -11
Branches 20956 20955 -1
===========================================
+ Hits 77262 77279 +17
+ Misses 34610 34577 -33
- Partials 2115 2120 +5
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Co-authored-by: gabriellsh <40830821+gabriellsh@users.noreply.github.com>
Proposed changes (including videos or screenshots)
When Rocket.Chat is embedded in web clients, Rocket.Chat is supposed to emit a
startupevent upon loading to inform the parent window when Rocket.Chat is ready. Currently we were not emitting this event as expected.This PR fixes this issue and moves the implementation to react.
Issue(s)
Steps to test or reproduce
startupevent is not emitted.Further comments
CORE-1536
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.