Fix session isolation when prechat fields are absent#50
Fix session isolation when prechat fields are absent#50andrea-sdl wants to merge 8 commits intotrunkfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a regression where session isolation for Embedded Messaging wasn’t applied when prechatFields are absent, allowing sessions to be unexpectedly shared across channels.
Changes:
- Removes the early return that prevented
restrictSessionOnMessagingChannelfrom being applied when no prechat fields are configured. - Makes hidden prechat field injection conditional (
hasPrechatFields) while always applying session isolation ononEmbeddedMessagingReady.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@andrea-sdl Can you clarify the testing steps? Is this correct?
|
Yes, sorry for not including a full test since this was an edge case. The testing steps you included look good. To make testing easier I would put the filter inside the |
Description
This fixes a regression introduced in the messaging channel session-isolation change. Sites without configured prechat fields were exiting early and never applying
restrictSessionOnMessagingChannel, so channels could still share a session unexpectedly.The root cause was coupling two unrelated behaviors in the same early-return branch: session isolation and prechat field injection. This update keeps prechat field injection conditional, but always applies session isolation when embedded messaging is ready.
Pre-review checklist
Please make sure the items below have been covered before requesting a review:
Pre-deploy checklist
Steps to Test