Skip to content

[WebProfilerBundle] add a way to limit ajax request #25557

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 1 commit into from
Feb 19, 2018

Conversation

Simperfit
Copy link
Contributor

@Simperfit Simperfit commented Dec 20, 2017

Q A
Branch? master
Bug fix? yes
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #22688
License MIT
Doc PR symfony/symfony-docs#...

I need to add the doc entry and the reproducer to test that everything is ok.

@Simperfit
Copy link
Contributor Author

Status: Needs Work

@Simperfit Simperfit force-pushed the feature/add-max-ajax-for-web-profiler branch from a97f89e to d8a00a8 Compare December 20, 2017 05:31
@Simperfit Simperfit changed the title [WIP][WebProfilerBundle] add a way to limit ajax request [WebProfilerBundle] add a way to limit ajax request Dec 20, 2017
@nicolas-grekas nicolas-grekas added this to the 4.1 milestone Dec 20, 2017
@javiereguiluz
Copy link
Member

javiereguiluz commented Dec 20, 2017

I don't like adding a new config option for this not-so-important feature. What if we set a non-configurable and common sense limit (e.g. 100 requests) and when you get MAX + 1 requests, the first one is dropped and so on.

@ostrolucky
Copy link
Contributor

ostrolucky commented Dec 20, 2017

I like idea about cutting off oldest requests, rather than stopping flow of new ones

@Simperfit
Copy link
Contributor Author

@javiereguiluz I guess it makes more sens.

@ostrolucky Yes, why not I didn't think of that in the first place but it could be nice too.

@Simperfit
Copy link
Contributor Author

Simperfit commented Jan 26, 2018

@javiereguiluz so even if it's not the requested feature, is it really worth it to add this non-configurable limit ? I guess we could let it configurable, it make sense to me too WDYT ?

@fabpot
Copy link
Member

fabpot commented Jan 26, 2018

Please, don't make it configurable. It does not make sense.

@Simperfit
Copy link
Contributor Author

Simperfit commented Jan 26, 2018

So we agree for a limit like 100 requests, after that we drop the olds one to have the new one ?

@fabpot
Copy link
Member

fabpot commented Jan 26, 2018

LGTM

@Simperfit Simperfit force-pushed the feature/add-max-ajax-for-web-profiler branch from d8a00a8 to 1e21481 Compare January 26, 2018 15:14
@Simperfit
Copy link
Contributor Author

Status: Needs Review

@Simperfit
Copy link
Contributor Author

@fabpot @javiereguiluz @ostrolucky could you please review this one ?

@fabpot
Copy link
Member

fabpot commented Feb 16, 2018

It looks good to me. The current patch looks like a bug fix now. So, I would merge it into 2.7 instead of master. WDYT?

@Simperfit
Copy link
Contributor Author

I agree, let's look on what other are thinking and ill rebase it.

@fabpot
Copy link
Member

fabpot commented Feb 19, 2018

I think you can go ahead and rebase on 2.7.

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

for 2.7

@Simperfit Simperfit force-pushed the feature/add-max-ajax-for-web-profiler branch from 1e21481 to ef7bfd1 Compare February 19, 2018 14:15
@Simperfit Simperfit changed the base branch from master to 2.7 February 19, 2018 14:15
@Simperfit Simperfit force-pushed the feature/add-max-ajax-for-web-profiler branch from ef7bfd1 to 5c6e7f1 Compare February 19, 2018 14:16
@Simperfit Simperfit force-pushed the feature/add-max-ajax-for-web-profiler branch from 5c6e7f1 to 9ff86d6 Compare February 19, 2018 14:18
@Simperfit
Copy link
Contributor Author

rebased.

@fabpot
Copy link
Member

fabpot commented Feb 19, 2018

Thank you @Simperfit.

@fabpot fabpot merged commit 9ff86d6 into symfony:2.7 Feb 19, 2018
fabpot added a commit that referenced this pull request Feb 19, 2018
…rfit)

This PR was merged into the 2.7 branch.

Discussion
----------

[WebProfilerBundle] add a way to limit ajax request

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #22688
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

I need to add the doc entry and the reproducer to test that everything is ok.

Commits
-------

9ff86d6 [WebProfilerBundle] limit ajax request to 100 and remove the last one
@nicolas-grekas
Copy link
Member

@Simperfit I did not manage to merge this change into 3.4, as the JS has changed too much, please submit another PR for 3.4. Sorry about that.

@Simperfit
Copy link
Contributor Author

Simperfit commented Feb 22, 2018 via email

Copy link

@pmoubed pmoubed left a comment

Choose a reason for hiding this comment

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

This code is broken for v2.7.42

overview:1306 Uncaught TypeError: Cannot read property 'count' of undefined
at Object.renderAjaxRequests (overview:1306)
at Sfjs.load.maxTries (overview:1306)
at overview:1306
at XMLHttpRequest.xhr.onreadystatechange (overview:1306)
renderAjaxRequests @ overview:1306
Sfjs.load.maxTries @ overview:1306
(anonymous) @ overview:1306
xhr.onreadystatechange @ overview:1306
XMLHttpRequest.send (async)
request @ overview:1306
load @ overview:1306
(anonymous) @ overview:1306
(anonymous) @ overview:1306
overview:1306 Uncaught TypeError: Cannot read property 'count' of undefined
at Object.renderAjaxRequests (overview:1306)
at XMLHttpRequest. (overview:1306)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants