Skip to content

fix: prevent invalid render output for build logs #17233

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

Merged
merged 2 commits into from
Apr 2, 2025
Merged

Conversation

Parkreiner
Copy link
Member

@Parkreiner Parkreiner commented Apr 2, 2025

No issue to link – fixing this because it was making it harder to diagnose some of the potential problems with our switch over to One-Way Web Sockets in the UI. There were too many extra errors being logged to the console

Changes made

  • Updated Line type in LogLine.tsx to support an ID value to prevent key conflicts during React rendering. Also deleted the LineWithID type, which became redundant after the change
  • Updated the Logs component to use the ID to avoid render key conflicts
  • Updated any component calls to add the ID as a prop

Notes

  • This does prevent a bunch of extra console.error calls that React will automatically spit out, so this should help us a good bit in the future
  • Beyond being a little annoying, there was a chance (that was tiny for now) that React could accidentally mix up component instances during re-renders (meaning logs could suddenly jump out of order in the UI). That wasn't my main goal with this PR (I just wanted less noisy logs), but that should now be impossible

@Parkreiner Parkreiner self-assigned this Apr 2, 2025
@Parkreiner Parkreiner added the hotfix PRs only. Harmless small change. Only humans may set this. label Apr 2, 2025
Copy link

@cdr-bot cdr-bot bot left a comment

Choose a reason for hiding this comment

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

This PR is a hotfix and has been automatically approved.

  • ✅ Base is main or release branch
  • ✅ Has hotfix label
  • ✅ Head is from coder/coder
  • ✅ Less than 100 lines

@Parkreiner Parkreiner changed the title fix: prevent invalid render input for build logs fix: prevent invalid render output for build logs Apr 2, 2025
@Parkreiner Parkreiner merged commit c938bfe into main Apr 2, 2025
48 checks passed
@Parkreiner Parkreiner deleted the mes/owws-tweaks branch April 2, 2025 21:32
@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotfix PRs only. Harmless small change. Only humans may set this.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant