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

Deprecated synchronous XHR requests rewritten to async #8242

Closed
wants to merge 2 commits into from
Closed

Deprecated synchronous XHR requests rewritten to async #8242

wants to merge 2 commits into from

Conversation

barbushin
Copy link
Contributor

Fixes #8020

It's the same as #8205 but excluding changes in /tests/javascript/index.php and fixed widgetMenu.js.

@tsteur tsteur added this to the 2.14.1 milestone Jun 29, 2015
@tsteur tsteur added Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Jun 29, 2015
widgetsHelper.getAvailableWidgets = function () {
widgetsHelper.getAvailableWidgets = function (callback) {
if(!callback) { // @deprecated
return this.getAvailableWidgetsSync();
Copy link
Member

Choose a reason for hiding this comment

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

I reckon we don't have to be backwards compatible here, it's not really a public API or so unless some of our code still uses it

@@ -74,6 +74,7 @@ function ajaxHelper() {
/**
* Should ajax request be asynchronous
* @type {Boolean}
* @deprecated Synchronous XHR requests are deprecated(see http://xhr.spec.whatwg.org)
Copy link
Member

Choose a reason for hiding this comment

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

We should definitely mention this in https://github.com/piwik/piwik/blob/master/CHANGELOG.md under "Deprecations". We should also mention that we will remove it in Piwik 3.0. I created follow up issue #8246

@tsteur
Copy link
Member

tsteur commented Jun 29, 2015

I tested them seems to work apart from one, nice!

  • Remove dashboard seems to not work anymore (Chrome 43 on Mac)

I have a few comments but they are not necessarily related to this PR, I'm not sure. We could create a follow up issue for this. Same of those issues might have existed before.

  • Eg when going to "Admin => General settings" and clicking "Save" (or Sites Management add/edit site or Users Management edit user) it could be nice to change the "state" of the button and use a wording like "Saving" and making the button disabled while the saving is in progress. We recently changed this in the Core Updater as one didn't know whether it is actually doing something or not. It was not really a big issue before as the requests were sync and one couldn't do anything while they were in progress
  • When clicking "Save" in "Admin => Plugin settings" it shows "Loading data..." above the "Save" button for a short time. When deleting a user it shows "Loading data..." for a short time as well. Also when pressing "Save" in Personal Settings.

I noticed some more problems but they seem not related to this change: #8245 #8246 #8247

@tsteur
Copy link
Member

tsteur commented Jun 29, 2015

It's nice to have everything async!

@barbushin
Copy link
Contributor Author

@tsteur Thank you for that review! I removed deprecated methods and notices. Also I checked #8245 and #8247 and all of them was reproduced on master, so it looks like they are not relative to this Pull request. Anyway, I submited pull requests with fixes for this issues.

@tsteur
Copy link
Member

tsteur commented Jul 1, 2015

Sweet. Did you have a look re removing a dashboard? Does that work for you?
I will create issues for my other 2 points as they are a problem in general and not really relate to this PR

@barbushin
Copy link
Contributor Author

Do you mean remove widget on Dashboard?
image Looks like it works without any bugs.

@tsteur
Copy link
Member

tsteur commented Jul 2, 2015

Sorry I meant removing an actual dashboard. This can be done in the "Dashboard & Widgets" selector in the bottom left.

@barbushin
Copy link
Contributor Author

I've created new dashboard, and removed, and it works http://i.imgur.com/y9Hs1RF.gif

@tsteur
Copy link
Member

tsteur commented Jul 5, 2015

For some reason it works for me too now. Cannot reproduce it anymore... Good to merge after 2.14.0 release

@tsteur
Copy link
Member

tsteur commented Jul 6, 2015

Actually the Dashboard UI tests are failing, maybe because of this change?

@mattab
Copy link
Member

mattab commented Jul 12, 2015

Actually the Dashboard UI tests are failing, maybe because of this change?

I've restarted the build to check this can be reproduced. If the tests still fail then it's an issue either with the UI tests, or the PR?

@barbushin
Copy link
Contributor Author

I don't undestand how to see/reproduce UI tests failure. I see links in UI tests results:

View UI failures (if any) here:
http://builds-artifacts.piwik.org/ui-tests.master/13864.7/
or: http://builds-artifacts.piwik.org/ui-tests.master/13864.7/screenshot-diffs/diffviewer.html

But it does not works.

@mattab
Copy link
Member

mattab commented Jul 13, 2015

@barbushin it looks like our screenshot uploader / UI test viewer is buggy for pull requests done in branches outside of Piwik/piwik (it works fine for PR done by core team members).
can you create a bug report here so we don't forget to fix this issue?

To workaround, could you try to re-create PR on the piwik/piwik branch and then maybe it works then?

Btw are you able to run UI tests locally and reproduce the UI test failure locally?

@tsteur
Copy link
Member

tsteur commented Jul 13, 2015

FYI I created https://github.com/piwik/ui-tests-viewer/issues/11

It should be good to merge but can't see why tests fail. Should ideally only merge when tests are green.

@mattab mattab modified the milestones: 2.14.1, 2.15.0 Jul 16, 2015
@barbushin
Copy link
Contributor Author

@mattab I re-created PR from piwik/8020_xhr_sync_fix branch. There are same UI Tests failing, but it looks like the problem is not in PR code change. Please take a loot at the comments there #8381 (comment)

@mattab
Copy link
Member

mattab commented Aug 13, 2015

Duplicate of #8381

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants