Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem Description:
Users are experiencing an issue where the scheduling options modal did not display any tiers or scheduling options. This made it impossible to schedule posts properly. Upon investigation, it was found that the data variable in the OverlayView component, which should contain access rules and tier information, was undefined or an empty array.
Possible Cause of the Problem:
The root cause was identified in the fetch intercepting script (fetchIntercepts.js). The script was using window.parent.postMessage to send messages containing the access rules data to the OverlayView component. However, since both the fetch intercepting script and the OverlayView component are running in the same window context (not within an iframe), using window.parent.postMessage caused the messages to be lost or not received.
As a result, the handleMessage event listener in the OverlayView component did not receive the messages, leading to the scheduling options modal remaining empty.
Possible Solution:
By changing to window.postMessage, messages containing the access rules data are successfully sent to and received by the OverlayView component. The handleMessage event listener now correctly receives these messages, allowing the access rules data to be processed and stored. Consequently, the data variable is populated with the access rules, and the scheduling options modal displays the tiers and scheduling options as expected.