Fixed #8936 -- Added view permissions and a read-only admin [rebased]

Hi,
This is just a rebase of https://github.com/django/django/pull/5297
The only difference (besides fixing the merge conflicts) is that ModelAdmin.declared_fieldsets doesn't exist anymore and was replaced by get_fieldsets.
Thanks,
Olivier

@olivierdalang it would be great if you could fix the flake errors.

@auvipy Ok I think flake errors are fixed (hehe didn't know about this tool)

@auvipy I made the changes, thanks for the detailed review ! (and sorry for the mistakes, it's my first contribution to django)

No worries!! you did some very well!!!

buildbot, test this please.

The test failures are:
admin_views.tests.UserAdminTest.test_user_fk_change_popup
admin_views.tests.UserAdminTest.test_user_fk_delete_popup

Did you fix https://github.com/django/django/pull/5297#issuecomment-234072204?

Hi,
It seems these tests fail because of a newline in the template (to comply with flake) :
self.assertContains(response, 'class="related-widget-wrapper-link change-related" id="change_id_owner"')

AssertionError: False is not true : Couldn't find 'class="related-widget-wrapper-link change-related" id="change_id_owner"' in response

while this appears in the template :
        <a class="related-widget-wrapper-link change-related"
            id="change_id_owner"

An easy fix is to add the line break in the test, but this will fail again if the template gets changed. I see there's the html parameter to assertContains, but it doesn't seem to work with partial match (the test only tests for the class and the id attribute, it doesn't match since there are also a data-href-template and a title html attributes.

I don't have a strong opinion about how to fix that.

Hi,
I made the changes :

missing space & flake8
failing tests (I just added the line break in the tested string, it's not very elegant but I don't see how to do it without making the test case too complex)
https://github.com/django/django/pull/5297#issuecomment-234072204 including another edge case when the inline has view and delete permissions

I intend to squash those latter commits if they look good to you.
I suggest closing #5297 to avoid having comments at different places.
I removed the patch needs improvement flag on the ticket. Let me know if I can do anything more for this !

There's a failing test, but it looks like it's travis fault : FATAL: Could not checkout ea3c082f7160685ab0c8215745dd191e0a85424c
Any way to restart the tests ?

Rebase so the patch merges cleanly and squash commits (in general, there's no need to push incremental commits for minor changes; just squash right away). Of course with a patch of this size, after someday reviews the patch the first time , it might be useful to push incremental changes so they don't have to recheck the entire patch again.

This will be a nice addition to the Django Admin. Can't wait to see it!

Ok I think the PR is ready !

We've been testing this in our own admin site and found a couple of things:

using prepopulated_fields with view only permissions fails (tries to access a field which doesn't exist on the form due to excludes).
using custom admin forms with form fields that only exist on the form fails (label_for_field issue).

I'll try and write a couple of failing test cases.

Hi. It's awesome PR and I tried it with my existing web app and existing database..
My question is how can I migrate from existing database?
As the Options.default_permissions doc said here, old existing apps can't use this new feature.
I tried recreating the database and tried this feature, It worked with my app.

@hirokiky: I see no reason why old existing apps cannot use this feature - the note states that backwards compatibility is maintained by ensuring that having a change permission also implicitly means that the user has the view permission for the same model. This is to avoid loss of access to pages in the admin site when Django is upgraded because users would not have the new view permissions by default. After upgrade change permissions can be removed and view permissions added as required. (It also rarely makes sense to be able to change something but not view it!)

@pope1ni Yes. Admin pages can be seen for existing users.
But with migrated DB, I can't apply Can view <model> for users. there isn't any Can view <model> permissions at change users page on admin.
The reason is that there aren't any Can view <model> permission on Permission model.

Any chance this feature will end up in Django 1.11? Not too much time left, right?

1.11 is already feature freez

New features aren't allowed after the alpha release, see https://code.djangoproject.com/wiki/Version1.11Roadmap.

Hi all,
@pope1ni Thanks a lot for the detailed review. I made some of the changes (the easy picks).
I didn't do the initial implementation  Do you think there could be a better solution than get_uneditable_fields() ?
So here's the todo list to get this ready, am I missing something ?

[ ] Fix problems reported by @slurms  (@slurms, can you provide the tests ?)
[ ] Make it clear what to do to deal with old apps so that the view permission is created (@timgraham, any pointer on this ? I kind of naively thought the permissions would be created with migrations)
[ ] Explain get_uneditable_fields in the code (@PetrDlouhy , since you did the initial implementation, could you help me on this ? thanks again by the way)
[ ] Rebase on master

Just a disclaimer : this is my first serious contribution to django, so reviewers please don't assume I'm exactly knowing what I'm doing
Let's hope it will make it into Django one day :)

Ok I just rebased, it was less painful than expected.

[ ] Fix problems reported by @slurms  (@slurms, can you provide the tests ?)
[ ] Make it clear what to do to deal with old apps so that the view permission is created (@timgraham, any pointer on this ? I kind of naively thought the permissions would be created with migrations)
[ ] Explain get_uneditable_fields in the code (@PetrDlouhy , since you did the initial implementation, could you help me on this ? thanks again by the way)
[X] Rebase on master

@pope1ni thanks for the detailed review. I made all changes about style improvement and am starting to look into the three good questions you ask

@olivergeorge Thank You for pushing this forward. The uneditable_fields are fields, that user can't edit either because he doesn't have permission or their edition is forbidden by admin settings. With introduction of view only permissions we need to be able to display all fields in read only mode.

@PetrDlouhy Thank you for the initial work on this improvement. I have had time to think about this a little.
My main objection to the addition of uneditable_fields is that it seems exactly the same as readonly_fields, just reworded. Essentially if the user does not have permission to add or change (depending on the context) we really just want to dynamically append to readonly_fields for that request.
This could be achieved overloading get_readonly_fields with the permission checks although we would have to ensure that users who overload that themselves call super(). Alternatively there should be a private method/property that is used in place of get_readonly_fields, calls get_readonly_fields and then extends the result based on the permissions. This output can then be passed on down the chain to inline forms, etc.
My second problem is that the uneditable_fields argument / property and get_uneditable_fields method currently look as though they would be exposed as public API and this would confused users as the readonly_fields stuff exists already and this is really only intended to allow this new view permission to work.
My third issue is that uneditable_fields and readonly_fields are currently being passed around interchangeably which feels wrong and error-prone.

We have implemented a detail view in a different way.
We have added detail_view method to model admin and a different template. Properties fields_detail and fieldsets_detailand methods get_fields_detail and get_fieldsets_detail to define fields and fieldsets. View permission and has_view_permission have been added as well. Wouldn't this approach be better approach? We are willing to share the code.

@ryselis: What you suggest seems like a lot of copy and paste to provide a second copy of code used soley for the view-only case which is not going to be acceptable. If I am wrong feel free to comment with a link to a branch with your proposition.

@pope1ni  It depends. We have used detail view for 2-3 years and at least for us it has diverged from the change view. Main differences:

we have implemented tabs instead of inlines. They are not just read-only inlines placed in tabs. They work more like mini changelists. Assume this data model: inquiry is the base model, commercial offer has a FK to inquiry (one inquiry may have multiple commercial offers) and commercial offer has its own inline model commercial offer item. There is no way to put commercial offer as inline in inquiry admin because it needs its own inlines, but it very reasonable to have a list of related commercial offers in inquiry detail, and with custom fields as well, like total sum of all items.
different fields are needed in change and detail forms, it is reasonable to show images and even charts there
different buttons are needed in change and detail forms

Basically detail view is a blend of change form and changelist view for single item with additions - at least for how we are using it.
I have hacked a detail view from our project into django so that you can see how much code would need to be duplicated. This code is not tested with unit tests and stripped to a minimal example. If we decide that this approach is acceptable, I will write tests and make the code more beautiful.
Here is the branch with the code, forked from master.
We use a form under the hood to allow editing some fields from detail view - this might not be the best idea, it could be changed to something else.

Hello everyone,
Someone wrote this project: https://github.com/vint21h/django-read-only-admin
I don't know if it can help you but it might be worth sharing it.
Have a great day!

Hello everyone,
How far is this feature from being merged?
I'm hoping to see it in Django 2.0.  If someone could give me some direction, I'd be happy to help.

Hi,
From my point of view, this is ready to merge.
I think @slurms problems happens because he has setup some custom admin forms, so when the form is read only, he tries to access inexistant fields. I don't think this should be considered as a bug, but it's true that with read only admin, the read-only case must now be considered when using custom forms. I wrote some notes about that in docs/release/2.0.txt.
@viktor25 If you want to help make this into 2.0, please test the branch with your projects to see if you have issues and review the PR.
Also I will update the ticket to remove "patch needs improvement", so that it should be picked up by @timgraham (forgot about that last time :) ). Tim please let me know if there's anything more I can do to get this into 2.0.

Hi @olivierdalang. I'll try to review this again sometime this week.

I tested with my projects, here are the results.
Regressions:

JSONField with value [1, 2] is shown as 1, 2 instead of [1, 2].  JSONField with value [] is shown as empty.
Geographic locations do not display on a map.  (Model with a django.contrib.gis.db.models.PointField, admin model inherits from django.contrib.gis.admin.OSMGeoAdmin)
A ManyToManyField with lots of values displays as a wall of text.  It should display as a limited-size scrollable container.
A foreign key in raw_id_fields should be displayed as a link to the foreign object.

Suggestions:

Related to point 4 above, it would be useful if any foreign relation is displayed as a link to the foreign object.  Including foreign keys not in raw_id_fields, and including many to many fields.
Fields with editable=False (e.g. DateTimeField with auto_now=True) are not displayed in the change form, because they are not editable.  But being editable does not matter if I have only view permission.  So let's show non-editable fields.
Use different URLs for viewing and for changing an object.  I will write a separate comment about the benefits of this.

This is about my last suggestion, using different URLs for viewing and for changing an object.
At the moment, the object list page is at /admin/app/somemodel/, and the object details page is at /admin/app/somemodel/123/change/, no matter whether I have change permission or not.
I think we should have two other URLs for read-only mode.  For example /admin/app/somemodel-view/ and /admin/app/somemodel-view/123/change/ (but feel free to suggest alternative URLs).
Pros:

Allows looking at an object details in read-only mode even if I have change permission.  Most of the time when I use the admin, I only look for information, without changing anything.  And the read-only page can potentially become a lot better than the change form, because the change form needs to use input widgets, while the read-only page has no such restrictions.
If we release Django 2.0 with the current behaviour, it will be more difficult to change it in the future because of backwards compatibility.  It is usually easier to switch from multiple URLs to a single URL than to switch from a single URL to multiple URLs.

Cons:

The change list page is at /admin/app/somemodel/ , and there is no obvious nice-looking way to construct a view-only URL from this.  We cannot use /admin/app/somemodel/view/ because it might conflict with the details page for an object with primary key "view".

I'm happy to do the work for this myself it people agree with the idea.  @olivierdalang @timgraham

@viktor25 Thank you for the review. I don't really mind about URLs, but did you think of the case where the user has read only permissions on the main model, but has add/edit/delete permissions on inlines ? In such case, the distinction between view/change is less clear.
About the regressions you mention, don't they happen as well with regular read-only fields ? If so, I think they are a different (but still very valid) issue and this would deserve another ticket/PR.
I would very much love to see this PR merged for 2.0. Unfortunately, I have almost no time available to work on this in the upcoming weeks, so if you have some time available on this, it would be awesome if you're ready to care of eventual additional change requests.

Hello all,
Thanks for all your work on this! I'm working on this with @viktor25, and we're keen to get this into Django 2.0. The freeze date is 18th Sept. We'll try to be ready with our changes by early next week.
Regarding @viktor25's regressions: it's true that the page with view permissions displays the same as if the fields were read-only, so you are correct that should be on a different ticket.
URLs: @olivierdalang, that's a good point. The solution we've thought of is that there should be a view page where you can only view (including the inlines) and, if relevant, a change page, where you can change only the things you have permission to change(e.g. some inlines). This means on /admin/model/ there would be both links to 'Change' and 'View' if you have change permissions and view permissions, or if you have only view permissions but you have change permissions on the inlines. There will only be 'View' only if you have view permissions on the model and don't have change permissions on any inlines.
When the admin has prepopulated_fields, I'm seeing the same error as @slurms. I'll try to make the view page ignore prepopulated_fields.
I think it does make sense to show editable=False fields when you have only view permissions, so I'll work on that too.

Regarding uneditable_fields, I agree with @pope1ni's criticisms and I'm also concerned that it sounds a lot like a field with editable=False, which is treated differently by django's admin (e.g. it's not shown if you have change permissions). I could just change the variable used in django/contrib/admin/options.py from uneditable_fields to readonly_fields but it would look strange that I'm not using get_readonly_fields(), which I don't really want to edit.

@FingalP I removed uneditable_fields altogether (see https://github.com/django/django/pull/6734#issuecomment-310147322) so this shouldn't be a problem anymore.
For me, different view and edit pages is a 👎. I don't really see what problem it solves. The conceptseems a bit flaky (you have a different view depending on permissions on inlines). And your last suggestion about showing uneditable fields anyway seems wrong to me (I think most of the time, uneditable fields are used for technical fields such as timestamps).
I suggest waiting for some more opinions before going this way.

Thanks for your comments @olivierdalang. That's good to know about uneditable_fields.
Sorry I wasn't clear about the aim of my comments. The problem which I'm trying to solve is to allow a user with change permissions and view permissions to access the 'view' page, because this can be made loads easier to navigate around and see relevant info, thanks to not having to have input widgets. I get the impression @ryselis has similar concerns for their 'detail' view, allowing for images and charts - and similar implementation, with a separate 'detail' view function. Their tabs idea, for example, would also be possible only if we separate the URLs now, as this would be difficult later otherwise.
You're right we need to make the concept less flaky. Instead of showing different things on the 'view' page depending on the inline permissions, we could just have:
One view page, on which everything is readonly, including inlines (I think fully view-only functionality makes most sense here), but the relevant inlines have links to their change pages,
One change page, on which the model itself can be changed, and any inlines with permission can be modified - i.e. the same as Django's current change page.
This is different to the current behaviour, where the changeform page without change permissions allows you to modify any inlines which you have permission for. I believe the potential reduction in functionality can be fixed by linking to the relevant change pages.
I get your point about editable=False fields, thanks for clarifying. I'll leave them as they are.

@olivierdalang I've made the changes I suggested in my last comment, after taking your comments on board. I think I don't have permission to push to this PR (I'm new to GitHub so I'm not sure how this works) but I've made a fork of Django and pushed my current branch here: https://github.com/FingalP/django/tree/view_permission_master. I believe a lot of the rest of the code can be tidied up now that it is mostly contained in the viewlist_view and viewonly_view, though I haven't done much of this yet.
We have less than 2 weeks until the freeze date for Django 2.0, do you know what the next steps are?

Hi,
is there any progress on this? Any words from the Django devs? I'd think that this is one of the most-wanted features and it's basically in useable shape.

Argh some failing tests again. I just posted to ML to see whether they're willing to merge this at some point. If so, I'll try to fix the issues in the upcomming days.

Hi Olivier,
I'd be happy to help try and move this forward again. The consensus on the ticket seems to be that this is accepted, so, assuming there is a PR in a state that is ready to merge in sufficient time before a release, it should be merged. According to the roadmap for 2.1 this means that we have until early May 2018 to get this in shape.
It looks like (all of?) the tests are failing with the following error:
AttributeError: 'WSGIRequest' object has no attribute 'user'

Seems like some issue related to authentication middleware or middleware ordering at a quick guess?
Here is a checklist of things that need to be done:

[ ] Rebase the branch on top of  master.
[ ] Fix any obvious failures due to changes in 2.0
[ ] Perform thorough manual testing of the feature.
[ ] Check the documentation and release notes are correct.
[ ] Provide a documented upgrade path to create missing view permissions.

@pope1ni Thanks for the comments. I fixed (I think) the release notes according to your comments.
About the failing tests, it seems they happen because there was some refactoring in ModelAdmin (get_changelist_instance()) which presupposes the change permission is there, while now user permissions must be checked to see if the user has the change permission.
I don't think testing get_changelist_instance with no user makes sense, as contrib.auth is required for contrib.admin, so I fixed the tests by attaching an user (superuser) to the requests.
Is this correct ? I'm not sure it's OK yet since tests didn't run for my last commit, any idea on how to force tests to run again ?

I'd suggest to everybody interested in getting this PR merged to test it (on your projects) and if it works well to make some noise on the ML (maybe in that thread : https://groups.google.com/forum/#!topic/django-developers/WSTQgEo8tHQ seems my voice alone didn't have much effect :) ).

@olivierdalang As far as I can tell, a user with change permission cannot choose to "view" an object - they will always see a form.  Is there a reason for that?
It is important to be able to see the read-only page even if one has change permission, because long-term the read-only page will be more helpful than the form.  For example, the form shows foreign keys as dropdowns, while the read-only page could show them as links to the foreign object.  The read-only page is not constrained by the need to show input widgets, so it is more powerful for visualizing information.

@viktor25 See my comment about the rationale for using forms even for the "view" permission.
I'd even add that if we move away from the "admin form" view, I think it won't belong in django.contrib.admin anymore. "View" permission without "change" permission is still meant for staff members. Having different layouts for view permissions would be very confusing for row-based permissions for instance.
I don't know what other think about this ? I don't know how to settle this question, maybe a django core dev could step in ?
And about how read-only fields render (applies to your last suggestion for foreign keys and previous regressions reports), I think some improvement can be done, but as I said, I think this is a different issue (it also applies for regular read-only fields with change permission).

I personally think having separate view and change pages is out of scope and would be much bigger change. If they have edit ability, they should see a form.
"For example, the form shows foreign keys as dropdowns, while the read-only page could show them as links to the foreign object. " - The change page already has links to the foreign object (though maybe that's not obvious enough?)

@olivierdalang

See my comment about the rationale

From that comment:

I don't really see what problem it solves.

The problem is that when you only want to view data, input widgets are inefficient (in terms of what kind of information they can show, how much space they take on the page, etc).  A textarea always takes up a minimum amount of space, even if it is empty.  A many-to-many field with filter_horizontal takes a lot of space even if you only have one or two selected foreign objects.  I'm sure that there are more such examples.  So it makes sense to be able to view an object without all those input widgets getting in the way.

The concept seems a bit flaky (you have a different view depending on permissions on inlines)

In the view page all inlines would be read-only.  What is flaky here?

And your last suggestion about showing uneditable fields anyway seems wrong to me (I think most of the time, uneditable fields are used for technical fields such as timestamps).

I think it makes more sense to show timestamps because, like you said, the admin is meant for staff members, and timestamps could be very useful for staff members.  I thought that timestamps were not shown in the form just because they cannot be edited.  But if you prefer not to show timestamps (and other uneditable fields), I'm fine with that.

@olivierdalang

if we move away from the "admin form" view, I think it won't belong in django.contrib.admin anymore

Why not?  Viewing data seems like an important part of what an admin interface does.

Having different layouts for view permissions would be very confusing for row-based permissions for instance

If by "different layouts" you mean, for example, different field order, then I have been unclear in what I am suggesting.  I am not suggesting changing the layout in the view page.  I imagine that the view page would look exactly like the change page looks if the user has no change permission.
Actually I like your example about row-based permissions.  If we don't have separate view and change pages, then opening two different records of the same model might show one as a form and the other as a read-only page.  But if we have a separate view page, the user can choose to view the two records, and then they will both be shown as read-only pages.  So having a separate view page would be less confusing in the case of row-based permissions.

And about how read-only fields render (applies to your last suggestion for foreign keys and previous regressions reports), I think some improvement can be done, but as I said, I think this is a different issue

You are right that improving the read-only fields should be part of a different issue.  But you are now laying the "architecture" (for lack of a better word) for how the admin works, so choosing an architecture that makes future improvements possible is part of this issue.

@collinanderson

would be much bigger change

The view page can be exactly the same as the change page, except that instead of checking for change permissions, the view page pretends that the user has no change permissions for anything.

The change page already has links to the foreign object

I don't see them in 1.11, maybe they landed later.  But foreign keys were just one example.  Here are some other examples of how read-only widgets can be more useful than form widgets when one doesn't need to change data:

JSON fields can be displayed as collapsible trees
Empty text fields do not need to take up a whole textarea's worth of space
Datetime fields don't need to take two lines each if we don't need to show date/time pickers
Many-to-many fields currently either show all objects in the foreign table (which breaks if the foreign table is big) or just show the ids of the selected foreign objects.  A read-only many-to-many widget could show the string representations of just the selected objects.

The point is that there are many, many things that are easier to implement in a read-only fashion.  Implementing them is out of scope, but choosing the right architecture (for lack of a better word) surely is in scope.

Is there a chance that this goes into Django 2.1?

@timgraham This PR is getting very old... Are you willing to merge it ? If not, can you please let us know why ?  If yes, I'll resolve conflicts and squash commits.

The scope is just so huge that I haven't had time and motivation to give it a detailed review. Any mistake where the permission isn't appropriately applied could be considered a security issue. If another trusted reviewer does a comprehensive review of this, I'll probably be able to take a second look before the May feature freeze deadline for 2.1.

Just again a reminder to not forget about this issue. I think this is a feature which many people would like to have in django. It would be a pity to not have this in the next release as it actually seems to be pretty mature/finished.

this will need more work before final review and merge so it would be great to fix them first

It would be great to provide a list what needs to be fixed. So working on this topic could be continued and finished in time?

Here is a checklist of things that need to be done:
Rebase and squash the branch on top of master.
Fix any obvious failures due to changes in 2.0
Perform thorough manual testing of the feature.
Check the documentation and release notes are correct.
Provide a documented upgrade path to create missing view permissions.
this was the list I found

I will, please go ahead after that two official django fellow can

I will do manual tests as i want to use this in my project any way :) Would love to see this in the next release.

Hmm, it seems that the priority of this issue is too low to get one of the needed reviewers working on this... :(

Hi @olivierdalang. As the backlog clears, this has just popped onto my radar. Thank you for your extended effort here. 🙂

I can do the squash+rebase (including fix for 2.0), but am only willing to do so after I get confirmation from another trusted reviewer that he'll review to PR before next feature freeze.

If you can rebase, and make the other edits, I will review this over the next week. So, assuming there are no more blockers we should be able to make the next deadline.
(What a monster of a ticket! 👾)

@carltongibson Thank you very much for looking into that !
I just squashed & rebased on master. There was no tricky conflict, but some new failing tests.
I'll try to fix them. I think it's just because it can now happen that ModelAdmin.get_actions gets called even if there's only the view permission (when displaying the changelist), so it has now to check for user's permissions.

Hi @olivierdalang
Some preliminary comments. More to follow.

First off, can you please tick "Allow edits from maintainers"? 🙂
(I've got some small edits I'd like to push. Let's add incremental changes just now, and squash at the end.)

My initial manual testing is all positive. Installation is fine. Create a user with view-only permissions, browse: all is as expected. So thus far: :+1:
(More to come here though: I need to check more complicated variations, both for correct-permissions-behaviour and exact button text etc.)

Provide a documented upgrade path to create missing view permissions.

This is ≈a-non-issue. Running migrate (even for a single app) causes the post_migrate signal to fire which runs create_permissions, which creates the new view permissions (for all content types).
Notes saying:

Run django-admin migrate, and...
Update default_permissions (if overridden)

... should be sufficient. (@olivierdalang can you think about those for 2.1.txt?)

@carltongibson - probably also worth noting the possible backward incompatibility if anyone has added their own view permission to default_permissions?

@pope1ni Yes. Good one. (Although I wonder, if they’d set default_permissions and actually called it view, it might just work... need to check)

it might just work...

Undoubtedly, yes. It is more the case that a permission they may be expecting to serve some specific purpose of their own now provides access to something else.

Thanks for the detailed review !!
I'll try to find some time next week to deal with them.

I made some progress on this.
I still need to address the refactoring of the tests cases, and to address https://github.com/django/django/pull/6734#discussion_r184187921 but for the rest, it should be good.
I hope I didn't miss any comment, this whole PR is getting quite confusing :-)
I left everything as separated commits to facilitate review but of course will squash.
Thanks again for your excellent inputs !!

Hi @olivierdalang. Thanks for the effort.

... this whole PR is getting quite confusing :-)

Yes. And there are so many comments now that it's taking (me at least) multiple refreshes to load.
(Maybe we can move to one final PR once the current batch of comments are addressed.)
It looks to me as if there are a number of comments not yet addressed. Please take the time to make sure each one is handled. (I don't think we're far off now. 💃🏼)

Another round done... I hope I didn't miss anything.
Those may need some additional review (not always sure of the amendments, mostly about test case style) :
https://github.com/django/django/pull/6734#discussion_r183990584
https://github.com/django/django/pull/6734#discussion_r184004926
https://github.com/django/django/pull/6734#discussion_r184005164
https://github.com/django/django/pull/6734#discussion_r184052087
https://github.com/django/django/pull/6734#discussion_r184561811
Hehe I'll make sure to have a bottle of champagne ready for when this gets merged (if it gets merged) !!

Hi @olivierdalang.
Thanks for the super effort here!

...when this gets merged (if it gets merged) !!

It should get merged. It works. And it's been a long-time on the wish list. We just have to cover all the bases.
Thank you for all your edits. I'd gone through. It looks like you've addressed each point. As such I've squashed and rebased the PR.
Of the outstanding points:

Don't worry about the refactorings, e.g. post_data vs self.post_data and the row-level permissions tests. We can address those separately. (They're not directly relevant.)
You're correct, the history_view is read-only, so removing the comment about changes is correct.
Given that it affected the query sets elsewhere, I reverted the alfred change. We'll keep using alfred, and the comment there.

@pope1ni: I looked at the add only permission case. Here from the create form, the instance is created and then you're redirected back to the app_index, where you can chose the Add button again. @olivierdalang updated the button text so I think your query is resolved. Can you confirm?

@carltongibson @pope1ni
Thanks again for your involvement in this. Should I squash the commits already ?
Let me know if there's anything else I can do...

Hi @olivierdalang. Sorry for the delay: I was away.
I squashed and rebased last week, so nothing to do there.
I've marked this as Ready for checkin on the ticket. Tim will have a look next: it's a big patch, with potential security issues, so it justifies another review.
Tim, with fresh eyes, will likely make a few more suggestions. I think we've gone over the main scenarios well enough (POSTing data, accessing inlines etc) so hopefully these will just be minor. On that assumption we should be able to get it in. 💃🏼 (But lets await Tim's review.)
Thanks for your super effort here. This has been a long time on the wish-list!

Great ! I just redid the commit so that it's properly attributed to @PetrDlouhy (original author) and me.
I see there are now failing tests, it looks like a git related glitch because there's no change in the code.

Will this get accepted for the feature freeze (which seems to be today)?

Hi All. I tried this out and it seems to work as expected for me.
One point of feedback, feel free to ignore if you want: I think the button "Close without saving" is a little confusing. It's not like you would ever have any changes that will get discarded, right? Maybe we could say "back to list page" (or have no button at all)?
In any case. This is awesome. Thanks so much!

I changed that to say "Close" in my edits that I haven't pushed yet.

Yeaaah !!! Finally :D
Thank you all !!!

Do you have time to add additional tests as described on the ticket?
On Wed, May 16, 2018 at 6:59 PM olivierdalang<EMAIL_ADDRESS>wrote:

Yeaaah !!! Finally :D
Thank you all !!!
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/django/django/pull/6734#issuecomment-389692026, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAZI3UoXP9AwxjAWfeK46a5dxmTR558-ks5tzK88gaJpZM4IvDfv
.


only look for top level apps and those directly under apps/ or lib/

Before this change improperly structured projects would "work". Some tests actually relied on this improper structure -- an app defined in a subdirectory of root but not under apps or lib -- so those tests have been updated as well.

This is obviously the correct behaviour we intended. Curious to see what is gonna break in community projects as we enforce it.


Code Helper is overloading CPU

VSCode Version: Code 1.4.0 (6276dcb0ae497766056b4c09ea75be1d76a8b679, 2016-08-04T16:41:29.513Z)
OS Version: Darwin x64 15.6.0

Steps to Reproduce:

Open Visual Studio Code
Open a project
Open activity monitor and check that % CPU is over 100

ActivityMonitor analysis .txt file: https://www.dropbox.com/s/0zrsjo7c1aas4qs/ActivityMonitorCodeHelperAnalysis.txt?dl=0

Seems like a duplicate of #9572

@bpasero assigning to you. I saw that you had similar issues as well.
@johanbove could you please provide the command line of the Code Helper process causing the high CPU usage. And can you reproduce this without having any extension installed.

Thanks for the follow up @dbaeumer !
The tip gerhardcit  to add the bower_components folder to WatcherExclude list helped.
Perhaps this folder should be added per default?

@johanbove is there something in that folder that you would need to be notified about? Disabling file events has consequences, e.g. the explorer not updating if something changes within. Do bower developers typically hide this folder from the explorer?

@johanbove actually is bower_components comparable to node_modules for node.js?

@bpasero Yes, in a way the bower_components is similar as when used in a project it contains third-party tools and libraries which are "imported" into a project.  Bower is also a package manager: https://bower.io/
I'm not sure what Code Helper actually does, so unless a developer is working on a particular bower_component itself, I assume VSCode should not watch this folder for changes.

Update: I'm having the issue with the high CPU load again even-though so it looks like excluding the "bower_components" folder does not resolve the issue. How can Code Helper be analyzed to get details on what is it crunching on so intensively?

@johanbove first thing is to find out the arguments of this process, e.g. is this really the file watcher or not. Can you provide this details?

@bpasero How do I get the arguments of the running process through Activity Monitor?

@johanbove from the command line "ps aux | grep <pid>" taking the PID from the activity monitor.

OK, started VSCode without extensions active with code --disable-extensions . and it seems to be running a lot "cooler" now. So it's probably an extension misbehaving. Will start again with all extensions active and when the Code Helper process goes berserk again I will execute the command to get to the arguments and will post back here.

Output for the arguments command; Code Helper PID 5205 raises CPU % over 100;
ps aux | grep 5205
johanbove        5205 100,1  3,6  3741216 598876   ??  R    12:57pm   1:02.72 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=watcherService
johanbove        5260   0,0  0,0  2444056    824 s001  S+   12:58pm   0:00.00 grep 5205

But it went again now... :-) Will keep an eye out for a Code Helper process which stays over 100% for longer periods and will report back here. Now that I know how to report this it'll be more helpful for sure.

@johanbove it is actually pretty easy: if you open VS Code on a large workspace, the file watcher has to walk each and every folder and file within. This causes high CPU spikes right on startup, independent from extensions. The only way to get this down is to set the files.watcherExclude on large folders that you do not look at.
Eventually though the CPU spike goes down and stays low. If you see this NOT happening, it defnitley is unexpected.

I pinpointed the CPU load issue to the extension: "glen-84.sass-lint-0.0.1"; Will contact the author of the plugin.
ps aux | grep 9566
johanbove        9566 161,8  3,1  3755952 516588   ??  S     8:13am  23:18.99 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Users/johanbove/.vscode/extensions/glen-84.sass-lint-0.0.1/node_modules/vscode-languageclient/lib/utils/electronForkStart /Users/johanbove/.vscode/extensions/glen-84.sass-lint-0.0.1/server/server.js
johanbove        9848   0,0  0,0  2464536    880 s001  S+    8:27am   0:00.00 grep 9566

For future reference: here is the issue posted in the "sass-lint" project: https://github.com/glen-84/vscode-sass-lint/issues/2

Thanks 👍

+1.

VSCode Version: 1.7.2
OS Version: osx 10.11.6

Excluding bower/node/jspm folders solved the issue for me:
Code -> Preferences -> User Settings
"files.exclude": {
    "**/.git": true,
    "**/.svn": true,
    "**/.hg": true,
    "**/.DS_Store": true,
    "**/bower_components": true,
    "**/jspm_packages": true,
    "**/node_modules": true
}

The issue with the sass-lint extension should be fixed in v0.0.4.
Apologies for the inconvenience.

Thanks for fixing this! 👍

I started experiencing this as well after installing the recent "Angular Language Service" extension. Removed it for now and things seem to be back to normal.

The same issue happens using vetour now, see https://github.com/vuejs/vetur/issues/216

I'm seeing this issue as well with the latest VS Code. Here's what I have for extensions:
Bookmarks - Version :0.15.2
code-settings-sync - Version :2.8.2
debugger-for-chrome - Version :3.1.6
debugger-for-edge - Version :0.4.1
debugger-for-ios-web - Version :0.1.2
docthis - Version :0.4.7
EditorConfig - Version :0.9.4
gitblame - Version :2.0.2
gitflow - Version :1.1.1
githistory - Version :0.2.2
Go - Version :0.6.62
html-css-class-completion - Version :1.8.0
html-snippets - Version :0.1.0
javascript-unit-test-snippet - Version :1.0.0
JavaScriptSnippets - Version :1.4.1
jenkinsfile-support - Version :0.1.0
Material-theme - Version :2.9.8
nodejs-extension-pack - Version :0.1.9
npm-intellisense - Version :1.3.0
path-intellisense - Version :1.4.2
PowerShell - Version :1.4.1
prettier-vscode - Version :0.21.0
prettify-json - Version :0.0.3
project-manager - Version :0.18.1
quokka-vscode - Version :1.0.44
react-native-react-redux - Version :1.0.1
react-redux-es6-snippets - Version :2.1.0
rest-client - Version :0.14.6
Ruby - Version :0.12.1
sass-indented - Version :1.4.1
search-node-modules - Version :1.1.1
slack - Version :0.0.13
theme-dracula - Version :2.1.3
tslint - Version :0.17.0
typelens - Version :1.4.1
view-in-browser - Version :0.0.5
vscode-babel-coloring - Version :0.0.4
vscode-color - Version :0.4.1
vscode-docker - Version :0.0.16
vscode-eslint - Version :1.2.11
vscode-gutter-preview - Version :0.10.0
vscode-html-css - Version :0.1.7
vscode-jest - Version :2.2.0
vscode-markdownlint - Version :0.10.0
vscode-npm-script - Version :0.2.0
vscode-svgviewer - Version :1.4.2
Does anyone know if any of these extensions cause the CPU to make Code Helper spike to 100%?

I'm still seeing this.

Just experience the same problem.
Comparing my extensions to @nickytonline list
I had two extensions in common:

githistory - But I have Version :0.2.3
npm-intellisense - Version :1.3.0

I experience this problem most days. At this point all my extensions are disabled. 4 are installed but all are disabled:

Babel ES6/ES7 0.0.4
Docker 0.0.16
HTML Preview 0.1.1
vscode-open-project 0.0.9

Update, I tracked my issue down to Code Spell Checker and a really large seed-data JSON file. Disabling Code Spell Checker solved my issues. To be fair to Code Spell Checker and @Jason-Rev, CSpell is a great extension. So the next step is to disable spell checking for targeted files.

@cklanac can you open a new issue here: https://github.com/Jason-Rev/vscode-spell-checker/issues/ with some details about your setup.
Can you include things:

like OS and version.
Some information about the "really large seed-data JSON file"

Is it open in the editor
Is it automatically generated or updated.
Does excluding it in the cSpell.ignorePaths work?

Thank you.

I don't have vs code open, and code helper is still eating my battery. Shouldn't this process close when i close vs code?

Running VSC beta its constantly up 100% until the computer becomes so slow that i can't type and click any longer.


fix: missing error class in UiPhoneNumber component

Description
Support for ui-phone-number--has-error
Related Issue
Closes #382
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):

Checklist:

[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my code
[ ] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes

There are bugs in UiPhoneNumber.stories.ts

And also is UiPhoneNumber.vue

And also is UiPhoneNumber.vue

:thank_you: @sonya0504, I'm aware of that. Following @AlanLes's comment, I decided to retract my "solution" to demonstrate to him why I had implemented it in the first place.

Check Types / vue-tsc (pull_request) Failing after 30s

Only 1 thing that I think may be a good starting point for a discussion :)

Your suggestions have been incorporated. Please review this pull request again.


Verify blob timestamp matches scan request timestamp before scanning file

Description
Data element content can be overwritten after creation, resulting in the possibility for multiple file scan instances to be requested in parallel, potentially resulting in out of order scanning.
File scan requests with a timestamp that does not match the current value of the LastModified property in Blob Storage should be ignored.
Tasks

[x] Add Timestamp property to FileScanRequest model, value from blob properties.
[x] Add logic to file scan service to check TimeStamp with blob properties and skips scan if mismatch

Acceptance criteria

[x] Automated tests to verify that out of order fileScan requests are handled properly

Verified in AT23 by manually changing blob content while function is paused.


0.8.0 preview rc

Contributions: We are not currently taking public contributions - see our contributions policy. However, we are accepting issues and we do want your feedback.

Description
This PR releases 0.8.0-preview to preview.
Release note
See CHANGELOG.md.
Tests
The release process testing was run three times: twice on engine 4.23 & once on engine 4.22.
Documentation
See CHANGELOG.md and docs-preview.

Due to merge conflicts have merged preview into the 0.8.0-preview-rc. This will now need a cloud deploy to verify.


error handling in custom scalar type deserialization

If an exception happens to be thrown while handling deserialization of a scalar type in:
I parseValue(Object input);     or      I parseLiteral(Object input);
methods from the Coercing<I, O> interface,
it is not handled and the output of the query will be an empty String, as "".
Going on the flow I found that in graphql.GraphQL.executeAsync(ExecutionInput) there is a catch that catches AbortExecutionException so I made the exception that I throw at scalar deserialization to extend AbortExecutionException in order to be caught. With this fix, the exception will be passed in my custom GraphQLErrorHandler and something meaningful will be displayed.
However there is no way to collect the path/name of the field that failed to be deserialized and it would be great to have one.
I'm not sure, but I think that exceptions like CoercingParseValueException may be considered clientErrors and automatically handled by the framework. What do you think?
Thanks,
Roland

This seems like an issue more for the servlet or graphql-java itself.  I'm not sure how graphql-java expects to handle errors in coercion or if it needs to be updated to support that exception

Should I log the issue on graphql-java repo then?

Yeah, I would open an issue in graphql-java if you haven't already.

I haven't opened it.


Fix goog.Timer

I removed all the direct uses of goog.Timer, but we still use it indirectly in the contract editor through goog.ui.MenuButton. Rewriting the contract editor to no longer use that would be a lot more work than just correctly setting the goog.Timer's defaultTimerObject.

Codecov Report

Merging #141 into master will decrease coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #141      +/-   ##
==========================================
- Coverage   54.96%   54.96%   -0.01%
==========================================
  Files          96       96
  Lines       11439    11439
==========================================
- Hits         6288     6287       -1
- Misses       5151     5152       +1

Impacted Files
Coverage Δ

core/ui/block_space/block_space.js
57.29% <0%> (-0.22%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8faf43d...e158c6b. Read the comment docs.


Block IPs by Country

Allow to ban an entire country on the system, or just an endpoint

#1 - Block IPs by Country -
Update documentation.
Decouple the dynamic blocked IP list.
Implements country detection by user IP.
Implements access by country.
https://github.com/alejivo/Flask-Security-Utils/commit/befca8dad087c5c2d11d8b2ffc150f4e7c2727b9

#1 - Block IPs by Country -
Update binary IP database.
Update flask example message.
https://github.com/alejivo/Flask-Security-Utils/commit/7948abfbcc8e1959d934ce51944375ab8cb78080

#1 - Block IPs by Country -
Update naming and logging
https://github.com/alejivo/Flask-Security-Utils/commit/1da689a975475071a3e38edff6211b3f369398d3

Manual test was done using VPN with ES, AR, BR and MX  IPs, It's worked in all use case scenarios.


Dialog does not support multiple tabs

Bug, feature request, or proposal:
Bug: Multiple tabs in a dialog cause chrome to go aw snap
What is the expected behavior?
I should be able to have more than one tab in a dialog
What is the current behavior?
You can render one tab in a dialog but as soon as you add two chrome goes aw snap
What are the steps to reproduce?
Create a dialog.  Have the contents of the dialog be tabs.  Add one tab, everything works great.  Add two or more tabs and chrome will eventually go aw snap.
What is the use-case or motivation for changing an existing behavior?
There is no purpose for using tabs if you can only have one
Which versions of Angular, Material, OS, browsers are affected?
Angular 2.2.4
Material 2.0.0-alpha.11-2
Is there anything else we should know?
No

@starksds can you share reproduction code?

I've already rolled back my changes.  It works in alpha.9-3 if that helps you narrow down what might have changed.

@crisbeto can you investigate this?

I couldn't reproduce it by sticking the tab demos into a dialog. @starksds can you post your HTML?

@crisbeto our app has a mix of bootstrap 4 and material 2 components since your components weren't finished when we started so that might be causing the issue.
Could you provide a plunker for your test case that I could try to implement in our app?

@starksds I tried taking the various examples from here and putting them into the dialog demo here.

I have the same issue without using dialog, I have many pages with tabs, but only two of them get stuck with 11-3 AS SOON AS I add more than one tab and all work fine with 10.  Chrome tab gets stuck and consumes memory indefinitely until I kill the tab with task manager. I'll try to figure out how those two pages differ from the rest (the rest of pages was stuck as well after upgrade, which was caused by changing the selectedIndex variable, the solution was to change in setTimeout, but not for those two pages, where variable is not changed in code)

I think I found a workaround and possibly a way to reproduce issue. I have a pure (without any code) component which is still stuck when having more than one tab. The only anomaly about this component is that it is in a lazily loaded module. As soon as I place the component in the entry module, everything works fine - so I thought something is not getting initialized when the component is lazily loaded. And then I placed the tab group in the div with *ngIf="isComponentLoaded" which is set to true only in ngAfterViewInit and guess what? It's working. If the variable is set in ngOnInit - the tab is stuck, there is something that is missing until component is fully initialized and after that it is safe to create the tabs, but not before that. I hope this information is enough to somehow reproduce the issue or make a guess about it's cause

I still can't reproduce it @chpasha. I'm using a lazy-loaded module, but it still works fine. Here's what the entire setup looks like:
lazy.module.ts
import { NgModule } from '@angular/core';
import {MaterialModule} from '@angular/material';

import { LazyComponent }   from './lazy.component';
import { routing } from './lazy.routing';

@NgModule({
  imports: [routing, MaterialModule.forRoot()],
  declarations: [LazyComponent]
})
export class LazyModule {}

lazy.routing.ts
import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { LazyComponent } from './lazy.component';

const routes: Routes = [
  { path: '', component: LazyComponent }
];

export const routing: ModuleWithProviders = RouterModule.forChild(routes);

lazy.component.ts
import { Component } from '@angular/core';

@Component({
  template: `
    <md-tab-group md-dynamic-height>
      <md-tab>
        <template md-tab-label>Tab one</template>
        <!-- some lipsum goes here -->
      </md-tab>

      <md-tab>
        <template md-tab-label>Tab one</template>
        <!-- some lipsum goes here -->
      </md-tab>
    </md-tab-group>
  `
})
export class LazyComponent {}

Can you post what your HTML looks like?

it is pure md-tab-group from documentation without anything, like
<md-tab-group >                 <md-tab label="one">                 </md-tab>                 <md-tab label="two">                 </md-tab> </md-tab-group>
what part of you example makes the module lazy?
this is lazy
{ path: "myurl", loadChildren: 'app/lazy.module#LazyModule' }

It's the loadChildren parameter, instead of the usual component.

you mean you do have loadChildren don't you?

Yes, I forgot to paste in that part since it's in the main module, but it looks like this:
  {path: 'lazy', loadChildren: 'lazy/lazy.module#LazyModule'}

then there could be something else involved, I'm using angular-cli 1.0.0-beta.21 with webpack. Fact is - it was working just fine in the previous beta. It must be something in tab group that doesn't get loaded yet when the component is rendered since like I said, ngIf hack works, so the component is working just fine if created after the module and component are loaded. I will try to reproduce the issue with smallest possible setup

P. S. the other components where tab group is working have following difference: the tab-group there is not declared directly in html layout but rather defined as standalone angular component (because of some business logic). So this still looks somehow like the matter of when the component is rendered (and besides that I see the Uncaught TypeError: Cannot read property 'elementRef' of undefined error for those components).

Ok, I got it. So, I have a component which shows md-progress-circle while route is loading.
@Component({
  selector: 'load-route-progress',
  templateUrl: './load-route-progress.component.html',
})
export class LoadRouteProgressComponent implements OnDestroy {

  private subscription: Subscription;
  public loading: Subject<boolean> = new Subject();

  public constructor(private router: Router) {
    this.subscription = router.events.subscribe(s => {
      if (s instanceof NavigationStart) {
        this.loading.next(true);
      }
      if (s instanceof NavigationEnd) {
        this.loading.next(false);
      }
    });
  }
  ngOnDestroy(): void {
    this.subscription.unsubscribe();
  }
}

it has following template and I think the devil hides here
<div [ngSwitch]="loading | async">
    <template [ngSwitchCase]="true">
      <md-progress-circle mode="indeterminate"></md-progress-circle>
    </template>
    <template ngSwitchDefault>
        <ng-content></ng-content>
    </template>
</div>

and then we have the app.html looking like
<load-route-progress>
  <router-outlet></router-outlet>
</load-route-progress>

the part with lazy module and tabs is identical (but I don't think it has to do with lazy, I think it has to do with ngSwitch  hiding router-outlet. So if you navigate to the lazy module, the page with tabs will stuck. If you remove load-route-progress component from markup, everything is fine. So the question is, is it a bug or feature? Maybe it is not allowed to remove router-outlet from dom (it is working as expecting with anything else though until beta 11-3) or is it really some bug in Material Tabs?
P. S. if you still cannot reproduce the problem, I will upload minimal project to github

Thanks, this looks promising. I'll try it out a bit later.

Thanks @chpasha, now it happened! I actually had to slow down the hiding of the progress since it doesn't break if it hides too fast. On one hand it seems weird to have a ngSwitch over a router outlet, however I'm not sure that's the cause. I put in your example in our demo app and the only component that breaks is the tabs. Another interesting thing is that the loading has to be slow in order for it to happen, e.g. if I slow it down 500ms it doesn't happen, however after 1000ms and 2000ms it does. For reference, here's what I changed the route subscriber to:
this.subscription = router.events.subscribe(s => {
  if (s instanceof NavigationStart) {
    this.loading.next(true);
  }
  if (s instanceof NavigationEnd) {
    setTimeout(() => this.loading.next(false), 1000);
  }
});

As a side-note, my initial hunch was that it may also be the circular progressbar causing it, but if I replace it with plain text it still happens.

Great that you could reproduce the problem. I still think it has to do with the lifecycle. I replaced switch with two divs with [hidden] attribute and the problem was gone. And don't forget those experiments with ngIf when adding tabs after the main component has rendered, it also worked fine.

True, but in that case any other components would break as well. I'll take a better look into this today.

There must be some serious problem between versions 2.0.0-alpha.11-2 and 2.0.0-alpha.11-3.
Scenarion: dialog contains 5 tabs.
In version 2.0.0-alpha.11-3

tabs are empty, no content at all. Event header has no labels. But tabs can be switched (still no content, only tabs without labels)
In version 2.0.0-alpha.11-2
everything works good, only md-select has wrong list position on a first show (on a 5th tab).

For reference, I tracked this down to the @translateTab animation in the tab-body which ends up getting into an infinite loop. @matsko looked into it and apparently it has something to do with the router triggering change detection too early. To reproduce it:

Download this snapshot of my fork and do an npm install.
Run the test server with npm run demo-app.
Open a browser and go to localhost:4200/tabs.

Note: if the infinite loop gets fixed, the tabs would probably end up looking broken. This is expected since I had to do some changes in order to narrow the issue down. We can revert those changes when we find a fix.
CC @jelbourn

The issue seems to be resolved in the newer Angular versions (I've confirmed with 2.3.1 of Angular and 3.3.1 of the router, as well as in 4.0.0-beta. @chpasha can you give it a try?
While it doesn't go into an infinite loop anymore, Angular stills throws an error. I'll try to check if there's a way to work around it.

I'm stuck with angular 2.2.4 and angular cli beta 21 for now. the last time I tried angular 2.3+ there were some issues with angular-cli being not compatible with it, and the newest version of angular cli (besides being not compatible with angular 2.3) had also some breaking changes so that ng serve didn't work for me at all. It's not easy to be an early adopter :-D . I will have to count on that it's fixed for now, since I have a workaround and especially if you say that it's an angular issue. Thank you anyway :+1:

@crisbeto @jelbourn I just upgraded to 2.3.1 and the infinite loop isn't happening anymore... but my tabs are still broken, ie, not showing any content.

Does it throw an error @starksds?

@crisbeto yeah, let me rebuild and get you a screenshot

@crisbeto Here are two errors that I wasn't getting in alpha 9-3...
When the page loads

When I open the dialog and click a tab

Here is the tab markup:
<md-tab-group [(selectedIndex)]="selectedIndex" #tabGroup>
    <md-tab *ngIf="tabs > 0">
        <template md-tab-label>
            <ng-content select=".ba-tab-title-1"></ng-content>
        </template>
        <template>
            <ng-content select=".ba-tab-content-1"></ng-content>
        </template>
    </md-tab>
    <md-tab *ngIf="tabs > 1">
        <template md-tab-label>
            <ng-content select=".ba-tab-title-2"></ng-content>
        </template>
        <template>
            <ng-content select=".ba-tab-content-2"></ng-content>
        </template>
    </md-tab>
    <md-tab *ngIf="tabs > 2">
        <template md-tab-label>
            <ng-content select=".ba-tab-title-3"></ng-content>
        </template>
        <template>
            <ng-content select=".ba-tab-content-3"></ng-content>
        </template>
    </md-tab>
</md-tab-group>

Alright, that's the error I'm getting as well. It's a little tricky to solve since the framework is trying to animate something that isn't in the DOM yet.

@crisbeto Is this error coming from angular or material?  Do you have a workaround or way to trap the error?

The error is from Angular @starksds, however we may be able to work around it in Material. I'm still looking for a way to do it.

@crisbeto does this still break in the new beta version of material?

It does. I have a fix but I haven't had the time to write it down.

@starksds @crisbeto remember to use 1.4.1 since we fixed the exception that is thrown within animations due to the nature of tabs and <ng-content></ng-content>.

Tried it out and it works properly and without any extra changes on 2.4.1 @matsko 👍 . We probably still need to keep the fix around for a little while until we don't support Angular < 2.4.1.

@starksds @crisbeto sorry guys it turns out the error isn't caught in the right way. I'll work on a fix right away.

Can confirm that this is now fixed in Angular 2.4.2 via https://github.com/angular/angular/commit/21030e9a1cf30e8101399d8535ed72d847a23ba6


web: analytics nudge in sidebar [ch2531]

Hello @yuindustries, @jazzdan,
Please review the following commits I made in branch maiamcc/nudge-in-web:
0f84c037becc8da8846e33363cc94870f5717ba1 (2019-05-13 17:25:57 -0400)
web: analytics nudge in sidebar [ch2531]
Code review reminders, by giving a LGTM you attest that:

Commits are adequately tested
Code is easy to understand and conforms to style guides
Incomplete code is marked with TODOs
Code is suitably instrumented with logging and metrics

Screenshot?

And here it is collapsed:

I'm happy to have this be a popover! Idk how to do that nonsense am happy to learn :)
am likely gonna not implement that in this PR, cuz again, trying to get the backend wired up, but will maybe do for future.


Pro subscriber - Whitelist more URLs for webembed? Or have custom setting in pro to whitelist?

Hi, I am paying subscriber for excalidraw pro.
I have been waiting a long time for API access to my boards to automate some stuff for my team. The web embed feature allows me to get most of those wishes done by doing the rendering elsewhere and displaying it in the embed.
Can at least PRO have less strict URL policy?
EDIT:
Where can I find the whitelisted URL's? The only other option I have then is to find a service and use that as a host to funnel through... Don't really like that solution tho.

Hi, I had the same question. I'm not affiliated with excalidraw, but I found the list of whitelisted URLs
Currently they are
const ALLOWED_DOMAINS = new Set([
  "youtube.com",
  "youtu.be",
  "vimeo.com",
  "player.vimeo.com",
  "figma.com",
  "link.excalidraw.com",
  "gist.github.com",
  "twitter.com",
  "*.simplepdf.eu",
  "stackblitz.com",
  "val.town",
]);

Thanks Hekman!
Interesting list, wouldn't expect val.town in there haha. Moving my team to Miro to have proper API access for now.

Hi @riekusr, apologies for the delay! We'll figure out what we can do in Plus, but the idea was to gather more feedback both from end-users and corporate customers to strike a balance between usefulness and appropriate use.
Sometimes the issues in this repository get unnoticed for some time. You can always send us an email on<EMAIL_ADDRESS>or hop on the discord (from the user dropdown at the top right corner)!

@riekusr in the meantime, any specific domains you would find useful?

Why is this gatekept? It makes it near useless for collaboration. I spent a lot of time compiling academic resources on a board with the app and cannot even share it for online collab with this kind of restriction??

link.excalidraw.com

Whitelist updated
https://github.com/excalidraw/excalidraw/blob/0513b647ec13bc2688eaf75d41c2b45049f2624b/packages/excalidraw/element/embeddable.ts#L42
const ALLOWED_DOMAINS = new Set([   "youtube.com",   "youtu.be",   "vimeo.com",   "player.vimeo.com",   "figma.com",   "link.excalidraw.com",   "gist.github.com",   "twitter.com",   "x.com",   "*.simplepdf.eu",   "stackblitz.com",   "val.town",   "giphy.com",   "dddice.com", ]);

pls whitelist 'amazonaws' domain for s3 file reading .  @delineas  @dwelle   @ad1992  .  I want to share pdf using web-embed .

Could we get a config option to add to the whitelist ourselves? 😊

@schoening we will look into that.

@dwelle, @schoening  - Just to add my thoughts on this as well, it's a serious limitation in functionality compared to competitors (e.g., Miro, Lucid) that offer embedding of almost any webpage. I understand the concern about appropriate use but, ultimately, this really does limit the use of Excalidraw as a collaboration tool.
I'd even go so far as to suggest switching from an allow list to a block list could be a more appropriate way to deal with abuse if it happens.


[AutoPR machinelearningservices/resource-manager] Adding usage id property to support usages by VM family, Workspace & Compute

Created to sync https://github.com/Azure/azure-rest-api-specs/pull/6055

This PR has been merged into https://github.com/Azure/azure-sdk-for-js/pull/3160


make test fails on RHEL7 VM

make test fails on the RHEL 7 VM I am using.
Here is the configuration of the RHEL 7, which runs via virt-manager.
[hmeng@localhost runc]$ uname -a
Linux localhost.localdomain 3.10.0-327.18.2.el7.x86_64 #1 SMP Fri Apr 8 05:09:53 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

[hmeng@localhost runc]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.2 (Maipo)

[hmeng@localhost runc]$ go version
go version go1.6.2 linux/amd64

[hmeng@localhost runc]$ pwd
/home/hmeng/go/src/github.com/opencontainers/runc
[meng@localhost runc]$ git branch
* 901
  master
[hmeng@localhost runc]$ git log
commit bb5473fb5358bca2f4df0ff5c3a8e66ebaaecfdf
Author: Mrunal Patel<EMAIL_ADDRESS>Date:   Thu Jun 9 15:58:50 2016 -0700

    integration: Fix race in TestFreeze

There are 5 failures in the unit test:
=== RUN   TestUsernsExecPS
time="2016-06-10T17:35:03Z" level=warning msg="os: process already finished"
--- FAIL: TestUsernsExecPS (0.05s)
	exec_test.go:49: nsenter: Unable to unshare namespaces: Invalid argument
		nsenter: Unable to fork: Invalid argument
		|: process_linux.go:241: running exec setns process for init caused "exit status 1"

=== RUN   TestUsernsRlimit
time="2016-06-10T17:35:04Z" level=warning msg="os: process already finished"
--- FAIL: TestUsernsRlimit (0.02s)
	utils_test.go:48: exec_test.go:197: unexpected error: process_linux.go:241: running exec setns process for init caused "exit status 1"

--- FAIL: TestInitJoinNetworkAndUser (0.01s)
	utils_test.go:48: exec_test.go:1578: unexpected error: process_linux.go:241: running exec setns process for init caused "exit status 1"

=== RUN   TestExecInUsernsRlimit
time="2016-06-10T17:35:12Z" level=warning msg="os: process already finished"
--- FAIL: TestExecInUsernsRlimit (0.01s)
	utils_test.go:48: execin_test.go:109: unexpected error: process_linux.go:241: running exec setns process for init caused "exit status 1"

=== RUN   TestExecInUserns
time="2016-06-10T17:35:14Z" level=warning msg="os: process already finished"
--- FAIL: TestExecInUserns (0.01s)
	utils_test.go:48: execin_test.go:462: unexpected error: process_linux.go:241: running exec setns process for init caused "exit status 1"

test 15 in bats failed:
not ok 15 runc exec
# (in test file tests/integration/exec.bats, line 24)
#   `[[ "${output}" == *"Hello from exec"* ]]' failed
# text echoed = ''

@mrunalp , PTAL.

@redhatdan , PTAL.

@rhatdan, PTAL.

@rhatdan, I tried to run make test inside the RHEL 7 VM as root, the errors still happen.

User namespaces aren't enabled by default in RHEL 7. We have to enable them by a sysctl or a boot param.

What is the sysctl?  I guess we should enable this in the builder if the system is rhel/centos?

I see a boot param. Couldn't find the sysctl. I will grep for it on Monday in the source.
grubby --args="user_namespace.enable=1" \
    --update-kernel=/boot/vmlinuz-3.10.0-xxx.y.1.el7.x86_64

@mrunalp , @rhatdan , I am wondering how RHEL 7 disable the user namespace.
Clearly, kernel 3.10 already has user namespace enabled:
[root@localhost boot]# cat /boot/config-3.10.0-327.18.2.el7.x86_64 |grep USER_NS
CONFIG_USER_NS=y

However, when I test the demo_userns.c from http://lwn.net/Articles/539941/, I got the following error because I was trying to use CLONE_NEWUSER option for clone:
[hmeng@localhost ~]$ ./demo_userns
clone: Invalid argument

According to here, there is a kernel patch which allows sysctl to disable CLONE_NEWUSER.
https://lwn.net/Articles/673597/
https://lkml.org/lkml/2016/1/22/8
Do you think the kernel used by RHEL 7 employed this patch?

I retested the make test of runc after enabling user namespace on RHEL 7, all the bats tests succeeded.
There is one failure among all the unit tests:
=== RUN   TestInitJoinNetworkAndUser
time="2016-06-14T14:31:04Z" level=warning msg="os: process already finished"
--- FAIL: TestInitJoinNetworkAndUser (0.31s)
    utils_test.go:51: exec_test.go:1597: unexpected error: process_linux.go:245: running exec setns process for init caused "exit status 1"

I end up with a dead docker container, which can not be removed normally by docker rm -f. Restarting docker daemon can remove these dead containers.
[root@localhost runc]# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
6ad82d9a6e01        runc_test           "/tmpmount make local"   2 minutes ago       Dead                                    tender_bohr

[root@localhost runc]# docker rm -f 6ad82d9a6e01
Error response from daemon: Driver devicemapper failed to remove root filesystem 6ad82d9a6e013b6aa5591d6b10184741290def72130eaf1beef88b8f9f9af419: Device is Busy


Pixi v5/v6 uses WegGL v1 on samsung galaxy s8 phone running chrome 88

Expected Behavior
Should use WebGL v2
Current Behavior
Use WebGL v1
Possible Solution

Steps to Reproduce
Open pixi application on specified device, connect it to your computer via USB and go to chrome://inspect in order to open devtools for connected phone. Pixi logs that webgl 1 is being used.
I also visited https://webglreport.com on same device, and it states that webgl v2 is indeed supported on it.
Environment

pixi.js version:  v5/v6
Browser & Version: _e.g. Chrome 88
OS & Version:  Android 9.0
Running Example: -

See #5502
According to docs for PIXI.settings.PREFER_ENV:

Due to bug in chromium we disable webgl2 by default for all non-apple mobile devices.


no password can be entered - Safari IOS13

in safari & firefox under ios13,
no password can be entered,
the characters are not taken over in the password field

Tried on Chrome and Brave and both have the same problem, only can type the first character.

I was having the same issue on Safari on iOS 14. After doing some digging, I found the issue and how to fix it.
The developer of this beautiful web application coded it with an incorrect use of input webkit-user-select, which is one of the syntax frameworks used in mobile Safari.
The code found within the main (and only important file), explorer.php, contains a few errors in all of the webkit syntax used. The current unmodified code shows:
Lines 512 603, 753, 2718, 2918, and 3133:
		-webkit-user-select: none;
Having this setting will cause 'freezing' while typing or not allow you to type at all in a text-input field
The fix is changing the webkit to the correct standard for text-input fields:
		-webkit-user-select: text;
The way I implemented the fix was to use a find-and-replace tool to replace all text stating -webkit-user-select: none; to -webkit-user-select: text;.
I even took it one step further, just as a fail safe, by changing all user-select: none syntax to user-select: text. Note that making these changes would not impact the web application whatsoever.
After making these changes, just save the explorer.php file and upload to your server. It should now work on iOS and devices that use webkit.
Attached is explorer.txt, since you cannot upload .php files to GitHub:
explorer.txt
@webcdn


2.5.1 Update with latest Payment JS fixes

@jessepollak any chance you could push to NPM?

@melloware - can you shoot me your NPM username? I can also add you there to do releases. Will cut one now in addition! Thanks!

NPM username is "melloware" thanks!


Create codacy.yml as first ci/cd test.

Create a GitHub Action for a Codacy security check. When the action has been created and works, this will be merged into the main branch.

Code passed the initial Codacy security check in the newly-checked-in code. Will test on the rest of the code after merge.


Example of usage in conjunction with Express server

How to run Express server with react-scripts's Babel support?

There is currently no direct support for this.
(You can probably do it with react-scripts/config/babel.dev but we may break this in any version—it’s not official, and we can change, move, or rename files.)
For now we encourage you to treat the frontend and backend as completely separate apps, with different environments. Using Babel for Node in production without precompilation is bad for performance so we don’t recommend doing this, and precompilation of the server code is out of scope of this project.

For now we encourage you to treat the frontend and backend as completely separate apps

Can you elaborate on how you think it should be done ?
For deploying in production I guess I can just tell my server to serve build/* folder but what should we do in development ? Should we keep running the built in server on one port and hard-code the real server address:port somewhere for all http requests in the app ?

Nevermind!
I have just discovered the README :-)
https://github.com/facebookincubator/create-react-app/blob/master/template/README.md#proxying-api-requests-in-development

Yeah, this will land in a stable build soon.


Unable to start a webdriver session for chrome

I am a new comer to protractor and I got problem trying to using protractor with webdriver.
I installed protractor and did "webdriver-manager update" to get selenium server and chromedriver and iedriver downloaded.
Then I start the selenium standalone server at local (<IP_ADDRESS>:4444)
then try to perform testing with "protractor conf.js", then I got following error message.
$ protractor conf.js
Using the selenium server at http://<IP_ADDRESS>:4444/wd/hub
[launcher] Running 1 instances of WebDriver
ERROR - Unable to start a WebDriver session.
c:\Users\dc\AppData\Roaming\npm\node_modules\protractor\node_modules\seleniu
m-webdriver\lib\atoms\error.js:113
var template = new Error(this.message);
^
UnknownError: null
at new bot.Error (c:\Users\dc\AppData\Roaming\npm\node_modules\protracto
r\node_modules\selenium-webdriver\lib\atoms\error.js:113:18)
at Object.bot.response.checkResponse (c:\Users\dc\AppData\Roaming\npm\no
de_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:106:
9)
at c:\Users\dc\AppData\Roaming\npm\node_modules\protractor\node_modules
selenium-webdriver\lib\webdriver\webdriver.js:152:24
at c:\Users\dc\AppData\Roaming\npm\node_modules\protractor\node_modules
selenium-webdriver\lib\goog\base.js:1582:15
at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (c:\Users\do
ncui\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver
\lib\webdriver\promise.js:1654:20)
at notify (c:\Users\dc\AppData\Roaming\npm\node_modules\protractor\node_
modules\selenium-webdriver\lib\webdriver\promise.js:465:12)
at notifyAll (c:\Users\dc\AppData\Roaming\npm\node_modules\protractor\no
de_modules\selenium-webdriver\lib\webdriver\promise.js:442:7)
at resolve (c:\Users\dc\AppData\Roaming\npm\node_modules\protractor\node
_modules\selenium-webdriver\lib\webdriver\promise.js:420:7)
at fulfill (c:\Users\dc\AppData\Roaming\npm\node_modules\protractor\node
modules\selenium-webdriver\lib\webdriver\promise.js:535:5)
at c:\Users\dc\AppData\Roaming\npm\node_modules\protractor\node_modules
selenium-webdriver\lib\goog\base.js:1582:15
==== async task ====
WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession (c:\Users\dc\AppData\Roa
ming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\w
ebdriver.js:149:22)
at Function.webdriver.WebDriver.createSession (c:\Users\dc\AppData\Roami
ng\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\web
driver.js:123:30)
at Builder.build (c:\Users\dc\AppData\Roaming\npm\node_modules\protracto
r\node_modules\selenium-webdriver\builder.js:294:22)
at DriverProvider.getNewDriver (c:\Users\dc\AppData\Roaming\npm\node_mod
ules\protractor\lib\driverProviders\driverProvider.js:38:7)
at Runner.createBrowser (c:\Users\dc\AppData\Roaming\npm\node_modules\pr
otractor\lib\runner.js:180:37)
at c:\Users\dc\AppData\Roaming\npm\node_modules\protractor\lib\runner.js
:257:21
at _fulfilled (c:\Users\dc\AppData\Roaming\npm\node_modules\protractor\n
ode_modules\q\q.js:797:54)
at self.promiseDispatch.done (c:\Users\dc\AppData\Roaming\npm\node_modul
es\protractor\node_modules\q\q.js:826:30)
at Promise.promise.promiseDispatch (c:\Users\dc\AppData\Roaming\npm\node
_modules\protractor\node_modules\q\q.js:759:13)
[launcher] Process exited with error code 1

the content of conf.js
// conf.js
exports.config = {
seleniumAddress: 'http://<IP_ADDRESS>:4444/wd/hub',
specs: ['spec.js'],
capabilities: {
browserName: 'chrome',
chromeOptions: {
binary: 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe',
args: [],
extensions: [],
}
}
};

I assume you start WebDriver with webdriver-manager start?
If so, I cannot reproduce this with your config. Maybe adding spec.js (partially) would help.

I just use this tutorial to pratice
http://angular.github.io/protractor/#/tutorial
and the content of spec.js
// spec.js
describe('angularjs homepage', function() {
it('should have a title', function() {
browser.get('http://juliemr.github.io/protractor-demo/');
expect(browser.getTitle()).toEqual('Super Calculator');

});
});

I guess the problem lies in chromedriver or chrome.exe.
But it should be no wrong in chromedriver as it is downloaded by webdriver-manager.

Hmmm, works for me :cry:

where is the chrome.exe in your machine? and what OS do you have?

In my own Protractor tests I do not even specify the location of the Chrome-executable, but I did try to specify it as you did.
I use Windows 7 (x64) with Chrome 40.0.2214.115 m (located on exactly the same path as your copy) in combination with node v0.12.0 and webdriver-manager gives me 21:35:11.109 INFO - v2.44.0, with Core v2.44.0. Built from revision 76d78cf.
I tried both http://localhost:4444/wd/hub as I did your option with <IP_ADDRESS>: both work.

Please run your test with the  --troubleshoot and post the output.

I try to use --troubleshoot but it is not accepted.
C:\Users\doncui\protractor_test>protractor --troubleshoot conf.js
**you must either specify a configuration file or at least 3 options. See below
for the options:
Usage: protractor [options] [configFile]
configFile defaults to protractor.conf.js
The [options] object will override values from the config file.
See the reference config for a full list of options.
Options:
--help                                             Print Protractor help menu
--version                                          Print Protractor version
--browser, --capabilities.browserName              Browsername, e.g. chrome or
firefox
--seleniumAddress                                  A running selenium address
to use
--seleniumServerJar                                Location of the standalone
selenium jar file
--seleniumPort                                     Optional port for the selen
ium standalone server
--baseUrl                                          URL to prepend to all relat
ive paths
--rootElement                                      Element housing ng-app, if
not html or body
--specs                                            Comma-separated list of fil
es to test
--exclude                                          Comma-separated list of fil
es to exclude
--verbose, --jasmineNodeOpts.isVerbose             Print full spec names
--stackTrace, --jasmineNodeOpts.includeStackTrace  Print stack trace on error
--params                                           Param object to be passed t
o the tests
--framework                                        Test framework to use: jasm
ine, cucumber or mocha
--resultJsonOutputFile                             Path to save JSON test resu
lt
--troubleshoot                                     Turn on troubleshooting out
put
--elementExplorer                                  Interactively test Protract
or commands

The --troubleshoot parameter requires an argument, so try:
protractor --troubleshoot true conf.js

C:\Users\doncui\protractor_test>protractor --troubleshoot true conf.js
DEBUG - Running with --troubleshoot
DEBUG - Protractor version: 1.8.0
DEBUG - Your base url for tests is undefined
Using the selenium server at http://<IP_ADDRESS>:4444/wd/hub
[launcher] Running 1 instances of WebDriver
ERROR - Unable to start a WebDriver session.
C:\Users\doncui\AppData\Roaming\npm\node_modules\protractor\node_modules\seleniu
m-webdriver\lib\atoms\error.js:113
var template = new Error(this.message);
^
UnknownError: null
at new bot.Error (C:\Users\doncui\AppData\Roaming\npm\node_modules\protracto
r\node_modules\selenium-webdriver\lib\atoms\error.js:113:18)
at Object.bot.response.checkResponse (C:\Users\doncui\AppData\Roaming\npm\no
de_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:106:
9)
at C:\Users\doncui\AppData\Roaming\npm\node_modules\protractor\node_modules
selenium-webdriver\lib\webdriver\webdriver.js:152:24
at C:\Users\doncui\AppData\Roaming\npm\node_modules\protractor\node_modules
selenium-webdriver\lib\goog\base.js:1582:15
at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (C:\Users\do
ncui\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver
\lib\webdriver\promise.js:1654:20)
at notify (C:\Users\doncui\AppData\Roaming\npm\node_modules\protractor\node_
modules\selenium-webdriver\lib\webdriver\promise.js:465:12)
at notifyAll (C:\Users\doncui\AppData\Roaming\npm\node_modules\protractor\no
de_modules\selenium-webdriver\lib\webdriver\promise.js:442:7)
at resolve (C:\Users\doncui\AppData\Roaming\npm\node_modules\protractor\node
_modules\selenium-webdriver\lib\webdriver\promise.js:420:7)
at fulfill (C:\Users\doncui\AppData\Roaming\npm\node_modules\protractor\node
modules\selenium-webdriver\lib\webdriver\promise.js:535:5)
at C:\Users\doncui\AppData\Roaming\npm\node_modules\protractor\node_modules
selenium-webdriver\lib\goog\base.js:1582:15
==== async task ====
WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession (C:\Users\doncui\AppData\Roa
ming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\w
ebdriver.js:149:22)
at Function.webdriver.WebDriver.createSession (C:\Users\doncui\AppData\Roami
ng\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\web
driver.js:123:30)
at Builder.build (C:\Users\doncui\AppData\Roaming\npm\node_modules\protracto
r\node_modules\selenium-webdriver\builder.js:294:22)
at DriverProvider.getNewDriver (C:\Users\doncui\AppData\Roaming\npm\node_mod
ules\protractor\lib\driverProviders\driverProvider.js:38:7)
at Runner.createBrowser (C:\Users\doncui\AppData\Roaming\npm\node_modules\pr
otractor\lib\runner.js:180:37)
at C:\Users\doncui\AppData\Roaming\npm\node_modules\protractor\lib\runner.js
:257:21
at _fulfilled (C:\Users\doncui\AppData\Roaming\npm\node_modules\protractor\n
ode_modules\q\q.js:797:54)
at self.promiseDispatch.done (C:\Users\doncui\AppData\Roaming\npm\node_modul
es\protractor\node_modules\q\q.js:826:30)
at Promise.promise.promiseDispatch (C:\Users\doncui\AppData\Roaming\npm\node
_modules\protractor\node_modules\q\q.js:759:13)
[launcher] Process exited with error code 1

I'm guessing this is an issue with where your Chrome binary is. Can you check and make sure it's at C:/Program Files (x86)/Google/Chrome/Application/chrome.exe? Can you run other browsers?

The path is correct.
I can run firefox and IE successfully.
Br/Dongbo
2015-03-17 0:18 GMT+01:00 Julie Ralph<EMAIL_ADDRESS>
I'm guessing this is an issue with where your Chrome binary is. Can you
check and make sure it's at C:/Program Files
(x86)/Google/Chrome/Application/chrome.exe? Can you run other browsers?
—
Reply to this email directly or view it on GitHub
https://github.com/angular/protractor/issues/1905#issuecomment-81985393.

Not sure what to say - we can't reproduce the problem. It's an issue with chromedriver, chrome, or the selenium standalone server. Can you try reinstalling them?
I'm going to close this issue sine it's not a general problem, but we can keep discussing here.

Have you tried run webdriver-manager update?
Installing chromedriver manually might help as well:

download chromedriver (https://code.google.com/p/selenium/wiki/ChromeDriver)
extract
put the chromedriver file into your windows/system32 folder

I'm receiving the same error as @orbitbot and @iamblackheat

Also experiencing the same issue as @orbitbot, @iamblackheat, and @cboden. Windows, with webdriver-manager up to date.

You probably have java 8 installed, remove it and install java 7.

Just to add a helpful note: Instead of passing --troubleshoot true to the command line, which does not work for me, this can also be specified in the configuration file: troubleshoot: true,

Thanks @gilamran. That worked!
I am on OSX 10.10.5. Simply switching JAVA_HOME to jdk1.7 solved the problem.
Here is what I did:
ryba@localhost:/tmp/angular-phonecat[(step-7)]
$ ll /Library/Java/JavaVirtualMachines/
total 24
8 lrwxr-xr-x  1 root  wheel   16 Aug 23 14:43 jdk1.7@ -> jdk1.7.0_79.jdk/
0 drwxr-xr-x  3 root  wheel  102 May  2 16:10 jdk1.7.0_79.jdk/
8 lrwxr-xr-x  1 root  wheel   16 Aug 23 14:42 jdk1.8@ -> jdk1.8.0_45.jdk/
0 drwxr-xr-x  3 root  wheel  102 Jul  3 21:10 jdk1.8.0_45.jdk/
8 lrwxr-xr-x  1 root  wheel   16 Jul  3 21:12 latest@ -> jdk1.8.0_45.jdk/

ryba@localhost:/tmp/angular-phonecat[(step-7)]
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8/Contents/Home

ryba@localhost:/tmp/angular-phonecat[(step-7)]
$ java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

ryba@localhost:/tmp/angular-phonecat[(step-7)]
$ protractor test/protractor-conf.js
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://<IP_ADDRESS>:55941/wd/hub

/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:113
  var template = new Error(this.message);
                 ^
UnknownError: The process has not exited yet therefore no result is available ...
    at new bot.Error (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:113:18)
    at Object.bot.response.checkResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/response.js:106:9)
    at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:158:24
    at [object Object].promise.ControlFlow.runInFrame_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1877:20)
    at [object Object].promise.Callback_.goog.defineClass.notify (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:2464:25)
    at [object Object].promise.Promise.notify_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:563:12)
    at Array.forEach (native)
    at Object.goog.array.forEach (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/array/array.js:203:43)
    at [object Object].promise.Promise.notifyAll_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:552:16)
    at goog.async.run.processWorkQueue (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/async/run.js:125:21)
From: Task: WebDriver.createSession()
    at Function.webdriver.WebDriver.acquireSession_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:155:22)
    at Function.webdriver.WebDriver.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:129:30)
    at [object Object].Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:416:22)
    at [object Object].DriverProvider.getNewDriver (/usr/local/lib/node_modules/protractor/lib/driverProviders/driverProvider.js:38:7)
    at [object Object].Runner.createBrowser (/usr/local/lib/node_modules/protractor/lib/runner.js:180:37)
    at /usr/local/lib/node_modules/protractor/lib/runner.js:268:21
    at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:797:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:826:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:759:13)
    at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:573:44
[launcher] Process exited with error code 1

ryba@localhost:/tmp/angular-phonecat[(step-7)]
$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7/Contents/Home

ryba@localhost:/tmp/angular-phonecat[(step-7)]
$ java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

ryba@localhost:/tmp/angular-phonecat[(step-7)]
$ protractor test/protractor-conf.js
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://<IP_ADDRESS>:62098/wd/hub
...WARNING - more than one element found for locator By.cssSelector(".phones li a") - the first result will be used
..

Finished in 2.817 seconds
5 tests, 8 assertions, 0 failures

Shutting down selenium standalone server.
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 passed

That's it. Works like a charm.
PS: I did install protractor globally but that should not matter.

For me it works for chrome and firefox but not safari.
@tomaszrybakiewicz did you test this with safari. I have checked my JDK and it is:
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.7.0_76.jdk/Contents/Home

$ ll /Library/Java/JavaVirtualMachines/
total 0
drwxr-xr-x  3 root  wheel  102  9 Oct  2014 jdk1.7.0_67.jdk
drwxr-xr-x  3 root  wheel  102 10 Apr 09:21 jdk1.7.0_76.jdk

Thanks
Rob

@robwatkin Unfortunately no. I did not have a need to test it in Safari. Running E2E tests against 2 different web browsers was enough for me.

@orbitbot Your failures on the CI machine are due to not having a display available, try with XVFB

thanks @gilamran and @tomaszrybakiewicz .,
I had the same problem using OSX 10.11
pointing $JAVA_HOME to JDK1.7 did the trick for me

I had a similar problem and tried the various suggestions here, including the Java 7 solution, but I was still getting this error:
protractor protractor.conf.js
Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/error.js:26
  constructor(opt_error) {
                         ^
WebDriverError: chrome not reachable
Turns out I was running webdriver-manager start as root.
Don't do this.

@GeraldScott Don't do what? Run webdriver-manager start or run it was root?

Don't run as root.

C:\Users\channakg\Source\Workspaces\VueFramework\Dev\VueFramework\VueFrameworkSanityTests>protractor Protractor.conf.js --browser="internet explorer" --Capabilities.seleniumAddress='http://localhost:5555/ --troubleshoot
[04:44:53] D/launcher - Running with --troubleshoot
[04:44:53] D/launcher - Protractor version: 5.1.1
[04:44:53] D/launcher - Your base url for tests is undefined
[04:44:53] I/launcher - Running 1 instances of WebDriver
[04:44:53] D/local - Attempting to find the SeleniumServerJar in the default location used by webdriver-manager
[04:44:53] I/local - Starting selenium standalone server...
[04:44:57] I/local - Selenium standalone server started at http://<IP_ADDRESS>:51916/wd/hub
[04:45:01] E/launcher - Unable to create new remote session. desired capabilities = Capabilities [{count=1, browserName=internet explorer}], required capabilities = Capabilities [{}]
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'VUE-FRW-WIN10', ip: '<IP_ADDRESS>', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: driver.version: InternetExplorerDriver
[04:45:01] E/launcher - SessionNotCreatedError: Unable to create new remote session. desired capabilities = Capabilities [{count=1, browserName=internet explorer}], required capabilities = Capabilities [{}]
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'VUE-FRW-WIN10', ip: '<IP_ADDRESS>', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: driver.version: InternetExplorerDriver
at WebDriverError (C:\Users\channakg\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:27:5)
at SessionNotCreatedError (C:\Users\channakg\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:214:5)
at Object.checkLegacyResponse (C:\Users\channakg\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:505:15)
at parseHttpResponse (C:\Users\channakg\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (C:\Users\channakg\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:440:13)
at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: WebDriver.createSession()
at Function.createSession (C:\Users\channakg\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:777:24)
at createDriver (C:\Users\channakg\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\index.js:167:33)
at Builder.build (C:\Users\channakg\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\index.js:632:14)
at Local.getNewDriver (C:\Users\channakg\AppData\Roaming\npm\node_modules\protractor\lib\driverProviders\driverProvider.ts:60:29)
at Runner.createBrowser (C:\Users\channakg\AppData\Roaming\npm\node_modules\protractor\lib\runner.ts:225:39)
at q.then.then (C:\Users\channakg\AppData\Roaming\npm\node_modules\protractor\lib\runner.ts:391:27)
at _fulfilled (C:\Users\channakg\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (C:\Users\channakg\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (C:\Users\channakg\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:796:13)
at C:\Users\channakg\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:604:44
[04:45:01] E/launcher - Process exited with error code 199
I'm unable to launch protractor in ie11

Sigh... I'm seeing this on linux but not my mac. Protractor 5.1.1, node v6.10.0, java 1.8.0_121
[10:53:57] E/launcher - chrome not reachable
  (Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.4.0-72-generic x86_64)
[10:53:57] E/launcher - WebDriverError: chrome not reachable
  (Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.4.0-72-generic x86_64)
    at WebDriverError (/root/co/tests/e2e/node_modules/selenium-webdriver/lib/error.js:27:5)
    at Object.checkLegacyResponse (/root/co/tests/e2e/node_modules/selenium-webdriver/lib/error.js:505:15)
    at parseHttpResponse (/root/co/tests/e2e/node_modules/selenium-webdriver/lib/http.js:509:13)
    at doSend.then.response (/root/co/tests/e2e/node_modules/selenium-webdriver/lib/http.js:440:13)
    at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: WebDriver.createSession()
    at Function.createSession (/root/co/tests/e2e/node_modules/selenium-webdriver/lib/webdriver.js:777:24)
    at Function.createSession (/root/co/tests/e2e/node_modules/selenium-webdriver/chrome.js:709:29)
    at Direct.getNewDriver (/root/co/tests/e2e/node_modules/protractor/lib/driverProviders/direct.ts:90:25)
    at Runner.createBrowser (/root/co/tests/e2e/node_modules/protractor/lib/runner.ts:225:39)
    at q.then.then (/root/co/tests/e2e/node_modules/protractor/lib/runner.ts:391:27)
    at _fulfilled (/root/co/tests/e2e/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/root/co/tests/e2e/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/root/co/tests/e2e/node_modules/q/q.js:796:13)
    at /root/co/tests/e2e/node_modules/q/q.js:556:49
    at runSingle (/root/co/tests/e2e/node_modules/q/q.js:137:13)
[10:53:57] E/launcher - Process exited with error code 199

I faced the same issue. Just install or update the protractor. If you still installed the protractor also Do the following steps, run the following in cmd prompt or PowerShell
npm install protractor -g
npm install webdriver-manager -g
If you got the error as running in the background, check the running processor and close all the running processor and try.
After the above steps run the following
webdriver-manager update
webdriver-manager start