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

Ajax bar not working since #9dd9ebf90df #228

Closed
adrianbj opened this issue Oct 1, 2016 · 22 comments
Closed

Ajax bar not working since #9dd9ebf90df #228

adrianbj opened this issue Oct 1, 2016 · 22 comments

Comments

@adrianbj
Copy link
Contributor

@adrianbj adrianbj commented Oct 1, 2016

9dd9ebf breaks it for me. Any thoughts on why it would have stopped working? As soon as I revert to the previous commit it works as expected.

Thanks.

@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Oct 2, 2016

Browser, version, any error in console?

@adrianbj

This comment has been minimized.

Copy link
Contributor Author

@adrianbj adrianbj commented Oct 2, 2016

I have tested Chrome and Safari - no console / network errors and the css and js files are showing up in Local Storage and everything on the non-ajax bar is working correctly so those files must be being used.

@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Oct 2, 2016

Has anything changed in the headers/content of requests and responses, which it sends for AJAX bar?

@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Oct 2, 2016

(I have tested it IE 11, IE Edge, Chrome, Firefox and it works correcty, so I have no ideas whats wrong).

@adrianbj

This comment has been minimized.

Copy link
Contributor Author

@adrianbj adrianbj commented Oct 2, 2016

I have discovered that it's not all ajax requests - some still work fine with the new version of Tracy. Will see if I can figure out why some work and some don't.

@dg dg changed the title Ajax bar not working since https://github.com/nette/tracy/commit/9dd9ebf90dff48366a0c958c5311dc42e80eef68 Ajax bar not working since 9dd9ebf90df Oct 3, 2016
@dg dg changed the title Ajax bar not working since 9dd9ebf90df Ajax bar not working since #9dd9ebf90df Oct 3, 2016
@adrianbj

This comment has been minimized.

Copy link
Contributor Author

@adrianbj adrianbj commented Oct 3, 2016

Ok, I just did a little investigation and it's a problem with $contentId not being set. Obviously not the correct solution, but changing:

<?php if ($contentId): ?>

from: <?php if ($contentId): ?> to <?php if (!$contentId): ?> gets the AJAX bar working again for all calls, so I think this is probably similar in nature to: #185 but this time I am not using the database session handler and still having the problem.

Still there must be some session start/close issue that wasn't a problem prior to the mentioned commit.

@dakorpar

This comment has been minimized.

Copy link

@dakorpar dakorpar commented Oct 6, 2016

I have the same problem, not sure which commit caused it but since I upgraded to 2.4.3 I mostly don't get bar at all, when on 2.4.2 I always get bar....

@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Oct 6, 2016

@dakorpar are you talking about AJAX bar, or about whole bar?

@adrianbj if I understand you see all AJAX bars when Tracy is initially loaded via code Tracy.Debug.init(…) and only some of AJAX bars when is initially loaded via code create('script', {src: "?XDEBUG_SESSION_STOP=1&_tracy_bar=content.***"}); , right?

@dakorpar

This comment has been minimized.

Copy link

@dakorpar dakorpar commented Oct 6, 2016

@dg bar is not displayed at all for me on several project on most of the pages in 2.4.3, it works good in 2.4.2, also I noticed it's showed more often in IE then in Chrome, but still not always
I'm using newest version of nginx, php 7.0.11...

@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Oct 6, 2016

@dakorpar Wrong nginx configuration? #229 (comment)

@dakorpar

This comment has been minimized.

Copy link

@dakorpar dakorpar commented Oct 6, 2016

@dg nope, doesn't work for me even in root of domain (homepage), and I don't have error there.
Also I've set vhost try_url to your proposal, doesn't fix the problem (I restarted nginx ofc...)
this code is visible on end of the page:
screenshot_5

this is ajax request data, response is empty:
screenshot_5

In console there are only error for missing images since images are only on production server...

Maybe I should open new issue or is this maybe same problem?
All works perfectly as soon as I downgrade to 2.4.2, but in 2.4.3 does not work...
In two projects for me, in third it works...

@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Oct 6, 2016

@dakorpar Both pictures are the same.

@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Oct 6, 2016

You should see this:

HTML code

image

Or this type of HTML code, but in this case AJAX bar will not work:

image

Requests

These requests that returns javascript code (note that _tracy_bar=assets is cached in localStorage, so it is present only first time)

image

These additional requests on AJAX calls:

image

@dakorpar

This comment has been minimized.

Copy link

@dakorpar dakorpar commented Oct 6, 2016

screenshot_1
sorry wrong picture selected... this is the other one on end of page, and right away ajax request is sent I see it in network (screenshot on previous post), response is empty

EDIT: this nginx try_files edit actually fixed one project, but my first main one still has this issue even with this config and only in 2.4.3

@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Oct 30, 2016

@dakorpar @adrianbj Have you found a reason why it does not work? Where it differs from what I've described here #228 (comment)? This works #229 (comment)?

@dakorpar

This comment has been minimized.

Copy link

@dakorpar dakorpar commented Oct 31, 2016

I believe it's working now for me, although I'm not sure why.

@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Oct 31, 2016

So can I close it?

@adrianbj

This comment has been minimized.

Copy link
Contributor Author

@adrianbj adrianbj commented Oct 31, 2016

Sorry for the silence here - been busy and then away on vacation. Just catching up with things now. I'll try to update in the next couple of days, but I do think there is still a problem - I will try to narrow it down to something reproducible for you.

@adrianbj

This comment has been minimized.

Copy link
Contributor Author

@adrianbj adrianbj commented Nov 2, 2016

It seems like it's an issue of the scripts not being loaded from local storage in time for document ready. All user initiated ajax calls work fine, but not those called automatically.

If I add a timeout of about a second then ajax calls made inside $(document).ready also start working, eg:

$(document).ready(function() {
    setTimeout(function(){
        ProcessPageListInit();
     }, 1000);
});

but without the timeout, the AJAX bar (and the redirect bar) don't ever load.

Hope that helps.

@adrianbj

This comment has been minimized.

Copy link
Contributor Author

@adrianbj adrianbj commented Nov 8, 2016

@dg - is that extra info enough for you to track down, or do you need more? I have to admit I don't really understand why the main bar is loading and the ajax one isn't, but that timeout makes all the difference. The version prior to that 9dd9ebf commit works fine without the timeout.

@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Nov 9, 2016

Currently I don't have free time, I'll look at it later.

@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Dec 7, 2016

So problem is related to ajax calls called inside document-ready, now I understand. In this the previous and current versions are really different, I'll try to find a solution.

@dg dg closed this in b75b1c5 Dec 7, 2016
dg added a commit that referenced this issue Dec 7, 2016
JS is now loaded synchronously so Tracy is loaded before DOMContentLoaded.

This reverts commit 9dd9ebf.
dg added a commit that referenced this issue Dec 7, 2016
JS is now loaded synchronously so Tracy is loaded before DOMContentLoaded.

This reverts commit 9dd9ebf.
dg added a commit that referenced this issue Dec 7, 2016
JS is now loaded synchronously so Tracy is loaded before DOMContentLoaded.

This reverts commit 9dd9ebf.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.