Conversation
|
@Alistar84 At some point please rebase from master. I put a fix in for the warning emitted in the CI that makes this CI red. Thanks |
d26cba8 to
603fa1c
Compare
|
Rebased onto the latest master. Thanks for the fix! |
|
@Alistar84 Can we look in this one when you can? You will need to merge master. I am guessing the coverage dropped for this one and also I introduced new php-cs-fixer rules so run it when you can over here. |
Assisted-by: Codex
Assisted-by: Codex
Assisted-by: Codex
Harden session storage, request handling, and asynchronous history controls while preserving legacy entries and full test coverage. Assisted-by: Codex
Assisted-by: Codex
Assisted-by: Codex
603fa1c to
11b8040
Compare
|
Hi @niden, I've updated the PR following your comments about merging the latest
Co-authorship disclosure: these changes were co-authored with Codex (OpenAI), which assisted with implementation, tests, and review. |
|
@Alistar84 Thank you for this. I will check it out later tonight. It looks good at first glance but I have noticed a couple of things I need to check locally first before posting. More to come later on. |
niden
left a comment
There was a problem hiding this comment.
Some comments listed inline.
This is really good work and the main mechanics are in place. Have a look at the comments and share your thoughts on them.
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
|
Thanks for the detailed review. I have gone through all the comments and pushed the related changes. The main updates are the package-owned History endpoint, the History and filesystem contracts, versioned stored entries, PHP-driven widget metadata, independent collector settings, and the required storage path. Local checks are green: 297 PHP tests, 18 JavaScript tests, PHPStan, PHPCS, and PHP CS Fixer across all 164 files. Both new commits also include the requested Co-authored-by: Codex codex@openai.com trailer. |
|
@niden The requested changes and inline replies are now in place, and the CI is green. When you have a chance, could you please take another look? Thanks! |
@Alistar84 Thank you so much for all this work. First glance it looks great. I will go for rournd 2 later on today. |
niden
left a comment
There was a problem hiding this comment.
Some additional findings, none on the core functionality.
We will also need a revisit on the description and documentation.
Also, consider its usage. Is it on by default? If so, we need to document that.
Co-authored-by: Codex <codex@openai.com>
|
@niden I pushed The main changes are: validation now happens after the runtime gates, I refreshed the PR description/docs and added regression coverage for each of those cases. Local checks are green: 305 PHP tests (902 assertions), 18 JavaScript tests, PHPCS, PHP CS Fixer, and targeted PHPStan on the changed PHP files. Ready for another look when you have time - thanks! |
Co-authored-by: Codex <codex@openai.com>
|
Small follow-up in |
|
@Alistar84 once more thank you for this excellent work. Since we are close to the completion of this feature, I wanted to really see how this looks like. So I pulled down your branch on my local repo. Then I fired up the Vokuro application, which has the debugbar enabled by default. I copied the code from your branch in the With that and with clicking around plus an additional AI review we have a few things to address. This is how the bar shows with history on:
As you can see we have some inconsistencies there with time/memory and it is a bit tall. I took the liberty of changing a few things (diff in a follow up comment for your convenience), and it should look like this
Note that in the second picture the history does not show (I disabled it) but it will appear next to the memory. This shortens the height of the bar and removes the duplicate time/memory, thus allowing for a less cluttered UI. The findings are in the next comment |
1. History breaks app routes (boot-time service lookup)
With History on, Resolve at request time.
NOTE: Request does the same thing but has not been observed until now, since it is more common to use URI than replace Request. That will be a follow up PR - not in scope now. 2. The endpoint does not start the sessionMost Phalcon apps start the session lazily, when code resolves the The page was stored in its session directory, but The bar uses its own cookie, not the PHP session.
3. An absolute base URI breaks the endpointWith an absolute base URI (for example The JS gets Covered by item 1 (use only the path of the base URI), plus validation.
4. Dispatcher ACL plugins can block the endpointThe endpoint runs through the app's normal dispatch loop. Plugins on A dispatcher listener saw Documentation plus a public constant.
5. Indicators depend on HistoryTime and Memory show as a tab and as an indicator. The right side (two indicators + request control up to Diff for the change in the next comment
6. CHANGELOG line for the "Logs" tab name7. Memory/Time are on by defaultThey should stay on by default and we should just document this 8. No global limit on disk use
Storage strategy:
9. A new session ID hides earlier entriesThe storage key was Covered by 2 10. Dead
|
|
Diff as promised:
Diff against the PR branch (
|


Hello!
In raising this pull request, I confirm the following:
Small description of change:
This PR adds an optional, session-scoped request history system to the debug bar and integrates it with compact request metrics in the bottom bar.
It resolves #21, which describes the current limitation where the bar can only inspect the request that rendered the current page. Completed AJAX requests, redirects, and earlier requests can now be inspected without navigating away from or reloading the host page.
Closes #21.
History browser
When history is enabled, each stored entry contains the collected debug-bar payload and request metadata such as:
The rightmost request control combines a search icon with the HTTP method and URI and replaces a dedicated
Historytab. It identifies the current request when the page first loads and updates dynamically when a stored request is selected.Clicking the request control closes any open collector panel and opens the history browser. Opening a collector panel closes history, so only one panel is visible at a time. The browser provides refresh and clear controls. Selecting a request closes history and replaces the complete bar payload, including its tabs, request time, current memory usage, method, and URI.
The UI also adds a memory collector for current and peak PHP memory usage. Request time and current memory usage are shown as compact right-side indicators while the dedicated
TimeandMemorytabs remain available. Each participating collector owns its indicator metadata.Storage, retention, and performance
History storage is disabled by default and must be enabled explicitly through configuration.
Stored requests are:
Each payload has a small metadata sidecar, so listing requests does not read every full collector payload. Versioned entries without sidecars remain readable through the payload fallback. History reads clean expired entries only for the active session; rate-limited garbage collection removes expired entries, abandoned temporary files, and empty directories across sessions.
When enabled, history requires an explicit absolute writable storage path outside the application document root. It can also be disabled through
collectors.history.Internal endpoint
When history is enabled, the provider automatically registers an internal controller for:
GET /_debugbar/open- list stored request metadataGET /_debugbar/open?id=<request-id>- load a stored debug-bar payloadDELETE /_debugbar/open- clear the current session's historyThe endpoint reuses the debug bar access gate, returns private non-cacheable responses, validates request IDs, accepts only the actual HTTP transport method (ignoring method overrides for destructive actions), and excludes its own requests from history.
Backward compatibility
The feature is opt-in. Existing applications retain the current behavior when
history.enabledis not enabled.Tests
The PR includes PHP and JavaScript tests covering:
Thanks