text:
core.hooksPath not resolved from repository root

Description of the bug
If core.hooksPath is a relative path, git branchless init always resolves it relative to the directory in which it was invoked, not relative to the root of the repo like how Git interprets it.
Reproduction:
git init
git config core.hooksPath hooks
mkdir foo
cd foo
git branchless init
ls

Expected behavior
Hooks should have been installed to /hooks in the repo
Actual behavior
Hooks are installed to /foo/hooks (and then ignored by git)
Version of rustc
No response
Automated bug report
No response
Version of git-branchless
git-branchless-opts 0.10.0
Version of git
git version 2.39.5 (Apple Git-154)

Thanks for reporting. I think many git-branchless commands haven't been tested in non-root directories (and actually don't work), and so far it hasn't come up often (at least on the issue tracker).

repo: arxanas/git-branchless


text:
Handle errors coming from PostgreSQL the right way

Currently the Models that interface with PostgreSQL use strings.Contain to handle errors coming from the database.
Research what is the error type that the PostgreSQL driver returns, and start type asserting the errors.

https://github.com/gira-games/api/issues/5

source: gharchive/issue

repo: asankov/gira

license: MIT

license_type: permissive

license_source: github-api


text:
Add printable ASCII validation.

Add support for validating ASCII printable (non-control) characters.  Printable characters are in the range of x20-x7E.

Thanks! :+1:

source: gharchive/pull-request

authors: asaskevich jgannonjr

repo: asaskevich/govalidator

license: mit

license_source: bigquery


text:
AsciiDocFX does not start

AsciiDocFX cannot be opened. The process is running but not Window appear.
The log contains the following error message:
What can I do?
1981 [Thread-5] ERROR o.s.boot.SpringApplication - Application startup failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'springAppConfig': Unsatisfied dependency expressed through field 'applicationController'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationController': Failed to introspect bean class [com.kodedu.controller.ApplicationController] for lookup method metadata: could not find class that it depends on; nested exception is java.lang.NoClassDefFoundError: javafx/scene/control/TextInputDialog
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
	at com.kodedu.boot.AppStarter.startApp(AppStarter.java:84)
	at com.kodedu.boot.AppStarter.lambda$start$0(AppStarter.java:73)
	at com.kodedu.boot.AppStarter$$Lambda$54/1397135831.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationController': Failed to introspect bean class [com.kodedu.controller.ApplicationController] for lookup method metadata: could not find class that it depends on; nested exception is java.lang.NoClassDefFoundError: javafx/scene/control/TextInputDialog
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:269)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1118)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1091)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
	... 22 common frames omitted
Caused by: java.lang.NoClassDefFoundError: javafx/scene/control/TextInputDialog
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.access$100(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.access$100(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
	at java.lang.Class.getDeclaredMethods(Unknown Source)
	at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:613)
	at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:524)
	at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:510)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:247)
	... 34 common frames omitted
Caused by: java.lang.ClassNotFoundException: javafx.scene.control.TextInputDialog
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 65 common frames omitted
1983 [Thread-5] ERROR com.kodedu.boot.AppStarter - Problem occured while starting AsciidocFX
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'springAppConfig': Unsatisfied dependency expressed through field 'applicationController'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationController': Failed to introspect bean class [com.kodedu.controller.ApplicationController] for lookup method metadata: could not find class that it depends on; nested exception is java.lang.NoClassDefFoundError: javafx/scene/control/TextInputDialog
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
	at com.kodedu.boot.AppStarter.startApp(AppStarter.java:84)
	at com.kodedu.boot.AppStarter.lambda$start$0(AppStarter.java:73)
	at com.kodedu.boot.AppStarter$$Lambda$54/1397135831.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationController': Failed to introspect bean class [com.kodedu.controller.ApplicationController] for lookup method metadata: could not find class that it depends on; nested exception is java.lang.NoClassDefFoundError: javafx/scene/control/TextInputDialog
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:269)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1118)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1091)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
	... 22 common frames omitted
Caused by: java.lang.NoClassDefFoundError: javafx/scene/control/TextInputDialog
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.access$100(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.access$100(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
	at java.lang.Class.getDeclaredMethods(Unknown Source)
	at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:613)
	at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:524)
	at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:510)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:247)
	... 34 common frames omitted
Caused by: java.lang.ClassNotFoundException: javafx.scene.control.TextInputDialog
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 65 common frames omitted

Do you use bundled JRE or your own one ?

running windows.
java -version
returns
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

I did download asciidocfx without JRE.

It works if I download asciidocfx  with JRE, but I do not understand why?

javafx.scene.control.TextInputDialog is available after 1.8.0_U40

authors: hsesa rahmanusta

repo: asciidocfx/AsciidocFX


text:
Incorrect handling of inline AsciiMath

This a follow up to https://github.com/asciidoctor/asciidoctor-mathematical/pull/82#issuecomment-632622291. I recently implemented AsciiMath support. It has just been released.
However, I now realize the asciimath inline macro is incorrectly handled. Basically, it is handled in exact the same way the latexmath inline macro is. That means the macro is not processing AsciiMath code, it's actually processing LaTeX directly. In other words, currently the asciimath inline macro is functionally equivalent to the latexmath inline macro. This is an error.
I'm working on a patch, but I may need some help on it. This issue was cause by my inability to comprehend how inline stem blocks are currently handled. I think I've now got things figured out, but I'd like someone to review the patch in detail to make sure the implementation is not broken again.

It is also worth noting that the asciimath block macro is working correctly.

This issue could be avoided in the future with the introduction of tests targeting the rendering of the asciimath inline and block macros.

We need to refactor the code now. After a lot of edits, the code is messay.

Fixed on 050841e.

authors: GarkGarcia ProgramFan

repo: asciidoctor/asciidoctor-mathematical


text:
[BUG]: Login emails are badly generated resulting in SPAM mark

Describe the bug
Emails generated by asciinema have serious content issues resulting in them being marked as spam.
The issues concerning the email generation are:

MISSING_MID (2.5)
SUBJ_EXCESS_BASE64 (1.5)
FROM_EXCESS_BASE64 (1.5)
CTYPE_MIXED_BOGUS (1)
MIME_BASE64_TEXT_BOGUS (1)
HFILTER_URL_ONLY (0.390789) [0.17763157894737]
MIME_BASE64_TEXT (0.1)

The mail server for asciinema.org has an additional issue that I will report to the admin directly as per the guidelines.
To Reproduce
Steps to reproduce the behavior:

Log into asciinema.org (or your own instance)
See the login email
Open email source
See the X-Spamd-Result header

Expected behavior
These spam detection issues not being present
Versions:
asciinema-server: 20240515
Additional context
These values/problems were detected by rspamd.

[!Note]
From talking with docker-mailserver developers I get that those issues are serious and emails like this are intended to be marked as spam by spam filtering services.
https://github.com/docker-mailserver/docker-mailserver/issues/4007#issuecomment-2120441908

Hey @jiriks74, thanks for reporting.
I've now (with this commit https://github.com/asciinema/asciinema-server/commit/ac895d266db603cc68fd8f6c9f75708325d76410) switched the email client library (the previous one was rather unmaintained), and I believe this should improve things.
You can check it on asciinema.org already. I've inspected the raw email messages and they now include Message-Id, have no unnecessary Base64 encoding.
If you'd like to test this change against your email setup then, until I release a new version, you can build asciinema server container image from the develop branch.

Some small issues are still present but it's significantly better. The small issues are:

MID_RHS_NOT_FQDN (0.5)
HFILTER_URL_ONLY (0.421122) [0.19141914191419]
MIME_HTML_ONLY (0.2)

The first one may be cool to solve but the other two are not that big of a deal (it seems). One is that there's only HTML and not text in the email (fine IMHO) and the other is URL only in body which I don't even know what it wants (but it's only 0.4 points so it's fine).
The MID_RHS_NOT_FQDN has Message-ID RHS is not a fully-qualified domain name shouldn't be that hard to fix (from what I can see about this) and then you'd be under 0 with the points.
There's also the issue with your SMTP server that I emailed you about as it's specific to your (if you're admin@asciinema.org) server not this project. If you're able to fix the MID_RHS_NOT_FQDN and the issue I emailed you about you'll be under 0 with spam rating so your emails shouldn't ever get greylisted or even moved to spam!

Great fix! When do you plan the next release?

Chiming in here, your fix @ku1ik looks very good!
I concur with @jiriks74: MID_RHS_NOT_FQDN is not too bad (0.4 is not that much), but fixing it is probably a good idea. The rest is pretty harmless, and I wouldn't bother.

Thanks guys. This is super helpful. I'll fix MID_RHS_NOT_FQDN :+1:

The Message-ID is now improved in https://github.com/asciinema/asciinema-server/commit/5c84f04145dd2cebfc673b4decf52e4644a0020a . I think I'll stop here now :sweat_smile:

Great fix! When do you plan the next release?

I haven't planned a new one yet, but I suppose I could make one in a day or two.

LGTM! Looking forward to updating.

New release is out: https://github.com/asciinema/asciinema-server/releases/tag/v20240523

repo: asciinema/asciinema-server


text:
feat: ✨  add asdf-svu plugin repo

cc @caarlos0

...closing and recreating the PR.. I did this from the wrong account

repo: asdf-community/infrastructure

license: ISC


text:
Adding hover effect on social media icons

Assign me this issue i will fix it

Would like to work upon this issue


text:
Feature Request: App Factory Support

The current implementation works great for small single module apps, but when you start using application factories (http://flask.pocoo.org/docs/patterns/appfactories/) and several modules, things don't really work.  Say you have a tasks module like so https://gist.github.com/816650.  If you're imports aren't exactly right in a black magic kind of way, this will blow up every single time.  Is there a better way to do this I'm just missing?
-Lucas

Cool, do you have anything I can look at yet? :)

With "The Big Instance Refactor" from celery 2.3.3+ (http://ask.github.com/celery/internals/app-overview.html), I got it working out of the box.
Example:
https://gist.github.com/1326477
The ability to just say celery = Celery(); Task = celery.create_task_cls(); and then configure it later is awesome. Just as long as you treat that celery.app.App instance the way you'd treat an unbound SQLAlchemy session (i.e. don't expect any of the config info at import time - which you shouldn't do anyway) then it works fine.

I have yet to come up with anything as easy or clean as just putting the imports and apply_async calls in blinker signals.  Thanks Al.  We're on 2.3.1 now.  I'll give 2.3.3+ a try when I get some more time.

Decided to revisit after upgrading to celery 2.4.6.  Al's solution didn't work correctly in all cases for us, just sent #15 which I think finally has a solution.

authors: ask imlucas thatdatabaseguy

repo: ask/flask-celery


text:
Add Docker & Home Assistant support

Thank you for your work to date. I started on a Home Assistant integration but found it too complicated. I have containerised the great work you have done and provided some instructions on how to utilise the server from the container in Home Assistant.

Also added some changes to catch errors when calling the Battery service. Same needs to happen for locking too.

Thanks for your work! I'll add more logging and error catching in next days.
The error with communication (that you mentioned in README) occurs also without anything locking BT adapter - more interesting, it seems to happen after some uptime. I have only yeehack server on my RPi and it stops working after 1 to 2 days, but if I'm not using it, it'll work again. Very strange, so I'll add more logs and will try to debug that.


text:
[Question] Aggregation/Removal of Credential Issuers

This is probably a basic question about the way Coconut works, and I'm guessing this is a proper channel to ask. If not, I'd appreciate any pointers to other means for discussion.
My understanding is that a Coconut system presents a set of advantages as long as the list of "authorities" is fixed. That is, if new entities are aggregated to (or existing ones are removed from) the issuers' list, all keys have to be re-calculated. My precise question is: what are the implications of this re-calculation? Does this mean that older proofs lose validity (cannot be verified anymore)? Could anyone explain the disadvantages of this "variability" with regard to the list of issuers? Also, are there known ways to mitigate these disadvantages? Are there considered cases where variability of the authority set is expected and Coconut can still work as a fitting crypto-system for that scenario?
I'm still trying to understand this scheme, so any pointers in favor of helping me comprehend it further on this regard are highly appreciated.
Thanks.

Thanks a lot for the detailed answer. I'll definitely get back to you with any ideas that arise with regard to this limitation, since it seems to me that solving the problem of authority set variability would allow applicability for a wide spectrum of use cases . I'm still in the process of actually understanding the whole scheme, though.
Again, thanks for the reply and the blog post link. 👍

repo: asonnino/coconut


text:
Fresh install won't start

I created a brand new project and it won't start.  My VS details:
Microsoft Visual Studio Enterprise 2017
Version 15.9.11
VisualStudio.15.Release/15.9.11+28307.586
Microsoft .NET Framework
Version 4.7.03056
When the page loads (IIS express seems to die and the IDE doesn't stay in debug mode) it displays:
HTTP Error 502.5 - Process Failure
Any help would be appreciated.
Thanks,
Andrew

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 261c9875-3db6-4d30-f9d6-922a9334ecb2
Version Independent ID: b8f8f7c4-9c90-869d-9fd7-a887bc28f262
Content: Use the React project template with ASP.NET Core
Content Source: aspnetcore/client-side/spa/react.md
Product: aspnet-core
Technology: aspnetcore-clientside
GitHub Login: @SteveSandersonMS
Microsoft Alias: scaddie

Update to VS 19
Try dotnet run

authors: Rick-Anderson andrewleith


text:
Is there a possibility to change the PasswordHasher

I have a ASP.NET Web Application (.NET Framework/Angular) and a ASP.NET Core Web Application (Angular). I would like to use the same Identity Database. But it seems that there are different password hasher used. Can I change ASP.NET Core Web Application (Angular) to use the same as ASP.NET Web Application (.NET Framework/Angular)?
See also: https://stackoverflow.com/questions/58569980/asp-net-authentication-net-framework-net-core-side-by-side-angular

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 21cb7455-3305-9316-5440-bdc22947a82d
Version Independent ID: 137d4b94-7b26-3911-b22d-42c754a95fc1
Content: Introduction to authentication for Single Page Apps on ASP.NET Core
Content Source: aspnetcore/security/authentication/identity-api-authorization.md
Product: aspnet-core
Technology: aspnetcore-security
GitHub Login: @javiercn
Microsoft Alias: scaddie

See Password Hasher options. You can configure CompatibiltyMode and set it to IdentityV2.

thankx serpen5. it works! I also had to issue the following sql command:
UPDATE dbo.AspNetUsers SET NormalizedUserName = UPPER(UserName);
For more details, one may find some more information here https://github.com/iwhp/AspNetIdentitySideBySide


text:
ComponentBase Async Methods aren't Async by Default

Describe the bug
In the "@Functions" section of a Blazor Component, when using the auto complete of the virtual async methods (That can be overriden), the generated code from the auto complete doesn't have an "async" tag on the method.
To Reproduce
Steps to reproduce the behavior:

Using ASP.NET Core 3.0 Preview 5
Add a "@functions" section to a Blazor Component
Auto complete a virtual method to override it (Example: OnAfterRenderAsync)

Expected behavior
The auto completed method would include the "async" tag on the method.
Code Details
// Produced
protected override Task OnAfterRenderAsync()
{
	return base.OnAfterRenderAsync();
}

// Expected
protected override async Task OnAfterRenderAsync()
{
	await base.OnAfterRenderAsync();
}

This is the same as the behavior of all C#. I'd suggest reporting this suggestion at https://github.com/dotnet/Roslyn

authors: kevinjpetersen rynowak

repo: aspnet/AspNetCore


text:
New gRPC project with Docker

Create a new gRPC project
Select Docker
Run project in VS with Docker

Expected:
I can call my gRPC service with https
Actual:
Visual Studio launches Docker with only a http port
@shirhatti can you look into what we want to do here?

What launchSettings.json contains when a new gRPC project with Docker is created:
{
  "profiles": {
    "Server": {
      "commandName": "Project",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "https://localhost:5001"
    },
    "Docker": {
      "commandName": "Docker",
      "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
      "environmentVariables": {},
      "httpPort": 55000
    }
  }
}

What is required to have a HTTPS port:
{
  "profiles": {
    "Server": {
      "commandName": "Project",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "https://localhost:5001"
    },
    "Docker": {
      "commandName": "Docker",
      "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
      "environmentVariables": {
        "ASPNETCORE_URLS": "https://+:443",
        "ASPNETCORE_HTTPS_PORT": "44378"
      },
      "useSSL": true,
      "sslPort": 44378
    }
  }
}

ping @shirhatti

{
  "profiles": {
    "GrpcService6": {
      "commandName": "Project",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "https://localhost:5001"
    },
    "Docker": {
      "commandName": "Docker";
      "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
-      "publishAllPorts": true
+      "publishAllPorts": true,
+      "useSSL": true
    }
  }
}

@JamesNK I just tried this. I believe your workaround is not required. All that's missing is the useSSL property in launchSettings

I'll send a PR to fix the template

Pinging @pratiksanglikar to sanity check this as he's the most familiar with this

We look for the useSSL flag followed by whether https is present in the applicationUrl to determine if https is supported.
In a new gRPC project I created, it looks like the https mapping was not created.
I will dig into it to see what the actual problem is.

Hi @JamesNK , @shirhatti  this bug had been fixed in 16.3 but was regressed with one of our recent changes for port mappings.
It has been recently fixed and would be available in 16.5 P1.

Great, thanks.
Since it has been broken twice, is there additional testing to keep it working into the future?

I'll add an OGF for our CTI to test gRPC apps in the full round of testing.

Great.
Nothing else to do here. Closing.

authors: JamesNK pratiksanglikar shirhatti


text:
CDN

Make Blazor DLLs available from a CDN

Is anything happening here?
I try to load blazor app from azure CDN linked to azure storage but no success yet.
Blazor is working well as static website from azure storage.
I want to enable it from CDN because of load speed and also CDN compression support.
I put whole (not only dlls) blazor app to CDN and when calling index.html it give this error:
WASM: System.InvalidOperationException: 'Router' cannot find any component with a route for '/index.html', and no fallback is defined.

Hi!
I have been happily hosting my blazor apps on github pages with a custom domain. A few days ago I tried a default Blazor Hosted application on Azure Websites and my Avast antivirus was blocking my specific application dll (not the ones from the framework) saying that it didn't have enough positive feedback on that dll. The funny thing is that Avast complains about the ddl if I load the site from app-name.azurewebsites.net but not from localhost or one of my "real" domains: weird.
On the topic of the dll extension replacement i would like to push for the wasm extension (even if not tecnically correct) because github pages and cloudflare are already handling the compression for "application/wasm" but not for "application/octet-stream" so a default Blazor app weights about 3.2 MB having only mono.wasm compressed with brotli.
(Sorry @Lupusa87 , I never tried tha Azure cdn so I have no suggestions on that)

@Lupusa87 Since this issue is tracking something different (hosting the Blazor runtime on a common CDN), could you please open a new issue with more details on how to reproduce the problem you are seeing? We need to know what version of Blazor you are using, what does the app code look like, how did you publish it to the CDN, etc.


text:
get controller and action name from RewriteContext or HttpContext

I'm trying to create a redirect for canonical urls, so that requests for
/Contr1/action1
/contr1
will redirect to
/Contr1/Action1
/Contr1
and for now I've created this rule:
public class MyRule : IRule
{
    public void ApplyRule(RewriteContext context)
    {
        var path = context.HttpContext.Request.Path;
        ///var controllerName = ???
    }
}

but I can't find how to get the controller and action name

Hi. Thanks for contacting us.
We're closing this issue as there was not much community interest in this ask for quite a while now.

authors: mkArtakMSFT omuleanu


text:
Tasks returned from JSRuntime.InvokeAsync during OnInitAsync never finishes in preview3

Describe the bug
Tasks returned from JSRuntime.InvokeAsync during second call to OnInitAsync (after prerendering) never finishes.
To Reproduce
Create a new razorcomponents project.
Add a js interop function to Index.cshtml and disable prerendering

    <app></app>

Call js interop during OnAsyncInit in Index.razor

@Greeting!

Welcome to your new app.

@functions {
    string Greeting;

    protected override async Task OnInitAsync()
    {
        try
        {
            Console.WriteLine("Calling browser");
            Greeting = await JSRuntime.InvokeAsync<string>("interopDuringOnInit");
            Console.WriteLine("Returned from browser");
        }
        catch (Exception ex)
        {
            Console.WriteLine("Could not invoke interop during OnInit, " + ex.ToString());
        }
    }
}

When OnInitAsync is called as part of an initial load (prerendering disabled) the task never finishes, This leaves the circuit hanging, and no further events are processed.
If this component is loaded from a IUriHelper.OnLocationChange, the above code works as expected.

I just switched an existing app which worked fine to the new version and got the same problem: IJSRuntime.InvokeAsync() neither returns nor throws an error on call paths from OnInitAsync().
Is there a work around or did I do something fundamentally wrong? (which I don't believe because the same app worked since Blazor 0.3 and did every version upgrade, got converted to server side Razor Components weeks ago.)

Same probleme here - the await for JSRuntime.InvokeAsync() in an component's OnInitAsync() does block forever.

I migrated my code to preview 3 and I also ran into this problem.
Please fix this!

Does anybody has news / a workaround for this issue?

@javiercn, can you please look into this? Thanks!

I also got that problem. Anything worked fine before.

I have hacked around it by wrapping wrapping the router component in an if (Started), where Started is set to true after a round trip to the client. It's not exactly beautiful (and it breaks prerendering), but it unblocks the issue for me until the underlying issue is fixed.
In App.razor, delay loading the router until we have received a message from the client
@if (Started)
{
    <Router AppAssembly="typeof(Startup).Assembly" />
}
else
{
    <text>Waiting for Asp.Net Core 3.0 Preview3 Workaround...</text>
}

@functions {
    bool Started = false;

    [JSInvokable]
    public void Start()
    {
        Started = true;
        StateHasChanged();
    }

    protected override void OnInit()
    {
        _ = JSRuntime.InvokeAsync<object>("StartMe", new DotNetObjectRef(this));
    }
}

And adding window.StartMe to index.cshtml, calling back to the App component

Not only does this happen on OnInitAsync but also on OnParametersSetAsync

I've confirmed that it happens on all of the lifecycle events; the task never returns.
Is there a work around that doesn't break prerendering?

@honkmother I'm afraid that using any JS interop is not allowed in prerendering.

I am not calling it during prerendering.
https://github.com/SQL-MisterMagoo/PreRenderComponent allows us to detect when the prerendering is active and avoid making JS Interop calls during it.

@kvantetore I found an alternative work-around. It would appear if you call the InvokeAsync inside of the body of a component rather than the lifecycle methods it gets properly executed. I don't know exactly when it is executed, but I imagine it is right prior to OnAfterRender.
ex. at the end of Component.razor, prior to @functions { ... }
@ { if (IsPreRendering == false) await JSRuntime.InvokeAsync<string>("interopDuringOnInit"); }

@javiercn can you please confirm whether this is fixed already?

@mkArtakMSFT It is not.

Jus to add we see the issue as well. The javascript methods below just do console.log. When we use await the second method does not run but if we remove the await then they both run.
In our LayoutMain.cshtml file
    protected override async Task OnInitAsync()
    {
        base.OnInit();

        //Call any js event listener setup. Do this here because need to make sure the .NET side is loaded in the browser.
        await jsRuntime.InvokeAsync<bool>("initScreenFull");
        await jsRuntime.InvokeAsync<bool>("initializeListeners");

    }

@SteveSandersonMS I am able to repro this. I'm not sure what's going on here. I can see the method being invoked, but I don't get to receive anything on the server.

As far as I can remember in Razor Components the method will be invoked (and can be breakpointed) in the server but will exit from its thread prematurely and never finish websocket response.          On Tuesday, March 26, 2019, 5:43:29 AM GMT+9, Javier Calvarro Nelson notifications@github.com wrote:
@SteveSandersonMS I am able to repro this. I'm not sure what's going on here. I can see the method being invoked, but I don't get to receive anything on the server.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

I have also reproduced this on Blazor 0.9.0 during OnParametersSetAsync

I have also reproduced this on Blazor 0.9.0 during OnParametersSetAsync

Hmm, that's very informative. I thought this might have been due to some changes we did on compnents.server for preview3, but if it happens also on blazor then it might mean that is something at a lower level.

I am able to repro this. I'm not sure what's going on here. I can see the method being invoked, but I don't get to receive anything on the server.

OK, I'm guessing that means you're still investigating, but if you feel you're at a dead end please let me know.

Here is how I reproduced it on Blazor 0.9

Create a new Blazor app
Create the following component: MyComponent.cshtml

My Component

@functions{
    [Parameter] EventCallback ParametersSetHandler { get; set; }
    protected async override Task OnParametersSetAsync()
    {
        if (ParametersSetHandler.HasDelegate)
        {
            await ParametersSetHandler.InvokeAsync(null);
        }
    }
}

Consume the component in the Counter.cshtml page like so:

@inject IJSRuntime jsRuntime
<MyComponent ParametersSetHandler="@ParametersSetHandler" />
@functions{
    protected async Task ParametersSetHandler()
    {
        var result = await jsRuntime.InvokeAsync<int>("getVal");
        Console.WriteLine($"Result: {result}");
    }
}

Add the following script in index.html:

Run the app and navigate to /counter page

Result:
The browser is stuck, like being in an endless loop, never finishing the task.

@stavroskasidis I don't think your repro code is related to this issue. The code you've posted has a bug that will cause an infinite loop: each time MyComponent calls ParametersSetHandler.InvokeAsync(null), that will cause the owner of ParametersSetHandler (i.e., its parent) to re-render. Its parent will then re-render the child, which immediately tells the parent to re-render again, and so on.

@SteveSandersonMS Oh... ok, that makes sense. Sorry for the inaccurate report then.
However what would be a workaround for this case, having an EventCallback that is executed inside OnParametersSetAsync? Isn't it easy to fall into this trap?

However what would be a workaround for this case

An EventCallback is to notify a component that an event has occurred and it should re-render. Since that doesn't seem to be what you want in this case, don't use an EventCallback.
If you have further questions about this, could you please file them in a separate issue? That will help keep this one on topic.

I've tracked this down. It's among the changes we made for circuit lifetime and prerendering. What happens is:

SignalR has a message loop that does an await for you to process each message. Until you finish handling each message, it won't listen for the next message.
Our StartCircuit method does an await Renderer.AddComponentAsync for each of the root components. This doesn't wait just for the initial render - it now actually waits for quiescence.
So, if you have some component that doesn't quiesce until some JSInterop call completes, then you'll be blocking the SignalR message loop until that JSInterop call completes, but it can't complete because the SignalR message loop is blocked so it can't receive the response from the browser.

Proposed solution: StartCircuit should not wait for quiescence. It should only wait for the initial render.
For example, we change this line of code: https://github.com/aspnet/AspNetCore/blob/master/src/Components/Server/src/Circuits/CircuitHost.cs#L116 so that it doesn't await, but rather just kicks off the AddComponentAsync task in the background (and deals with error handling asynchronously by some typical mechanism).
@javiercn @pranavkm @rynowak Do any of you have any concerns or disagreement with this solution?

Actually the right fix might just be to guarantee we never pause the SignalR message loop.

Since we have our own sync context I agree with all of the above.
The reason to pause the message loop is to guarantee ordering. We implement ordering ourselves.

I was going to comment on this but I was on vacation 😄. Sorry you had to spend your time investigating this @SteveSandersonMS. There's an issue in SignalR to allow a maximum number of concurrent invocations (it should really be more than 1), that should help solve this issue.
cc @anurse @BrennanConroy @halter73

Proposed solution: StartCircuit should not wait for quiescence. It should only wait for the initial render.

Agree. It should not wait at all, and deal with errors in the way we do in other places. We should just wrap the task to get notified and that's it.
Once StartCircuit has been called the connection must be up and running already so UpdateDisplay should work just fine.

There's an issue in SignalR to allow a maximum number of concurrent invocations (it should really be more than 1), that should help solve this issue.

https://github.com/aspnet/AspNetCore/issues/5351
If this is important for Razor Components, please let us know so we can prioritize appropriately.

Turns out that in general we don't block the SignalR message loop. In all cases except one we just hand off to the circuit's dispatcher and the call is synchronous from SignalR's perspective.
The one bad case was StartCircuit which did not do this. I've fixed this in #8863 by making CircuitHost.Initialize synchronous. The upstream caller is free to continue handling other incoming messages as soon as CircuitHost.Initialize has dispatched the "init" logic to the renderer's sync context, because that's then guaranteed to run and complete before anything else gets handled.

@davidfowl Thanks for the info. I wasn't regarding this as a SignalR issue since, even if SignalR did allow concurrent hub method invocations, we'd have had a different problem where you could have received incoming JSInterop calls before the circuit was flagged as started. The underlying false assumption is now fixed in #8863 so neither problem occurs.
Totally agree it would be good for SignalR to have the flexibility to handle parallel messages in general though.

Has this been fixed yet?
I can reproduce this using the latest public version.
This returns a Task that never ends:
var cnt = JSRuntime.InvokeAsync("interop.primes", n);
This does not return at all, no matter where I call it from.
var cnt = await JSRuntime.InvokeAsync("interop.primes", n);
Unless I am missing something, this means I can't get results back from JavaScript at all.

Actually to understand what happen when trying to launch a task on Blazor you should understand JavaScript execution lifecycle.
To sum up, any task in a JavaScript environment in the context of the browser (Safari, Chrome , Edge, ...) cannot ne executed when the current task is running. That means you are dead locking when trying to wait the initiated task by JSRuntime.InvokeAsync<...>(“functionName”,...).AsTask().Wait() in a “synchronous” Blazor function.
The solution is to always perform those task calls in a sync containing function and call StateIsChanged() function to say to the browser that the model was updated and that it should refreshed

I got the same problem calling Google Maps API in component's Dispose method (I need to remove markers on map). s problem setting limit of waiting time:
public void RemoveAll()
{
var tasks = new Task[2]
{
Task.Run(async () => await GoogleMapInterop.RemoveAllMarkers()),
Task.Run(async () => await GoogleMapInterop.RemoveAllPaths())
};
Task.WaitAll(tasks, TimeSpan.FromSeconds(1));
}

Doesn't Blazor support IAsyncDisposable? Task.WaitAll feels so aged.

This method is called from Dispose: I need to call GooleMapsAPI for removing markers and paths from map.  All works fine except page refresh (F5). Do you know another way? Please tell it me.

Doesn't Blazor support IAsyncDisposable? Task.WaitAll feels so aged.

Not yet.

And where is problem? One can use any operator or expression unless it
marked with 'obsolete'. It would be very strange if someone will state that
'foreach' is too old and only asynchronous version of the operator is
legal. I proposed the solution write your one if it works better.
2019-12-17, an, 16:17 Sören Nils Kuklau notifications@github.com rašė:

Doesn't Blazor support IAsyncDisposable? Task.WaitAll feels so aged.
Not yet. https://github.com/aspnet/AspNetCore/issues/9960
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/aspnet/AspNetCore/issues/8274?email_source=notifications&email_token=AADHFL7NGZBVEK4RDS5CMEDQZDNPFA5CNFSM4G4LVJM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHCQGFI#issuecomment-566559509,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AADHFL7LLUAJEUOKOOM6R73QZDNPFANCNFSM4G4LVJMQ
.

--
Gediminas Bukauskas
SKYPE: gediminasbuk
Phone: +370 37 793622
Mobile: +370 611 31090
E-mail: gbukauskas@gmail.com

Hi, it looks like you are posting on a closed issue/PR/commit!
We're very likely to lose track of your bug/feedback/question unless you:

Open a new issue
Explain very clearly what you need help with
If you think you have found a bug, include detailed repro steps so that we can investigate the problem

Thanks!

authors: Bernardo-Castilho DNF-SaS KP-WhatEver Knudel SteveSandersonMS anurse chassq chucker cosXsinX davidfowl gbukauskas honkmother javiercn kvantetore mkArtakMSFT pranavkm rynowak springy76 stavroskasidis vertonghenb


text:
Do not return an top lever parameter analyzer warning for some types

Fixes https://github.com/aspnet/AspNetCore/issues/6945

I’m unsure about this to be honest. It feels a bit weird to base this solely on whether the type is a value type or not. Special-casing those other three types doesn’t really make it nicer. I fear that this will eventually lead to new problems, since this adds the possibility for false positives in addition to the already existing false negatives. So this would only make the warning more confusing than it already is.
Since there isn’t really a way to properly match what the framework will do at runtime, maybe we should shift the focus of the analyzer instead. For example, we could make it discourage the usage of custom types where a property with the same name as the parameter occurs. If we then adjust the message of the analyzer, we can make this make more sense too.
For example, we could check for any type outside of System.** and if there’s a match, the analyzer would explain what could go wrong and suggest renaming either the property or the parameter.

A property on the type 'CustomType' has the same name as the parameter 'value'. This may result in incorrect model binding. Consider renaming the parameter or the property of the type to avoid conflicts. If you are using an explicit type converter for 'CustomType', you can suppress this message.

🆙 📅

authors: poke pranavkm


text:
Allow EnableBuffering + Json.NET \ Xml input formatters to work better

With EnableBufering, using Newtonsoft.Json or a XML input formatter
will throw a sync IO exception by default. Instead actively drain
the stream before deserializing the content.
Fixes https://github.com/aspnet/AspNetCore/issues/16615

/cc @Pilchie \ @mkArtakMSFT for 3.1.0-preview3 consideration

Approved for 3.1.0-preview3.

authors: Pilchie pranavkm


text:
Fix “must comprised of”

The first commit fixes a grammatical error.
The second commit avoids the newer sense of the word ‘comprise’:

Although it has been in use since the late 18th century, sense 2 is still attacked as wrong. Why it has been singled out is not clear, but until comparatively recent times it was found chiefly in scientific or technical writing rather than belles lettres. Our current evidence shows a slight shift in usage: sense 2 is somewhat more frequent in recent literary use than the earlier senses. You should be aware, however, that if you use sense 2 you may be subject to criticism for doing so, and you may want to choose a safer synonym such as compose or make up.

https://www.merriam-webster.com/dictionary/comprise#usage-1-anchor

Oops, deleted the wrong branch in my fork. Sorry!

Hmm, does this change improve readability in a substantial way? Grammar/usage "rules" are typically descriptive, not prescriptive, so the question is: what wording would most people be able to mostly understand, as opposed to "does a rule exist somewhere that says this is right/wrong." I don't know the answer to that, though.

Yes, great point! Descriptivism is the only realistic or useful philosophy in my opinion. I'm in favor of whatever is the most readable or professional from your point of view.
Would you prefer I leave the 'is comprised of' or find another wording, such as 'A combination of in the case of the enum flags?

#grammarnerds
I think the one that sounds most off to me is https://github.com/aspnet/AspNetCore/pull/7519/files#diff-bf4ec3339b253002eb8be7272b5eaea7 .

How about, "Gets or sets the minimum number of unique characters which a password must contain"?

Yeah that sounds great. Simpler English is good!

Okay, what do you think of the new changes?


text:
A compatible SDK version for global.json version: [2.1.300] ... was not found

I was getting this when trying to follow the Getting Started guide.  I found my version number by using dotnet --version (it was 2.1.401) and then I replaced the 2.1.300 into the global.json.
The Getting Started does work at this point, are there any known problems with using a slightly later version of the dotnet SDK?

Nope, using a later SDK is fine. We'll be removing the global.json files in our next release. Sorry about the confusion!

Same problem here. After creating the application through VS, change the file "global.json" in your solution directory to use the SDK version you have installed. E.g., for 2.1.402,
{   "sdk": {     "version": "2.1.402"   } }
And now the "Hello World" example works. -K

repo: aspnet/Blazor


text:
Html meta tags, page title

Hello people
You guys are doing a wonderful job with Blazor :-)
I have a question regarding Html meta tags. The app itself will be placed in the app element on the page. But how about stuff in the header? Like meta tags and so on.
Let say I would like to change/update meta tag data depending on what page (in the app).  Or just update the page title.
How to do this? By Javascript interop?

Good question. I was thinking about this problem in my own application and so far I have no solution. Think about server side rendering in the future. Correct meta tags are essential for SEO, for integration with Facebook/Twitter, etc.
I hope that we will be able to create multilingual Blazor applications in the future. To do it correctly we have to handle lang attribute in html element.
We have to be able to modify main index.html file from Blazor application and selected solution have to be compatible with server side rendering.

Yes exactly. My vision/hope is that Blazor will be "the new way" of doing web pages. Like replacing the "old way" of doing server-rendered pages. If we(you) could find a way how to handle stuff outside the app element, like Meta tags, title etc. Then the game is afoot :-)

I have found yet another example why we need a way to modify HTML page elements outside of out Blazor application tag. We can have an application with multiple pages and someone can add a link to Favourites in the web browser. Link should have proper title - otherwise links to different pages are indistinguishable.

For most nontrivial Blazor apps, you'll want some notion of a data store that issues notifications when its state changes. There's an example of this in the FlightFinder sample: https://github.com/aspnet/samples/tree/master/samples/aspnetcore/blazor/FlightFinder
With this kind of architecture, you can have "page title" as one of the data items tracked in the store, and can subscribe to that in your layout to change the <title> element's contents whenever that changes.

@SteveSandersonMS How do you change the content of the  element located in  in index.html?

@DNF-SaS Yes

@SteveSandersonMS Thank you for suggestion. Of course we can use data store and modify what we want in JavaScript (title, metatags, etc.). But in the future we will have server side rendering. It would be nice to find a solution which will work on the client and on the server.
In ordinary ASP.NET Core application I have a base ViewModel for all my pages. I use this base class in _Layout.cshtml like this:
@model ViewModelBase
<!DOCTYPE html>

<title>@Model.Title</title>
@if (!string.IsNullOrEmpty(Model.OgVideo))
{
    <meta property="og:video" content="@Model.OgVideo" />
}

As you can see I assume that some model properties (Language, Title) are always available and I render them unconditionally. On the other hand not every page has video which can by shared on social sites and og:video metatag is rendered conditionally.  It would be nice to have similar experience on the client. Maybe it is possible to add some event to the router (for example OnHeadRender). In that event we should be able to render at least the opening  tag and . This event probably should be executed after OnParametersSet - page component should have a chance to set some state in global data store (similar in concept to my base ViewModel in ASP.NET Core application).
I understand that it is not a high priority task at this stage of Blazor development, but I think it should be tracked somewhere.

If would be great if you had a namespace (or helpers) to manage header's metadata (such as title, meta keywords), and also a set of helpers to manage Cookies, and also a wrapper to the windows javascript namepace !

@topnguyen Correct, the story is pretty much the same.

Still no solution?

I have similar problem for seo purposes,
I need to be able to modifiy title and description tags for every "page"

I used a bunch of ugly JS-Interop and pre-rendering pages as static HTML to get crawlers working around; but it's definitely not ideal.
It would be really great to see a "MetaHelper" built into Blazor akin to UriHelper where I can just call MetaHelper.Links["en"].href = "XYZ"; or MetaHelper.Title = "XYZ";

Is there an official recommended way to solve this yet?
The only way possible right now seems to build the whole site with .cshtml + .razor pairs, for example:
Home.cshtml (which renders the home component)
Home.Razor
Products.cshtml (which renders the products component)
Products.razor
etc...etc...
This way you create a hybrid approach, in which everything in the page is interactive (without postbacks), except links to other pages which would trigger the browser redirect to another .cshtml razor page, each one with its custom head tags.
Is there a known better solution?
Also even this solution doesn't work since   link tags seem to be catched by the framework blocking the browser to properly redirect.
(issue which is being tracked here https://github.com/aspnet/AspNetCore/issues/9834 )
Regards!

Currently the simplest and cleanest solution is to use JS interop to modify the document state.
We are planning to improve this, though we don't have a final design or ETA yet.

JS Interop? What? No!
You don't even need anything sophisticated to do this.
This is terrible code made one late night in 0.9 but it should give you an idea on how to do this; you can probably do this more way efficiently.
Basically, create an html component, a body component, and a head component; render the html component in Index.cshtml; put a reference to the Head Component inside a Metatag Container; set the reference to "this" from the Head component upon init, and also pass this container into the Body component and whatever is inside of the body.
From there you can update the Head component, which will update the SEO tags as expected.
Here's what my Index.cshtml looks like
@page "{*clientPath}"
@using dao.Server
<!DOCTYPE html>

@(await Html.RenderComponentAsync())

Then I have two classes called "html" and "metatags".
    public class html : ComponentBase
    {
        public static string HeadTXT = File.ReadAllText("head.htm");
        Metatags meta = new Metatags() { Title = "some title" };
        protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
        {

            builder.OpenElement(0, "head");
            builder.AddMarkupContent(1, HeadTXT);
            builder.OpenComponent(2);
            builder.AddAttribute(3, "MetaInfo", meta);
            builder.CloseComponent();
            builder.CloseElement();

            builder.OpenElement(4, "body");
            builder.OpenComponent(5);
            builder.AddAttribute(6, "MetaInfo", meta);
            builder.CloseComponent();
            builder.AddMarkupContent(7, "");
            builder.CloseElement();

        }
    }

    public class Metatags
    {
        public string Title { get; set; } = "example.nyc — weirdest hack ever";
        public string Description { get; set; } = "testing";
        public Head Component;
    }

A "body" Component.
<DetectPrerender MetaInfo="@MetaInfo">
    <Router AppAssembly="typeof(Startup).Assembly" />
</DetectPrerender>

@functions {

    [Parameter]
    private Metatags MetaInfo { get; set; }

}

And a "head" component.
@using example.Shared

<title>@MetaInfo.Title</title>
<meta name="description" content="@MetaInfo.Description">
@{
    MetaInfo.Component = this;
}
@functions {

    [Parameter]
    private Metatags MetaInfo { get; set; }
    private bool ShouldRend = false;
    protected override bool ShouldRender()
    {
        if (ShouldRend)
        {
            ShouldRend = false;
            return true;
        }
        return false;
    }

    public void ShouldRe()
    {
        ShouldRend = true;
        base.Invoke(() => base.StateHasChanged());
    }

}

That's a nice way to do it where Blazor has full control over most of the document, but it could pose a mild load time issue in certain cases and still requires interop implicitly.

@honkmother does this work for client side blazor or only server side. And if it does work for client side blazor, can you provide a git repo showing your configuration?

@AlexYes it requires some minimal interop between the components; but doesn't need any Javascript.
I think this is close to as good as we can get in terms of patterns that already exists within Blazor. I wouldn't mind seeing a default HTML, Body, and Head tag with Dictionary structures, and having those references passed down a cascade or something.
@smartprogrammer93
It should work for both, but I would have to double check because for all I know ... could be a hard coded hook into the DOM; but I am almost certain if you rename App.razor to Html.razor, it will allow you to use the HTML element instead.
Client side might be a little different because you need the script tag in the document for Blazor to even boot up (where as serverside renders the components for you). I am 99% certain you can just throw the script tag inside of the loading placeholder.
After I'm done working today I will set up a repo with an example that works with preview4/5 for both the client and server.

authors: Andrzej-W DNF-SaS GoranHalvarsson SteveSandersonMS TheFanatr andras-ferencz chrdlx danroth27 desalbres evrenunal honkmother smartprogrammer93


text:
Making types in Microsoft.Extensions.DependencyInjection public

Fixes #315

And what's the real reason for this? What does this help?

Nothing in particular?

Then let's not do it now? :smile: These are some pretty obscure types...

:crying_cat_face:

I know, I know, so sad :sob:

Hmmm... I found this while looking at a way to use DI for testing.
Of course, there is TestServer with the whole Startup.cs and its ConfigureServices and Configure mechanism, but my application does polling from service bus and not HTTP requests handling, which makes it quite hard to use the TestServer.
Http messages only control the polling and processing mechanisms and report current status, if requested.
I suppose there is no way to get the same DI implementation that I get in web application, is there?
Maybe I'm doing something fundamentally wrong?

@DovydasNavickas could you file a new issue stating what you're trying to do and why you can't get it to work?

Done: https://github.com/aspnet/DependencyInjection/issues/445

authors: DovydasNavickas Eilon pranavkm

repo: aspnet/DependencyInjection


text:
Update Getting Started with ASP.NET MVC 5 to VS 2017 #4557

Running PR to upgrade Getting Started with ASP.NET MVC 5 to VS 2017 per #4557

@Rick-Anderson this is done, let me know if there any additional changes

For IN  aspnet/mvc/overview/getting-started/introduction/getting-started/_static/image1.png use

!!! Totally didn't even think of all my projects there. Update done

Can you make  aspnet/mvc/overview/getting-started/introduction/getting-started/_static/image1.png look more like the original? Use paint to resize it down 50%.

image under project, and it's a good place to start your application.
image4.png
is too big. Can you use a smaller window? You can shoot it with the snipping tool - I'm going through the changes now. Really nice work.

under
the image below, the port number is 1234. When you run the application, you'll see a different port number.
image5.png is too big

Oops, accidental closure.

updated getting-started images

edit the big images in notepad and resize to 50%
some you can get away with that. For
image4.png (under The controller is open in the IDE.)  it would be nice to reshoot. Make VS much smaller and take the shot.

image4.png resize 50 %

image5.png resize 50%

adding a view.
image7.png -I'd crop that to show just the markup or just the solution explorer. Or resize to 40%

The rest of the images look great. Nice work.

updated all images

@isaac2004  fantastic work. Much appreciated.

repo: aspnet/Docs


text:
Enhance KnownProxies/Networks content

Fixes #8632
Internal Review Topic (Nginx; Apache topic has the same text)
Internal Review Topic (Forwarded Headers topic)

Enhances KnownProxies/KnownNetworks line in Nginx and Apache topics.
Enhances troubleshooting content in Forwarded Headers topic.

cc: @michaelkrog @LindaLawton - You'll need to look at the diff to see the changes. The internal review topics are only available to MS folks.

btw @scottaddie A warning has cropped up on builds ...

Warning | Unspecified | codesnippet-not-found | aspnetcore/client-side/spa-services.md | Cannot resolve '../client-side/spa-services/sample/SpaServicesSampleApp/package.json' relative to 'client-side/spa-services.md'. | 0 | 09/20/2018 16:05:32

@Tratcher Ready for another look :eyes:.

@scottaddie Try the last commit. That's probably best.

@guardrex #8643 fixes the build warning you mentioned above.

authors: guardrex scottaddie


text:
Invalid sql generated for foreignkey reference

Version:7.0.0-beta4-12265
when
first:k ef migration add intital,
then:k ef migration apply
error info:
System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ')'.
The sql after 'REFERENCES' is invalid.
CREATE TABLE [AspNetRoleClaims] (
    [ClaimType] nvarchar(max),
    [ClaimValue] nvarchar(max),
    [Id] int NOT NULL IDENTITY,
    [RoleId] bigint NOT NULL,
    CONSTRAINT [PK_AspNetRoleClaims] PRIMARY KEY NONCLUSTERED ([Id]),
    CONSTRAINT [FK_AspNetRoleClaims_AspNetRoles_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [Id].[AspNetRoles] ()

This is a dupe of #1612

authors: bricelam cuiliang

repo: aspnet/EntityFramework


text:
Remove-Migration for last migration fails to remove model snapshot (at least on UWP apps)

Repro steps:

Create UWP application as described in http://docs.efproject.net/en/latest/platforms/uwp/getting-started.html (I haven't tried with other kinds of applications)
Stop after add-migrations step succeeds
Execute Remove-Migration -Verbose

Expected result:
Both last (and only) migration and model snapshot are removed.
Actual result:
Output is:
Using startup project 'App2'.
Using project 'App2'
Build started...
Build succeeded.
Using application base 'C:\Users\?\documents\visual studio 2015\Projects\App2\App2\bin\x86\Debug\'.
No configuration file found.
Using current directory 'C:\Users\?\documents\visual studio 2015\Projects\App2\App2\bin\x86\Debug\'.
Finding DbContext classes...
Using context 'BloggingContext'.
Removing migration '20160507012207_MyFirstMigration' without checking the database. If this migration has been applied to the database, you will need to manually reverse the changes it made.
Removing migration '20160507012207_MyFirstMigration'.
Removing model snapshot.
Done.
Value does not fall within the expected range.

(notice the error message at the end)
Since the snapshot still exists after this, attempting to add the migration again will create an empty migration

I having problems to reproduce this with the latest build, i.e. the snapshot is now removed correctly. I am unfortunately sure what was causing the issue before 😞  but leaving the issue open just in case the error "Value does not fall within the expected range." is a helpful clue.

The error  "Value does not fall within the expected range" is the same error thrown by #5383 which is fixed by #5476.

authors: divega natemcmaster


text:
The LINQ expression could not be translated and will be evaluated locally wrong warning.

Steps to reproduce
await
                        db.ProxyServerLoadResult.AsNoTracking()
                            .Include(x => x.ProxyServer)
                            .Where(x => !x.ProxyServer.BlockedByOperator)
                            .Where(x => x.SourceId == 1)
                            .OrderByDescending(x => x.Score)
                            .Take(100)
                            .Select(x => x.ProxyServer)
                            .ToListAsync();

The issue
I guess this warning is wrong. Am I right?
Exception message:

Warning as error exception for warning 'RelationalEventId.QueryClientEvaluationWarning': The LINQ expression 'join ProxyServer x.ProxyServer in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[RP.DataModel.ProxyServer]) on Property([x], "ProxyServerId") equals Property([x.ProxyServer], "ProxyServerId")' could not be translated and will be evaluated locally. To suppress this Exception use the DbContextOptionsBuilder.ConfigureWarnings API. ConfigureWarnings can be used when overriding the DbContext.OnConfiguring method or using AddDbContext on the application service provider.

Further technical details
EF Core version: 1.1.0
Operating system: Windows 10
Visual Studio version: VS2015U3

@AsValeO can you also post your model? Specifically code listings of all entities used and the contents of OnModelCreating method on the DbContext

ProxyServer.cs - entity
    public partial class ProxyServer
    {
        public ProxyServer()
        {
            BadUnit = new HashSet<BadUnit>();
            ProxyServerLoadResult = new HashSet<ProxyServerLoadResult>();
        }

        public long ProxyServerId { get; set; }
        public string Ip { get; set; }
        public int Port { get; set; }
        public DateTime Added { get; set; }
        public bool BlockedByOperator { get; set; }

        public virtual ICollection<BadUnit> BadUnit { get; set; }
        public virtual ICollection<ProxyServerLoadResult> ProxyServerLoadResult { get; set; }
    }
}

ProxyServerLoadResult.cs - entity
    public partial class ProxyServerLoadResult
    {
        public long ProxyServerLoadResultId { get; set; }
        public long ProxyServerId { get; set; }
        public int SourceId { get; set; }
        public long Score { get; set; }

        public virtual ProxyServer ProxyServer { get; set; }
        public virtual Source Source { get; set; }
    }

OnModelCreating
modelBuilder.Entity<ProxyServer>(entity =>
            {
                entity.HasIndex(e => new { e.Ip, e.Port })
                    .HasName("IX_ProxyServer_IP_Port");

                entity.Property(e => e.ProxyServerId).HasColumnName("ProxyServerID");

                entity.Property(e => e.Added).HasColumnType("datetime");

                entity.Property(e => e.Ip)
                    .IsRequired()
                    .HasColumnName("IP")
                    .HasMaxLength(15);
            });

            modelBuilder.Entity<ProxyServerLoadResult>(entity =>
            {
                entity.HasIndex(e => new { e.SourceId, e.Score })
                    .HasName("nci_wi_ProxyServerLoadResult_0F32BF20F9B2DBAE74BA214E700E391E");

                entity.HasIndex(e => new { e.Score, e.ProxyServerId, e.SourceId })
                    .HasName("nci_wi_ProxyServerLoadResult_D0FDB6C5A7576BE3B1183549EEE8F39B");

                entity.HasIndex(e => new { e.SourceId, e.ProxyServerLoadResultId, e.ProxyServerId })
                    .HasName("nci_wi_ProxyServerLoadResult_EC64396D111AEDB6FB4EFC9ECD3699AD");

                entity.Property(e => e.ProxyServerLoadResultId).HasColumnName("ProxyServerLoadResultID");

                entity.Property(e => e.ProxyServerId).HasColumnName("ProxyServerID");

                entity.Property(e => e.SourceId).HasColumnName("SourceID");

                entity.HasOne(d => d.ProxyServer)
                    .WithMany(p => p.ProxyServerLoadResult)
                    .HasForeignKey(d => d.ProxyServerId);

                entity.HasOne(d => d.Source)
                    .WithMany(p => p.ProxyServerLoadResult)
                    .HasForeignKey(d => d.SourceId)
                    .OnDelete(DeleteBehavior.Restrict);
            });

@AsValeO as a workaround try putting Take(100) at the end of the query like so:
await
                        db.ProxyServerLoadResult.AsNoTracking()
                            .Include(x => x.ProxyServer)
                            .Where(x => !x.ProxyServer.BlockedByOperator)
                            .Where(x => x.SourceId == 1)
                            .OrderByDescending(x => x.Score)
                            .Select(x => x.ProxyServer)
                            .Take(100)
                            .ToListAsync();

this produces a much simpler query from the EF perspective, that we are able to fully translate at the moment. If possible, you should always try to put Skip/Take/Distinct as the last operation when using EF Core (at least until we address the current limitations).
The reason is that those are what we call ResultOperators - they are always the last operation in a given query. If there are more operations following, we introduce subqueries, which complicates the translation significantly for some cases. E.g. the original intermediate model representation for your original query is:
from ProxyServerLoadResult x in
    (from ProxyServerLoadResult x in DbSet<ProxyServerLoadResult>
    join ProxyServer x.ProxyServer in DbSet<ProxyServer>
    on Property(x, "ProxyServerId") equals Property(x.ProxyServer, "ProxyServerId")
    where !(x.ProxyServer.BlockedByOperator)
    where x.SourceId == 1
    order by x.Score desc
    select x)
    .Take(__p_0)
join ProxyServer x.ProxyServer in DbSet<ProxyServer>
on Property(x, "ProxyServerId") equals Property(x.ProxyServer, "ProxyServerId")
select x.ProxyServer

and the proposed workaround:
(from ProxyServerLoadResult x in DbSet<ProxyServerLoadResult>
join ProxyServer x.ProxyServer in DbSet<ProxyServer>
on Property(x, "ProxyServerId") equals Property(x.ProxyServer, "ProxyServerId")
where !(x.ProxyServer.BlockedByOperator)
where x.SourceId == 1
order by x.Score desc
select x.ProxyServer)
.Take(__p_0)

I got it, thank you!

This is fixed in the current bits and produces the following query:
SELECT TOP(@__p_0) [x.ProxyServer].[ProxyServerID], [x.ProxyServer].[Added], [x.ProxyServer].[BlockedByOperator], [x.ProxyServer].[IP], [x.ProxyServer].[Port]
FROM [ProxyServerLoadResults] AS [x]
INNER JOIN [ProxyServers] AS [x.ProxyServer] ON [x].[ProxyServerID] = [x.ProxyServer].[ProxyServerID]
WHERE ([x.ProxyServer].[BlockedByOperator] = 0) AND ([x].[SourceID] = 1)
ORDER BY [x].[Score] DESC

@maumar I think I've encountered this issue also.  When you say fixed, do you mean this will be included in the Entity Framework Core 2.0 release?

authors: AsValeO maumar mguinness


text:
Unable to create migration when configuring keyless entity to own another entity

Given a domain consisting of two entities X and Y where X owns an instance of Y and both are mapped to a view, any attempt made to create an initial database migration using Add-Migration or dotnet ef migration add fails with a NullReferenceException.
Steps to reproduce

Create a .NET Core 3 console application (Experiment).
Install Microsoft.EntityFrameworkCore.Tools in Experiment.
Create a .NET Standard 2.1 C# library (Experiment.Lib).
Install Microsoft.EntityFrameworkCore.SqlServer in Experiment.Lib.
Create these classes in Experiment.Lib.
Reference Experiment.Lib from Experiment.
In Visual Studio, open the Package Manager Console and set the default project to Experiment.Lib, then run Add-Migration InitialCreate.

Actual Result
The following exception is generated:
PM> Add-Migration InitialCreate -Verbose
Using project 'Experiment.Lib'.
Using startup project 'Experiment'.
Build started...
Build succeeded.
C:\Program Files\dotnet\dotnet.exe exec --depsfile C:\Projects\Experiment\Experiment\bin\Debug\netcoreapp3.0\Experiment.deps.json --additionalprobingpath C:\Users\e0065186\.nuget\packages --additionalprobingpath "C:\Program Files\dotnet\sdk\NuGetFallbackFolder" --runtimeconfig C:\Projects\Experiment\Experiment\bin\Debug\netcoreapp3.0\Experiment.runtimeconfig.json C:\Users\e0065186\.nuget\packages\microsoft.entityframeworkcore.tools\3.0.0\tools\netcoreapp2.0\any\ef.dll migrations add InitialCreate --json --verbose --no-color --prefix-output --assembly C:\Projects\Experiment\Experiment\bin\Debug\netcoreapp3.0\Experiment.Lib.dll --startup-assembly C:\Projects\Experiment\Experiment\bin\Debug\netcoreapp3.0\Experiment.dll --project-dir C:\Projects\Experiment\Experiment.Lib\ --language C# --working-dir C:\Projects\Experiment --root-namespace Experiment.Lib
Using assembly 'Experiment.Lib'.
Using startup assembly 'Experiment'.
Using application base 'C:\Projects\Experiment\Experiment\bin\Debug\netcoreapp3.0'.
Using working directory 'C:\Projects\Experiment\Experiment'.
Using root namespace 'Experiment.Lib'.
Using project directory 'C:\Projects\Experiment\Experiment.Lib\'.
Finding DbContext classes...
Finding IDesignTimeDbContextFactory implementations...
Finding application service provider...
Finding Microsoft.Extensions.Hosting service provider...
No static method 'CreateHostBuilder(string[])' was found on class 'Program'.
No application service provider was found.
Finding DbContext classes in the project...
Found DbContext 'BranchContext'.
Using context 'BranchContext'.
Finding design-time services for provider 'Microsoft.EntityFrameworkCore.SqlServer'...
Using design-time services from provider 'Microsoft.EntityFrameworkCore.SqlServer'.
Finding design-time services referenced by assembly 'Experiment'.
No referenced design-time services were found.
Finding IDesignTimeServices implementations in assembly 'Experiment'...
No design-time services were found.
'BranchContext' disposed.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.EntityFrameworkCore.Metadata.Internal.MetadataExtensions.AsConcreteMetadataType[TInterface,TConcrete](TInterface interface, String methodName)
   at Microsoft.EntityFrameworkCore.Metadata.Internal.EntityTypeExtensions.AsEntityType(IEntityType entityType, String methodName)
   at Microsoft.EntityFrameworkCore.EntityTypeExtensions.GetDeclaredProperties(IEntityType entityType)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationsModelDiffer.GetSortedProperties(IEntityType entityType)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationsModelDiffer.GetSortedProperties(TableMapping target)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationsModelDiffer.Add(TableMapping target, DiffContext diffContext)+MoveNext()
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Linq.Enumerable.ConcatIterator`1.MoveNext()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationsModelDiffer.Sort(IEnumerable`1 operations, DiffContext diffContext)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationsModelDiffer.GetDifferences(IModel source, IModel target)
   at Microsoft.EntityFrameworkCore.Migrations.Design.MigrationsScaffolder.ScaffoldMigration(String migrationName, String rootNamespace, String subNamespace, String language)
   at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.AddMigration(String name, String outputDir, String contextType)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigrationImpl(String name, String outputDir, String contextType)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigration.<>c__DisplayClass0_0.<.ctor>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Object reference not set to an instance of an object.

Comment/uncomment the other lines in BranchContext:OnModelCreating() to confirm that this does not occur with some minor changes to the entity configuration logic.
Expected Result
A migration should be generated to create a view on the database that will contain columns that correspond to the properties of Order and Vehicle.
Further technical details
EF Core version: EF Core 3.0
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET Core 3
Operating system: Windows 10 64-bit
IDE: Visual Studio 2019 16.3

@TAGC A keyless entity type cannot own another entity type because this implies that the owned type borrows the key of the owner...which doesn't have one.

We should throw a better exception until https://github.com/aspnet/EntityFrameworkCore/issues/14497 is implemented.

The thing is that I've got a custom DbContext that's similar to this and it works fine for actually performing queries against the database. It's just the actual generation of the migration (to make it easy to recreate the database views if needed) that's problematic.
I've encountered exceptions about keyless entity types not being able to own other entity types in the past, but those were very clear exceptions, and they occurred when trying to perform the actual queries, not generating migrations. This is different.
I could try playing around with that SSCCE to see if I can run queries without it throwing exceptions.

As an aside, in my production app I've also realised that I've modelled the domain logic incorrectly - specifically, that my assumption that there's a one-to-one mapping between two entities was wrong. This means that I no longer model any entity as owning another entity. I've just tried generating a migration using the EF Core command-line tool and it succeeds, but the migration logic is empty:
using Microsoft.EntityFrameworkCore.Migrations;

namespace MyCompany.MyProduct.Infrastructure.Migrations
{
    public partial class InitialCreate : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {

        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {

        }
    }
}

I assume that this is expected behaviour since I guess EF Core won't know what exact SQL is necessary to generate the database views. If so, that's not an issue and I'll be able to manually write that logic.

Just a quick update on what I've found through playing around with this toy project.
I've found that explicitly configuring the primary key for the entities allows migrations to be generated. I've updated the gist to reflect this approach, but this is the relevant part:
private static void MapToViewWithKeys(EntityTypeBuilder<Order> builder)
{
    builder.ToView("vw_OrderStatus_Orders");
    builder.HasKey(o => o.OrderId);
    builder.OwnsOne(o => o.Vehicle, vb => vb.HasKey(v => v.Id));
}

However, the migration that gets generated attempts to create a table rather than a view. I'm not sure if this is intended behaviour:
public partial class InitialCreate : Migration
{
    protected override void Up(MigrationBuilder migrationBuilder)
    {
        migrationBuilder.CreateTable(
            name: "vw_OrderStatus_Orders1",
            columns: table => new
            {
                Id = table.Column<int>(nullable: false)
                    .Annotation("SqlServer:Identity", "1, 1"),
                OrderId = table.Column<int>(nullable: false)
            },
            constraints: table =>
            {
                table.PrimaryKey("PK_vw_OrderStatus_Orders1", x => x.Id);
                table.ForeignKey(
                    name: "FK_vw_OrderStatus_Orders1_vw_OrderStatus_Orders_OrderId",
                    column: x => x.OrderId,
                    principalTable: "vw_OrderStatus_Orders",
                    principalColumn: "OrderId",
                    onDelete: ReferentialAction.Cascade);
            });

        migrationBuilder.CreateIndex(
            name: "IX_vw_OrderStatus_Orders1_OrderId",
            table: "vw_OrderStatus_Orders1",
            column: "OrderId",
            unique: true);
    }

    protected override void Down(MigrationBuilder migrationBuilder)
    {
        migrationBuilder.DropTable(
            name: "vw_OrderStatus_Orders1");
    }
}

I've also noticed that the publicly exposed DbSets influences the migration that gets generated. For example, uncommenting the DbSet<Vehicle> property for BranchContext.cs in the updated version of the gist causes this migration to be generated instead:
public partial class InitialCreate : Migration
{
    protected override void Up(MigrationBuilder migrationBuilder)
    {
        migrationBuilder.CreateTable(
            name: "Vehicles",
            columns: table => new
            {
                Id = table.Column<int>(nullable: false)
                    .Annotation("SqlServer:Identity", "1, 1"),
                OrderId = table.Column<int>(nullable: false)
            },
            constraints: table =>
            {
                table.PrimaryKey("PK_Vehicles", x => x.Id);
                table.ForeignKey(
                    name: "FK_Vehicles_vw_OrderStatus_Orders_OrderId",
                    column: x => x.OrderId,
                    principalTable: "vw_OrderStatus_Orders",
                    principalColumn: "OrderId",
                    onDelete: ReferentialAction.Cascade);
            });

        migrationBuilder.CreateIndex(
            name: "IX_Vehicles_OrderId",
            table: "Vehicles",
            column: "OrderId",
            unique: true);
    }

    protected override void Down(MigrationBuilder migrationBuilder)
    {
        migrationBuilder.DropTable(
            name: "Vehicles");
    }
}

@AndriySvyryd @bricelam - I tested this and there are weird issues.

Define a keyless entity and map it to view. Works as expected and creates empty migration.
Define PK for above and map it to view. Again empty migration.
Map an entity to view and define key manually. Configure owned entity for this. It throws exception as OP. In this case, I am configuring key entity to own another one yet the exception.
As in 3 but also configure PK for owned entity manually. And it generates migrations which is mismatch on various things.

    public class Blog
    {
        public int Count { get; set; }
        public Address Address { get; set; }

    }

    public class Address
    {
        public string City { get; set; }
    }

        public DbSet<Blog> Blogs { get; set; }
// OnModelCreating
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            // Configure model
            modelBuilder.Entity<Blog>().ToView("A");
            modelBuilder.Entity<Blog>().HasKey(e => e.Count);
            modelBuilder.Entity<Blog>().OwnsOne(e => e.Address, ow => ow.HasKey(e => e.City));
        }

Migration.
What is A1 table?
public partial class Init : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "A1",
                columns: table => new
                {
                    City = table.Column<string>(nullable: false),
                    BlogCount = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_A1", x => x.City);
                    table.ForeignKey(
                        name: "FK_A1_A_BlogCount",
                        column: x => x.BlogCount,
                        principalTable: "A",
                        principalColumn: "Count",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateIndex(
                name: "IX_A1_BlogCount",
                table: "A1",
                column: "BlogCount",
                unique: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "A1");
        }
    }

Model snapshot. Empty.
[DbContext(typeof(MyContext))]
    partial class MyContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "3.1.0-preview2.19501.6")
                .HasAnnotation("Relational:MaxIdentifierLength", 128)
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
#pragma warning restore 612, 618
        }
    }

Filed https://github.com/aspnet/EntityFrameworkCore/issues/18458 for the migrations part of this.

authors: AndriySvyryd TAGC ajcvickers smitpatel

repo: aspnet/EntityFrameworkCore


text:
Consider updating AddIdentity() to avoid overriding default schemes when they were previously set

Identity is indeed a bit greedy and if you try to register your default scheme before calling AddIdentity(), it will be ignored.

@HaoK would that be worth considering updating services.AddIdentity() to avoid overriding the default schemes when they are not null (i.e when already set by the developer?).

https://github.com/aspnet/Identity/blob/f3e251167212f18825506de9099a06e35350269c/src/Microsoft.AspNetCore.Identity/IdentityServiceCollectionExtensions.cs#L66-L71

@HaoK in the meantime, maybe it would be worth adding a tiny note indicating that AddIdentity() will always override your default schemes if you call AddAuthentication(options => ...) before AddIdentity() in either the docs or the announcement?

More context:
https://github.com/openiddict/openiddict-core/issues/436
https://github.com/openiddict/openiddict-core/issues/424#issuecomment-323721847
https://github.com/openiddict/openiddict-core/issues/424#issuecomment-324377691

Is there any update on this AddIdentity overriding issue? It's driving me nut, need it for Usermanager DI and also using OpenIdConnect for IdentityServer Login page redirect.

In 2.1 you can do something like this to avoid stomping on defaults (where you can specify the default scheme in AddAuthentication yourself):
            services.AddIdentityCore<TUser>()
               .AddRoles<TRole>()
               .AddDefaultTokenProviders()
               .AddEntityFrameworkStores<TestDbContext>();

            services.AddAuthentication(IdentityConstants.ApplicationScheme).AddIdentityCookies();

Thank you so much, just tried that now and no infinite loop anymore, however, the DI seems not to be working for UserManager and RoleManager

Thanks @HaoK , @Tratcher helped resolved the issue, I'm now able to mix AddIdentity and AddAuthentication in my Startup.cs. Really appreciate your help.

authors: HaoK PinpointTownes msdkool

repo: aspnet/Identity


text:
RFC6238 Pin Length

IMHO the service should allow for a configurable PIN length 6/8 and be public; the GenerateCode/ValidateCode should also return/accept a string; the length of the pin is important
is current controlled by the RFC6238 as a const, service which may result in a number that requires padding with 0s and a consumer of the service many not realise resulting in the wrong length code getting passed up the call stack.
public static int GenerateCode(byte[] securityToken, string modifier = null)
public static bool ValidateCode(byte[] securityToken, int code, string modifier = null)
see: https://tools.ietf.org/html/rfc6238 for reference
string generateTOTP
..
while (result.length() < codeDigits) {
result = "0" + result;
}
return result;

IMHO I think it would/could be of benefit to allow the developer to specify the token length for the GenerateAsync and ValidateAsync methods on the IUserTwoFactorTokenProvider, this would allow different implementations to generate tokens that meet requirements and/or data schema constraints etc.


text:
AddIdentity will add a marker Identity service and UseIdentity will throw if not found

Similar to what MVC does

ab29d5f5e581dd4cf9a8996b8c940bd4e5b65490


text:
Update live

Maybe?

Docs Build status updates of commit f1d12bb:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs-ref-autogen/com.microsoft.signalr.DefaultHttpClient.yml
:white_check_mark:Succeeded

docs-ref-autogen/com.microsoft.signalr.HttpClient.yml
:white_check_mark:Succeeded

docs-ref-autogen/com.microsoft.signalr.HttpHubConnectionBuilder.yml
:white_check_mark:Succeeded

docs-ref-autogen/com.microsoft.signalr.HubConnection.yml
:white_check_mark:Succeeded

docs-ref-autogen/com.microsoft.signalr.InvocationMessage.yml
:white_check_mark:Succeeded

docs-ref-autogen/com.microsoft.signalr.LongPollingTransport.yml
:white_check_mark:Succeeded

docs-ref-autogen/com.microsoft.signalr.NegotiateResponse.yml
:white_check_mark:Succeeded

docs-ref-autogen/com.microsoft.signalr.StreamInvocationMessage.yml
:white_check_mark:Succeeded

docs-ref-autogen/com.microsoft.signalr.TransportEnum.yml
:white_check_mark:Succeeded

docs-ref-autogen/com.microsoft.signalr.yml
:white_check_mark:Succeeded

docs-ref-autogen/toc.yml
:white_check_mark:Succeeded

package.json
:white_check_mark:Succeeded

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

To be clear this does not include removing non-public APIs, correct? I think that's fine, I just want to be clear.

Correct, since I just learned how a few minutes ago :P

Well it kind of worked, still says 2.2 preview 3 at the bottom of all the pages, but at least new stuff is there now.

authors: BrennanConroy anurse opbld30

repo: aspnet/JavaApiDocs


text:
Improve reliability of RequestTimesOutWhenRequestBodyNotReceivedAtSpecifiedMinimumRate

Fix race condition in test code
Addresses https://github.com/aspnet/KestrelHttpServer/issues/2539

@dotnet-bot test OSX 10.12 Debug Build

repo: aspnet/KestrelHttpServer


text:
Pool Connections

Pooling connections will improve performance--especially when using encryption which makes opening a connection more expensive. (Part of #412)
This would also allow us to make CreateFunction(), etc. calls persist between closing and re-opening a connection obviating the need for #354.

@bricelam would this also be an excuse to implement auto-prepared statements (assuming it isn’t implemented yet)?

Nice... If you work on prepared statements, consider also persisting them across pooled open/close, otherwise they're useless in short-lived connection scenarios.

@divega  Is someone having a hard look a SqlClient for these performance improvements, would likely hit a wider audience?

authors: ErikEJ bricelam divega roji