Repository navigation
Stop logging surface resize traffic in the raw messages panel - #292
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request prevents high-frequency SURFACE_RESIZE messages from evicting other protocol messages in the history buffer of HostCommunication while ensuring they are still broadcasted on the message stream. It also updates RawMessages to ignore these messages and adds comprehensive unit tests. The review feedback suggests removing a redundant filtering step of the history buffer in RawMessages and recommends explicitly adding CONSOLE_LOG to UNBUFFERED_MESSAGE_TYPES in HostCommunication to improve robustness and self-documentation.
Contributor
⚡ 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.
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`.
Adds a HostCommunication test that interleaves SURFACE_RESIZE with SEND_TO_SERVER past the 100-entry history cap and checks all three outputs of recordEnvelope together: the history holds only the newest 100 non-resize envelopes, messageStream$ still emits every resize, and latestEnvelope still tracks the newest envelope, including a resize. The existing test did not cover the latest-envelope signal or the cap with resizes interleaved.
On main the envelope history seeds the raw messages, events, and data model panels, not only raw messages. The comment now names all three and states that unbuffered types still update latestEnvelope.
jgindin
force-pushed
the
resizing/212-history-filter
branch
from
October 22, 2026 16:32
ae5e210 to
62a8155
Compare
wrenj
reviewed
Oct 22, 2026
suyangw-g
reviewed
Oct 22, 2026
suyangw-g
approved these changes
Oct 22, 2026
jgindin
force-pushed
the
resizing/212-history-filter
branch
from
October 22, 2026 22:35
0bbfb4c to
bd6b216
Compare
Prevents pre-registration SURFACE_RESIZE messages from evicting RENDERER_READY in earlyMessageBuffer, clarifies UNBUFFERED_MESSAGE_TYPES doc comments, and consolidates the duplicate SURFACE_RESIZE history test.
jgindin
force-pushed
the
resizing/212-history-filter
branch
from
October 23, 2026 14:06
bd6b216 to
fc60c61
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Rebases and integrates PR #212 (preserving Suyang Wang's authorship on the original two commits) onto
main:SURFACE_RESIZEandCONSOLE_LOGfromHostCommunication.messageHistoryBuffer:UNBUFFERED_MESSAGE_TYPES(PreviewBridgeMessageType.SURFACE_RESIZEandPreviewBridgeMessageType.CONSOLE_LOG) andMAX_HISTORY_BUFFER_SIZE = 100inHostCommunication.recordEnvelopeso high-frequency resize telemetry does not evict protocol traffic (RENDERER_READY,RENDER_A2UI,DATA_MODEL_CHANGE,SEND_TO_SERVER) from the 100-entry history buffer before debug panels open.messageStream$andlatestEnvelopedelivery forSURFACE_RESIZE:this.latestEnvelopeSignal.set(envelope)andthis.messageStreamSubject.next(envelope)unfiltered soRenderedFrameandRawFramecontinue receivingSURFACE_RESIZEenvelopes.SURFACE_RESIZEtraffic inRawMessagesand drop redundant history filtering:EXCLUDED_MESSAGE_TYPES(CONSOLE_LOGandSURFACE_RESIZE) inRawMessages.postMessageListenerso live resize messages do not flood the open Raw Messages panel, and removes the redundant.filter(...)onthis.hostComm.getEnvelopeHistory()in theRawMessagesconstructor.messageHistoryBufferreaders:messageHistoryBufferJSDoc comment to list all three debug panels that seed fromgetEnvelopeHistory()(RawMessages,Events, andDataModel).Supersedes #212.
Pre-launch Checklist