Skip to content

(Fix) HtmlPanel crash bug#13

Merged
Asha20 merged 2 commits intofeat/htmlpanelfrom
fix/htmlpanel_crash
Oct 4, 2024
Merged

(Fix) HtmlPanel crash bug#13
Asha20 merged 2 commits intofeat/htmlpanelfrom
fix/htmlpanel_crash

Conversation

@Asha20
Copy link
Collaborator

@Asha20 Asha20 commented Oct 4, 2024

Fixes a bug that made the browser tab crash under certain conditions when <Session> re-renders.

<Session> has a syncUser prop that has the type Talk.User | () => Talk.User. Session uses an useEffect to destroy & reinitialize itself whenever the current user changes. However, passing the value of syncUser to the useEffect dependency array directly would result in the session being destroyed even if the user ID never changed, because useEffect's dependency array does a shallow comparison that fails when syncUser is a non-memoized object/function.

The bug is fixed by passing the user ID to the dependency array instead of syncUser.

@Asha20 Asha20 changed the base branch from master to feat/htmlpanel October 4, 2024 08:47
Copy link

@vickz84259 vickz84259 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Asha20 and I had a whole back and forth in Slack but we couldn't pin point why this causes the browser tab in Chrome to crash.

So far this fix suffices.

@Asha20 Asha20 merged commit 6217f1d into feat/htmlpanel Oct 4, 2024
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