Child pages
  • [debugger] In-Portal Debugger Improvements [5.3.0-B1]
Skip to end of metadata
Go to start of metadata

Historically the debugger component of In-Portal (one that is shown on F12 press and has yellow/pink reports) was built to be independent from In-Portal core:

I think that we should make it more In-Portal friendly by:

  • moving out debugger into separate namespace
  • extracting profiler component out from debugger
  • include jQuery from CDN when jQuery variable not present on a page instead of duplicating code locally
  • store debugger runs in database for easy management
  • record several debugger runs per page (main page + all ajax requests)
  • unique request key is GET+POST+URL+REFERER (for ajax requests)
  • associate ajax requests back to main page from which it was made so we can see whole requests together
  • don't delete debugger report after it was viewed
  • redesign debugger UI to allow seeing ajax request reports as they are created
  • create separate sections in debugger for following (see below) instead of mixing all together:
    • error/warning/notice
    • request data
    • external requests (curl, db, memcache)
    • other

Basically we're going into Phabricator-alike DarkConsole tool:

Related Tasks

1 Comment

  1. While looking at http://symfony.com/blog/new-in-symfony-2-6-ajax-requests-in-the-web-debug-toolbar I've found a solution (see https://github.com/symfony/symfony/blob/2.8/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig#L203-L248) on how we can track all AJAX request made on a page without changing a lot in AJAX request itself:

    1. in debug mode only, when debugger report is saved to database (e.g. in DebuggerReports table) set "X-Debug-Request-Id" header with ID of request in DebuggerReports table
    2. in JS on main page (as part of Debugger JS class):
      1. add listener1 method via "ajaxSend" method of jQuery (see https://api.jquery.com/ajaxSend/) to allow tracking each created AJAX request
      2. in listener1 increment number of tracked request on the page and set listener2 via "jqXHR.aways" method of jQuery (see http://api.jquery.com/jQuery.ajax/#jqXHR) to know, when AJAX request finishes
      3. in listener2 get the "X-Debug-Request-Id" header value of response and add link to viewing that AJAX request-specific debugger report

    As a bonus feature that would allow to have AJAX-request counter in debugger toolbar, which is updated in real-time, like done in Symfony.