Skip to content

fix: Toolbar when maxHistory is set to 0 #9506

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 10, 2025

Conversation

michalsn
Copy link
Member

@michalsn michalsn commented Apr 5, 2025

Description
This PR fixes issues with the debug bar when maxHistory is set to 0:

  • A JavaScript error occurred because the expected button does not exist.
  • Debug toolbar history files were not properly cleaned up.

Fixes #9504

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

Copy link
Contributor

@neznaika0 neznaika0 left a comment

Choose a reason for hiding this comment

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

All good, but HTMX creates an unlimited number of json files until a new HTTP request is executed (example F5 in browser).

@michalsn
Copy link
Member Author

michalsn commented Apr 6, 2025

IMO, this is fine as-is. The limit should only apply to "normal" requests (when we actually display the toolbar). Otherwise, we’d introduce a much bigger problem: removing a debug entry from history would be possible even though it’s still visible in the list of available data. Let’s avoid complicating things unnecessarily.

If you're using the codeigniter-htmx library, you should not experience this problem since the debug toolbar is reloaded on every request.

@michalsn michalsn force-pushed the fix/debugbar-history branch from 0de8a00 to 353c0e3 Compare April 8, 2025 06:13
@michalsn michalsn merged commit 73718f4 into codeigniter4:develop Apr 10, 2025
50 checks passed
@michalsn
Copy link
Member Author

Thank you @paulbalandan and @neznaika0

@michalsn michalsn deleted the fix/debugbar-history branch April 16, 2025 06:48
@paulbalandan paulbalandan added the bug Verified issues on the current code behavior or pull requests that will fix them label May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Toolbar is not working correctly if $maxHistory = 0
3 participants