Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request excludes high-frequency SURFACE_RESIZE messages from being logged in the raw messages debug panel, updating both the listener and the initial history buffer loading, and adds corresponding unit tests. The review feedback highlights a critical issue: filtering these messages only in the UI does not prevent them from flooding HostCommunication's internal messageHistoryBuffer, which would still evict other important messages. It is recommended to exclude SURFACE_RESIZE messages directly when pushing to the history buffer in HostCommunication.
⚡ A2UI Composer PR PreviewYour automated preview is successfully live (commit
|
A guest reports SURFACE_RESIZE on every reflow of its content, and each rendered surface runs its own guest, so one host layout change emits a message per surface. During a streaming response these filled the panel's 100 entry window and evicted the protocol traffic the view exists to show. The type is now excluded alongside CONSOLE_LOG through a single set, applied both to the live stream and to the history replayed when the panel opens. HostCommunication keeps its own 100 entry buffer to seed that history, so filtering in the panel alone would leave it showing nothing. Resize messages are kept out of that buffer too, while still being broadcast on messageStream$ because RenderedFrame uses them to size its iframe.
91c13f4 to
e958f94
Compare
Keep `ignores SURFACE_RESIZE messages completely` focused strictly on ignoring `SURFACE_RESIZE` (mirrors `CONSOLE_LOG`). Add a companion test that emits all non-excluded `PreviewBridgeMessageType` values to ensure none are accidentally ignored. Also replace `POST_MSG_1` in the seeded history test with `PreviewBridgeMessageType.RENDER_A2UI`.
jgindin
left a comment
There was a problem hiding this comment.
I'm absolutely in favor of this change.
However, there's an actual bug that I'm looking into, where we get into a storm of these resize messages. I'd like to hold off on this PR until after that gets fixed.
Description
A guest reports
SURFACE_RESIZEon every reflow of its content, and eachrendered surface runs its own guest, so a single host layout change — a
window resize, a splitter drag, a scrollbar appearing — emits one message
per surface. During a streaming response these filled the panel's
100 entry window and evicted the
RENDER_A2UIandDATA_MODEL_CHANGEtraffic the view exists to show.
The type is now excluded alongside
CONSOLE_LOG. The two exclusions werepreviously checked in two separate places, once for the live stream and
once for the history replayed when the panel opens; both now read a single
set, so they cannot drift apart.
This hides the resize payloads from the panel entirely rather than offering
a toggle. If those payloads turn out to be worth inspecting — they are the
data you would read to diagnose a host/guest resize feedback loop — a type
filter in the template would be the follow-up.
Verification
yarn prettier:check,yarn lint,yarn tscandyarn testpass.Pre-launch Checklist