Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(SandpackConsole): clear logs based on maxMessageCount option #866

Merged
merged 1 commit into from
Apr 1, 2023

Conversation

SSHari
Copy link
Contributor

@SSHari SSHari commented Apr 1, 2023

What kind of change does this pull request introduce?

This fixes a bug with the Console component where the maxMessageCount option isn't respected.

What is the current behavior?

The maxMessageCount option is ignored and instead the default MAX_MESSAGE_COUNT value is used when determining if old logs should be cleaned up.

#865

What is the new behavior?

The maxMessageCount is respected so that logs are cleaned up based on what the user specifies.

What steps did you take to test this? This is required before we can merge, make sure to test the flow you've updated.

  1. Rendered an Editor and Console component
  2. Changed the maxMessageCount option
  3. Tested with the vanilla (client) and node (server) templates by logging more lines than the maxMessageCount option
  4. Verified that the logs earlier in the list were cleaned up

Checklist

  • Documentation; N/A
  • Storybook (if applicable);
  • Tests; N/A
  • Ready to be merged;

@vercel
Copy link

vercel bot commented Apr 1, 2023

@SSHari is attempting to deploy a commit to the CodeSandbox Team on Vercel.

A member of the Team first needs to authorize it.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 1, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 189fb90:

Sandbox Source
Sandpack Configuration
practical-bird-i3yqbp Configuration

@@ -67,7 +67,7 @@ export const useSandpackConsole = ({
}
);

while (messages.length > MAX_MESSAGE_COUNT) {
while (messages.length > maxMessageCount) {
Copy link
Member

Choose a reason for hiding this comment

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

ahhh 🙈🤦‍♀️🤦🤦‍♂️

@danilowoz danilowoz merged commit c8afd3e into codesandbox:main Apr 1, 2023
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.

None yet

2 participants