text:
FatalExecutionEngineError with Microsoft.EntityFrameworkCore 2.0.2 referenced in .NET 4.6.1

From @dalibor983 on March 22, 2018 9:42
When I run IISExpress everything working great  until I rebuild project and IISExpress tries to reload new dlls in memory. Then I get this exception when DbContext is initialized that crashes IISExpress:
Managed Debugging Assistant 'FatalExecutionEngineError'
  Message=Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0x73b03293, on thread 0x6b90. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.'

After starting IISExpress again everything working again.
I must restart IISExpress on every new build :(
Copied from original issue: dotnet/coreclr#17121

I think that maybe Roslyn compiler causes the problems with projects that combines .NET framework and netstandard. I notice that when I kill "VBCSCompiler.exe" process my IISExpress does not crash after project rebuild.
I em not sure because I don't know what this "VBCSCompiler.exe" process does in background. Does it build project silently in the background (independently of visual studio) or what?

This issue was moved to dotnet/roslyn#25687

I think that maybe Roslyn compiler causes the problems with projects that combines .NET framework and netstandard. I notice that when I kill "VBCSCompiler.exe" process my IISExpress does not crash after project rebuild.

Why do you believe this is a roslyn compiler problem? Is there bad IL generated that is causing this?
Killing the server means it falls back to the command line compiler here which will produce the exact same output.

authors: RussKeldorph dalibor983 divega jaredpar

repo: aspnet/EntityFrameworkCore


text:
Relaxed check if something is tracked - duplicated key violation

The short story
I need a easy, relaxed way where I can request from the DbContext if something is tracked to change.
The long story
In my WPF application I use a SaveCommand with a CanSave(..) method to check if something can be saved. This method looks like the following:
private bool CanSave()
{
    return DbContext.ChangeTracker.Entries().Any(e => e.State == EntityState.Added ||
                                                      e.State == EntityState.Modified ||
                                                      e.State == EntityState.Deleted);
}

When a duplicate key violation occurs, the .Entries() method throws an System.InvalidOperationException exception. By this I am not anymore able to determine if a save would be possible or not.
I need here an relaxed way to find out if changes are available, independent of if a primary key / unique key constraint violation exist. When the user then will execute the command, I want to give a proper error to the user.
Exception
Exception message: System.InvalidOperationException: "The instance of entity type '{EntryType}' cannot be tracked because another instance with the key value '{Primary key fields and values}' is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached."
Stack trace:
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.ThrowIdentityConflict(InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(TKey key, InternalEntityEntry entry, Boolean updateDuplicate)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(TKey key, InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.NullableKeyIdentityMap`1.Add(InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.UpdateIdentityMap(InternalEntityEntry entry, IKey key)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.NavigationFixer.KeyPropertyChanged(InternalEntityEntry entry, IProperty property, IReadOnlyList`1 containingPrincipalKeys, IReadOnlyList`1 containingForeignKeys, Object oldValue, Object newValue)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntryNotifier.KeyPropertyChanged(InternalEntityEntry entry, IProperty property, IReadOnlyList`1 keys, IReadOnlyList`1 foreignKeys, Object oldValue, Object newValue)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.DetectKeyChange(InternalEntityEntry entry, IProperty property)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.DetectChanges(InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.DetectChanges(IStateManager stateManager)
   at Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.DetectChanges()
   at Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.Entries()
   at MyNamespace.MyClass.CanSave()

Further technical details
EF Core version: 2.1.2
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows
IDE: Visual Studio 2017 15.6

@ice1e0 The general answer to this is that EF exceptions should not be used as a means for your application to determine what to do. In other words, attempting to track two entity instances with the same key value is a program error, not a recoverable situation that can be corrected such that the program can continue. Instead of telling EF to do something it can't do, check beforehand in your app whether it is valid. For example, if there is a possibility that a duplicate key value might have been obtained, then check whether an entity with a given key value exists or not before attempting to track it .

source: gharchive/issue

license: MIT

license_type: permissive

license_source: github-api


text:
OrderBy on projection

I didn't succeed in doing a simple OrderBy on a computed field in projection with EF Core 3.0.
This is the code :
var test = DbContext.Set<TRequest>()
    .Select(r => new { r.Id, r.Number, EllapsedDays = (DateTime.Today - r.RequestDate.Date).Days })
    .ToList();

var test2 = DbContext.Set<TRequest>()
    .Select(r => new { r.Id, r.Number, EllapsedDays = (DateTime.Today - r.RequestDate.Date).Days })
    .OrderByDescending(r => r.EllapsedDays)
    .ToList();

var test3 = DbContext.Set<TRequest>()
    .Select(r => new { r.Id, r.Number, EllapsedDays = (DateTime.Today - r.RequestDate.Date).Days })
    .Skip(0)
    .OrderByDescending(r => r.EllapsedDays).ToList();

The first test works well, I get my requests with ellapsed days in the test variable.
The second test fails because EF try to do an OrderBy with the complex expression for ellapsed days. I was thinking that a subquery would be generated but it is not the case. So, I tried to add a .Skip(0) to force a subquery. But, in this third case, I've got a System.ArgumentNullException: 'Value cannot be null. (Parameter 'key')'.

Stacktrace
Value cannot be null. (Parameter 'key')
at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Collections.Generic.Dictionary2.FindEntry(TKey key)    at System.Collections.Generic.Dictionary2.get_Item(TKey key)
at Microsoft.EntityFrameworkCore.Query.SqlExpressions.SelectExpression.GetMappedProjection(ProjectionMember projectionMember)
at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.VisitExtension(Expression extensionExpression)
at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.VisitBinary(BinaryExpression binaryExpression)
at Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerSqlTranslatingExpressionVisitor.VisitBinary(BinaryExpression binaryExpression)
at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.VisitMember(MemberExpression memberExpression)
at System.Linq.Expressions.MemberExpression.Accept(ExpressionVisitor visitor)
at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.Translate(Expression expression)
at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateExpression(Expression expression)
at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateLambdaExpression(ShapedQueryExpression shapedQueryExpression, LambdaExpression lambdaExpression)
at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateOrderBy(ShapedQueryExpression source, LambdaExpression keySelector, Boolean ascending)
at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass9_01.<Execute>b__0()    at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func1 compiler)
at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func1 compiler)    at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)    at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)    at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable1.GetEnumerator()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)

How can I do this OrderBy server side ?

Your projection contains Client evaluation hence we cannot translate order by to server. We have improved error message to throw proper error post 3.0.
Without knowing which provider you are using, I cannot say how to make the projection server evaluated.

I use the Microsoft.EntityFrameworkCore.SqlServer provider.
Thanks for the explanation, I rewrote my query with EF.Functions.DateDiffDay and it works well now :
var test2 = DbContext.Set<TRequest>()
    .Select(r => new { r.Id, r.Number, EllapsedDays = EF.Functions.DateDiffDay(r.RequestDate, DateTime.Today) })
    .OrderByDescending(r => r.EllapsedDays)
    .ToList();

authors: kakone smitpatel


text:
Update API doc links to correctly reference external dependencies

Specifically, use the appropriate syntax when referencing a type in an assembly (e.g. Relational) from another assembly (e.g. Core) that doesn't have a dependency on the referenced type.

@bricelam Can you add/point to an example of the syntax.

https://github.com/aspnet/EntityFrameworkCore/blob/release/3.1/src/EFCore.Relational/Diagnostics/DbConnectionInterceptor.cs#L115

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/processing-the-xml-file

authors: ajcvickers bricelam smitpatel


text:
Spatial: Translate GeometryType and OgcGeometryType

Fixes #13280
Providers, this adds a class for generating SQL CASE expressions.

Updated. Added type validation, and renamed WhenThen to CaseWhenClause.

source: gharchive/pull-request


text:
MigrationsSqlGenerator: DefaultValue formats default value properly

Fix for issue #14457. Contains breaking change in MigrationsSqlGenerator (changed signature of DefaultValue method).

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.:x: mirol-h sign nowYou have signed the CLA already but the status is still pending? Let us recheck it.

Thanks for the feedback. I've incorporated your suggestion and also changed the call to FindMapping like this:
Dependencies.TypeMappingSource.FindMapping(defaultValue.GetType(), type)

This solves the issue for SQLite provider, where this test failed:
https://github.com/aspnet/EntityFrameworkCore/blob/c2a39d700963f71c0035fa297aae6ec430578951/test/EFCore.Sqlite.FunctionalTests/SqliteMigrationSqlGeneratorTest.cs#L50
[ConditionalFact]
public virtual void DefaultValue_formats_literal_correctly()
{
    Generate(
        new CreateTableOperation
        {
            Name = "History",
            Columns =
            {
                new AddColumnOperation
                {
                    Name = "Event",
                    ClrType = typeof(string),
                    ColumnType = "TEXT",
                    DefaultValue = new DateTime(2015, 4, 12, 17, 5, 0)
                }
            }
        });

    AssertSql(
        @"CREATE TABLE ""History"" (
""Event"" TEXT NOT NULL DEFAULT '2015-04-12 17:05:00'
);
");
}

It tried to generate SQL literal for TEXT from DateTime and failed because of cast from DateTime to string (I guess this is necessary (for SQLite), because SQLite lacks proper date time type, right?).

@bricelam I've rebased branch onto release/3.0 and now lots of tests in SqlServer.FunctionalTests fail (e.g. Query.AsTrackingSqlServerTest.Applied_to_projection or Query.QueryNavigationsSqlServerTest.Project_single_scalar_value_subquery_in_query_with_optional_navigation_works).
Did I do something wrong, or is it something else?

Almost certainly unrelated. (Re-running the CI)

@bricelam It's been some time, since I've rebased the branch on top of release/3.0. What's the current state of this PR (and #16960)? Is anything else required from me? In terms of 3.0 release, what are the odds at the moment that these PRs get merged?

You’re good. I’m just slow. I’ll get it into the 3.0.0 release.

authors: bricelam dnfclas mirol-h


text:
After VS CTP5 "Couldn't determine an appropriate version of runtime to run."

I've been playing around with the latest dev-builds for a MVC web application (the latest beta3-* builds at the moment). I installed the CTP5 of Visual Studio, since then I've been unable to get my projects working again. Whenever I try to run an application using IIS express, I immediately get the following yellow screen of death exception:
[InvalidOperationException: Couldn't determine an appropriate version of runtime to run. See http://go.microsoft.com/fwlink/?LinkId=517742 for more information.]
   System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +303

[HttpException (0x80004005): Couldn't determine an appropriate version of runtime to run. See http://go.microsoft.com/fwlink/?LinkId=517742 for more information.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9920856
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Unfortunately the provided link only redirects to the ASP.NET website. Google does not return anything, but it seems that others have this problem as well.
I run Windows 10 Preview (build 9926) and KRE-CLR-x86.1.0.0-beta3-10921.

I'm having exactly the same problem and I can't determine a work-around that works using IIS Express. Using the "k web" run target still works for me, though.

I'm having the same problem too.
I think the problem is that kvm renamed to dotnetsdk.
All nightly assemblies have a beta4-* version, and some targeted to .net 4.6 (v4.0.10 references).
I'm try to install dotnetsdk. All is ok, but VS 2015 CTP5 want %userprofile%.kre and packages named kre-*
problem is probably here:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AspNet

will be nice to get fixed aspnet tasks for VS15 CP5 ;-)

Thats the problem using the bleeding edge builds. Unfortunately there's no easy work around right now as things have been renamed.

OK, thanks for the update, @davidfowl. Good to know this is only a "temporary" issue with the current builds.

@Boglen How did you install dotnetsdk? I couldn't find an install script just like kvm/kre.

Looking forward to hear this solved

@ninety7 yesterday they roll back the changes, as I understand

waiting while dotnetsdk -> kvm renamed

Found solution:
I've deleted kvm and reinstalled from dev branch, install latest version of kre (beta4-11019).
Then i create hardlink from new .k directory to .kre (mklink /j .kre .k), create subdir runtimes hardlink to packages, rename. Duplicate package kre-clr-win-x86.1.0.0-beta4-11019 to kre-clr-x86.1.0.0-beta4-11019 (duplicate, not rename) and most impartant: place in wwwroot folder of your project web.config file

<system.web>

</system.web>

and debug in IISExpress work now.

Next problem is that VS15 CTP5 with last kre build, moved from .kre to .k. and renamed from kre-clr-x86.1.0.0-* kre-clr-win-x86.1.0.0-* :-) won't publish to filesystem:
Cannot find KRE package entityframework.commands in the folder:
Cannot find KRE package entityframework.commands in the folder: %userprofile%.kre\packages
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AspNet\Microsoft.Web.AspNet.targets(108,5): Error : The ProjectK Runtime package needs to be installed. See output window for more details.

I have the same issue but am unclear how to move forward.
I run KRE version KRE-CLR-x86.1.0.0-beta2
This was working until I upgraded the KRE version to beta4 .. I have reinstalled KRE and reset the Visual Studio installation but am still getting the  error below. Am at a loss as to how to proceed.. any feedback will be appreciated.
Couldn't determine an appropriate version of runtime to run. See http://go.microsoft.com/fwlink/?LinkId=517742 for more information.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Couldn't determine an appropriate version of runtime to run. See http://go.microsoft.com/fwlink/?LinkId=517742 for more information.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: Couldn't determine an appropriate version of runtime to run. See http://go.microsoft.com/fwlink/?LinkId=517742 for more information.]
   System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +506

[HttpException (0x80004005): Couldn't determine an appropriate version of runtime to run. See http://go.microsoft.com/fwlink/?LinkId=517742 for more information.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9931632
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +191

To make it all work go back to beta2, visual studio ctp5 won't work with anything newer. There were a bunch of things that got renamed that will cause grief.
To go back, just set the default ailias back to beta2, kvm alias default 1.0.0-beta2.

Thanks for the reply @davidfowl
It helped me understand my issue a little better.
Unfortunately I am using  beta4 dlls in my project which leaves me in a very unpleasant state until this gets resolved. Fingers crossed we gets a fixed drop soon.

Beta4 work fine with ctp5. Create web.config in wwwroot, copy kre-clr-win* in kre-clr* and make hardline from runtimes to packages

@Boglen thanks for your reassurance that we can get it working, but it would be excellent if you could please be more specific about what people need to do, for example:

what should be the contents of web.config?
copy kre-clr-win* to where?
I don't understand what you mean by "hardline from runtimes to packages".

Thanks!

Open CMD.
cd %userprofile%
mklink /J .kre .k
then open c:%userprofile%.k\runtimes folder. Create duplicate of "kre-clr-win-x86.1.0.0-beta4-11037"
and rename to "kre-clr-x86.1.0.0-beta4-11037".
Copy c:%userprofile%.k\runtimes
To c:%userprofile%.k\packages
Open VS 2015 CTP5, open your project and define Target KRE version in properties to kre-clr-x86.1.0.0-beta4-11037.
Then open "wwwroot" folder in your project, create web.config file:

Profit!
bootstrapper-version - version of AspNet.Loader.dll

@Boglen I've done the steps. Magical version numbers at the time of writing are: 1.0.0-beta4-11117 and 1.0.0-beta4-11122 for the AspNet.Loader.dll.
Problem is the Visual Studio says in the Solution Explorer: References (Errors - see error list) in error list there is "Illegal characters in path."
I've deleted .kpm/packages it didn't hlep.

I got a new version using "kvm upgrade" yesterday, "11128" it works with the instructions above. What's more, I also got the Mvc debugging to work with this version.

@Ciantic yep. All you need to do - just rename the folders.  I think that CTP6 will coming soon and there will be corrected path

CTP6 came out today. Get it now.

I am getting same error saying that Couldn't determine an appropriate version of runtime to run when I try to execute iisexpress.exe. The command I ran:

"C:\Program Files\IIS Express\iisexpress.exe" /path:"D:\github\confidence\artifacts\apps\ConfyConf.Client.Web\wwwroot" /port:9090 /clr:v4.0

wwwroot folder I am targeting here is created by dnu publish and web.config is:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<appSettings>
		<add key="bootstrapper-version" value="1.0.0-beta4-11526" />
		<add key="runtime-path" value="..\approot\packages" />
		<add key="dnx-version" value="" />
		<add key="dnx-clr" value="" />
		<add key="dnx-app-base" value="..\approot\src\ConfyConf.Client.Web" />
	</appSettings>
</configuration>

I am also getting the below iisexpress.exe output:

I added the below system.web node to web.config but it didn't change anything:
	<system.web>
		<compilation debug="false" targetFramework="4.5.1" />
		<httpRuntime targetFramework="4.5.1" />
	</system.web>

I have the same issue as tugb

@davidfowl suggested to me in Home #452 (comment) to try dnu publish --runtime active to populate the dnx-version and dnx-clr of the generated Web.config. Does that work for you?

authors: Boglen Ciantic GuardRex cherrydev davidfowl flyandi jersiovic ninety7 saxx shailensukul tugberkugurlu

repo: aspnet/Home


text:
[TestServer] HttpContext.Connection containing wrong/default values

Hi!
I don't know if it's actually an issue, so I'll just describe the behavior I've discovered.
I'm using Microsoft.AspNetCore.Hosting.TestHost.TestServer for integration testing purposes for a custom authentication middleware/handler.
The configuration is as follows
_server = new TestServer(new WebHostBuilder()
                .UseStartup<Startup>());
//Startup only contains configuration stuff for my middleware

_client = _server.CreateClient();
_client.GetAsync("/");
//...

When executing this, the request hits my middleware and I'm accessing HttpContext.Connection, where all exposed properties are set to their default values (Local/RemotePort = 0, other properties are set to null).
Am I missing a configuration step or something? We cannot get around testing whether the middleware is checking the clients IP-Address or not.
I tried to debug that based on the sources of Microsoft.AspNetCore.Http(Abstractions), but I didn't get too far with that.
EDIT: I'm using the preview2-final - packages of Microsoft.AspNetCore.*, if that makes any difference.

What are you expecting those to be set to?

Well my expectation was, to give a real example, that the property RemoteIPAddress would contain an instance of IPAddress containing the client's IP - e.g in an integration test scenario 127.0.0.1 or ::1.
Maybe my expectation is wrong, but since ALL properties seem to be unset, the ConnectionInfo instance is unusable in every use case I can imagine atm.

It's not even loopback, it's in memory.
What we really need is an easy way to provide values. Most test apps don't care.

So the client's request doesn't take all the way through the server's request pipeline and will therefore not trigger all modules that would normally handle the request - did I get that right @Tratcher?

The client is fake, the request is fake, it's an in memory pipeline, there is no networking involved. It does however, run the entire server pipeline so everything gets invoked like normal, just without network IO.

Okay, and due to the fact that there is no networking involved such OSI 3/4 artifacts like IP addresses won't be available..?

@peterwurzinger correct. All of that to say, we could set the IPAddress to localhost and it wouldn't be incorrect. It's just that we don't today so it's null.

@jkotalik let's set the IP to 127.0.0.1 or ::1? and port to 80. Ping @Tratcher if you want to get the context. :)

@muratg Is it maybe a good idea to let the user decide which values those properties will hold by making it configurable instead of setting them to a static value? I'm thinking of cases (especially our use-cases ofc) where one would need to differentiate between remote IPs - e.g. if the caller IP is on a whitelist or not. One would then be able to test this behavior via unit/integration-tests.
Regards
Peter

@peterwurzinger if you want it to be configurable then I think we'd just provide a callback so that you can modify the feature collection before requests get sent to the server.

@davidfowl That sounds like a good solution to me.

There's a more general problem here. HttpClient is convenient, but there's a limit to how much you can use it to manipulate arbitrary server structures like the Connection IPs. The Katana version directly exposed the Invoke method so you could manually create the server structures and call it. I wouldn't do it quite the same way again, but I do think we need an API that lets you create a HttpContext in your test code and hand that directly to the server without going through a HttpClient abstraction layer. This would give us full fidelity to manipulate server structures in the tests.

Is there a direct need to manipulate the RemoteIP via HttpClient (for every single request, to pursue that thought)? Maybe I don't get it right, but the returned client-instance from TestServer.CreateClient() shouldn't bother about doing so. Instead the TestServer instance should be able to take care of this business..?
But as already mentioned, maybe I just didn't get that right.

If you want to test how your application handles different RemoteIP values, then you need to be able to control those values from your test code. There's not much point in always using the same hardcoded values.

Well, maybe I just use the library wrong then. I create an instance of TestServer every time a single test is invoked, use it for this test and dispose it at the end. My thinking was, that not reusing server instances will leave me with test logic only without having to deal with potential artifacts left from previous tests.
With xUnit this doesn't affect test performance as bad as it sounds like but it's surely not the fastest option.

That's fine, but I don't see how it relates to controlling the ip values.

Yeah I don't really understand how those properties are populated, I guess I need to do a deep-dive into the code. I just assumed that there would be a higher chance of being able to manipulate those values in the course of creating the TestServer instance instead while/before sending requests via the HttpClient.
With that said, being able to populate the values while setting up the server for a single test would be fine for me - maybe this explains my weird thoughts.

Ah, that makes more sense. We could specify them per server, but they're per request data so I'd rather not. Yes I recommend making a server instance per test, but our tests often send more than one request.

but they're per request data

I absoluetly agree with that.
So basically there is a need for a mechanism to specify those values per request without providing a separate HttpClient-implementation? Imho the common denominator in this case is the HTTP-protocol itself..?
It sounds a bit hacky to me, but what about defining a set of experimental HTTP-Headers to populate unprovidable values?
e.g. X-ASPNETHOSTING-RemoteIP=...

These are below the Http protocol, we're trying to mock the TCP connection itself. We may want to do something similar for client certificates. As we're trying to mimic the real environment I don't think we should resort to workarounds like x- headers. We need direct control of the server data structures to be able to fully mock every aspect of a request.

@Tratcher Let's talk offline about the context.

I can see two options on how to fix this:

Expose more options on the test server (LocalIpAddress, port, etc.)
Expose the FeatureCollection on the TestServer for modification before the HttpRequest is sent out.

Yeah, #816 seems like a better way to address this. There are too many possible things you'd want to modify.

Resolved via #1248

authors: Tratcher davidfowl jkotalik muratg peterwurzinger

repo: aspnet/Hosting


text:
An error occurred while calling method 'ConfigureServices' on startup class 'Startup'.

I have the following on an ASP.NET Core 1.1.1 project:
    public class DataContext : IdentityDbContext<User, Role, Int32, UserClaim, UserRole, UserLogin, RoleClaim, UserToken> { }

    public class User : IdentityUser<Int32, UserClaim, UserRole, UserLogin> { }
    public class UserClaim : IdentityUserClaim<Int32> { }
    public class UserLogin : IdentityUserLogin<Int32> { }
    public class UserRole : IdentityUserRole<Int32> { }
    public class UserToken : IdentityUserToken<Int32> { }

    public class Role : IdentityRole<Int32, UserRole, RoleClaim> { }
    public class RoleClaim : IdentityRoleClaim<Int32> { }

And Startup I have the following:
    services
      .AddIdentity<User, Role>()
      .AddEntityFrameworkStores<Context>()

But I get the error:
An error occurred while calling method 'ConfigureServices' on startup class 'Startup'.
Consider using IDbContextFactory to override the initialization of the DbContext at design-time.
Error: GenericArguments[0], 'WebProj.User', on 'Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore`4[TUser,TRole,TContext,TKey]' violates the constraint of type 'TUser'.

Do I still need to create custom UserStore and RoleStore to make this work in ASP.NET Code 1.1.1?
Thank You,
Miguel

Try AddEntityFrameworkStores<Context, int>

That compiles but when I run it I get the error:
"GenericArguments[0], 'WebProj.User', on 'Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore`4[TUser,TRole,TContext,TKey]' violates the constraint of type 'TUser'."

"   at System.RuntimeType.ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e)\r\n   at System.RuntimeType.MakeGenericType(Type[] instantiation)\r\n   at Microsoft.Extensions.DependencyInjection.IdentityEntityFrameworkBuilderExtensions.GetDefaultServices(Type userType, Type roleType, Type contextType, Type keyType)\r\n   at Microsoft.Extensions.DependencyInjection.IdentityEntityFrameworkBuilderExtensions.AddEntityFrameworkStores[TContext,TKey](IdentityBuilder builder)\r\n   at WebProj.Startup.ConfigureServices(IServiceCollection services)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()\r\n   at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()\r\n   at WebProj.Program.Main(String[] args)"

Oh yeah, you still have to specify your own store:
See https://github.com/aspnet/Identity/issues/855

We have improved this in 2.0 to fully use reflection to make AddEntityFrameworkStores<Context> 'do the right thing'

See https://github.com/aspnet/Identity/issues/1001 for how things will work in 2.0

I saw that one and the milestone was 1.1.0-preview1 so I though that was done. So the entire User Store needs to be created?

That change is in 1.1.1, but you still need to put your own user store type into DI since the AddEntityFrameworkStores method is only using the 4 generic type constructor for UserStore, and you are specifying all of the child entities.

authors: HaoK mdmoura

repo: aspnet/Identity


text:
Remove limits on SETTINGS_HEADER_TABLE_SIZE

#2874 This fixes a regression that prevented Kestrel from accepting HTTP/2 connections from Chrome.
Preview2 reset candidate.

There's a few things going on. The request table and response table need to be treated separately. The server gets to limit how large the table is for requests, and the client gets to limit how large it is for responses. Each advertise that limit to the other. The recpient is under no obligation to allocate or use that much memory for the table, they can use as much or as little as they want up to given limit. We don't currently use a response compression table at all so the limit given to us by the client is meaningless. When we do start compressing response headers we should use the lesser table size of either the value provided by the client or the one specified in Http2Limits.

Right there are separate limits for each direction. But there's no upper
limit to this seeing other than the number of bits allocated to this
setting?
On Sat, Sep 1, 2018 at 10:56 PM Chris Ross notifications@github.com wrote:

There's a few things going on. The request table and response table need
to be treated separately. The server gets to limit how large the table is
for requests, and the client gets to limit how large it is for responses.
Each advertise that limit to the other. The recpient is under no obligation
to allocate or use that much memory for the table, they can use as much or
as little as they want up to given limit. We don't currently use a response
compression table at all so the limit given to us by the client is
meaningless. When we do start compressing response headers we should use
the lesser table size of either the value provided by the client or the one
specified in Http2Limits.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
https://github.com/aspnet/KestrelHttpServer/pull/2877#issuecomment-417907171,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB7689ngpx6DKK-7_PoKzxgKHlk-JjOCks5uW3LtgaJpZM4WWc6F
.

Nothing in the spec, no, and no reason to impose a limit in either direction other than the one provided by Http2Limits.

I read the HTTP/2 and HPACK spec again and there weren't any additional limits. Seems like I understood the phrase The encoder can select any size equal to or less than this value wrong thinking it was referring to the initial value. This fix is correct.

991cfa8

authors: JunTaoLuo Tratcher halter73

repo: aspnet/KestrelHttpServer


text:
Missing Installation details in Nuget page for Mvc 6.0.0-beta7

I have recently found that there is missing details for installation of beta7 from Nuget.
which should be
PM> Install-Package Microsoft.AspNet.Mvc -Version 6.0.0-beta7 -Pre
instead of
PM> Install-Package Microsoft.AspNet.Mvc -Pre
Nuget Link:
https://www.nuget.org/packages/Microsoft.AspNet.Mvc/6.0.0-beta7
May be i am missing something or if this is not the right place to post then let me know i will close immediately.

File a bug on NuGet https://github.com/NuGet/Home

Ok thanks and sorry for inconvenience.

authors: NeelBhatt davidfowl

repo: aspnet/Mvc


text:
DataAnnotationsClientModelValidator should localize the ErrorMessage, not the DisplayName

When DataAnnotations localization is active, the GetErrorMessage method in class DataAnnotationsClientModelValidator<TAttribute> returns the localized display name of the passed ModelMetadata, but it should be the localized value of Attribute.ErrorMessage. Exactly like in class DataAnnotationsModelValidator:
string errorMessage = null;
if (_stringLocalizer != null &&
    !string.IsNullOrEmpty(Attribute.ErrorMessage) &&
    string.IsNullOrEmpty(Attribute.ErrorMessageResourceName) &&
    Attribute.ErrorMessageResourceType == null)
{
    errorMessage = _stringLocalizer[Attribute.ErrorMessage]; // CORRECT!
}

Suspect this is a dupe of #3414.

Localized and not localized return display name
          Attribute.ErrorMessageResourceType == null)
            {
                return _stringLocalizer[displayName];
            }

            return Attribute.FormatErrorMessage(displayName);

The GetErrorMessage is also called from other attributes.
From the Maxlength parameter you need to supply both Displayname and length.
return _stringLocalizer[Attribute.ErrorMessage,displayName, Attribute.Length];

I think you use this !string.IsNullOrEmpty(Attribute.ErrorMessage) to check of a custom error message is set. But this is not the case with the Emailaddress attribute. Maybe Attribute.CustomErrorMessageSet to check if a custom error message is set

CompareAttribute missing code to localized.
 public string FormatErrorMessage(ClientModelValidationContext context)
            {
                var displayName = context.ModelMetadata.GetDisplayName();
                return string.Format(CultureInfo.CurrentCulture,
                                     ErrorMessageString,
                                     displayName,
                                     GetOtherPropertyDisplayName(context));
            }

Looks like there are a few issues mixed into this one.

@muratcakir and @Anderman you're correct that DataAnnotationsClientModelValidator<TAttribute>.GetErrorMessage(...) and DataAnnotationsModelValidator.Validate(...) are inconsistent. I suspect @Anderman is also correct that the IStringLocalizer invocation in both should be _stringLocalizer[Attribute.ErrorMessage, DisplayName]. If not, DataAnnotationsClientModelValidator<TAttribute> should be changed to match DataAnnotationsModelValidator.
@Anderman I suggest filing a new issue about using the correct parameters when looking up the error message for some [Validation] subclasses e.g. [Compare] and [MaxLength]. This also applies to both DataAnnotationsModelValidator and DataAnnotationsClientModelValidator<TAttribute>.
@Anderman I suggest also filing a new issue about bringing CompareAttributeAdapter into the IStringLocalizer fold.

authors: Anderman dougbu muratcakir


text:
upgrade asp.net core targeting framework 4.6.1 from vs2015 to vs2017 - One or more compilation references are missing

I opened it on the SDK repo as well- https://github.com/dotnet/sdk/issues/958 as I'm not sure where it supposed to be.
have upgraded my asp.net core,using project.json and targeting .net framework 4.6.1 on visual studio 2015 to visual studio 2017.
I have multiple projects in the solution where the main application is referencing them by project reference(all of them target net461).
When running the application I get
One or more compilation references are missing. Possible causes include a missing 'preserveCompilationContext' property under 'buildOptions' in the application's project.json.
Screenshot:

And my csproj:
webapp.txt
I'll try to create a project to see if I can reproduce.

Closing this because it looks like the right set of people are looking at https://github.com/dotnet/sdk/issues/958. We can move the discussion back here if it looks like the issue is with MVC.

authors: Eilon ErezSavir


text:
Razor views cannot declare a custom base type and a model

Based on https://github.com/aspnet/Mvc/issues/5397
Currently, the way to specify a custom base type for a view and a model involves specifying the @inherits keyword in a _ViewImports.cshtml:
@inherits MyBaseType<TModel>
and specifying the model in the page:
@model MyModel
Specifying the two in the same page results in a parse error: The 'inherits' keyword is not allowed when a 'model' keyword is used.. Using _ViewImports is limiting here,
a. It does not allow specifying more than one base type per directory
b. not being able to contain all the definition information in a single view file makes it less portable when using our modular framework (e.g. we can have views defined in plugin assemblies)

I don't think there was ever an expectation that you would specify both an @inherits and @model keyword in the same view file. This isn't how MVC5 works and was only mentioned in #5397 when attempting a workaround. In MVC5 you would get the same error: The 'inherits' keyword is not allowed when a 'model' keyword is used.
In MVC5 th correct way to do this is to specify the model type as the generic parameter of the base type e.g. @inherits MyBaseType<MyViewModel> which causes the error in first mentioned in #5397 which I think is covered by #6291.

@pranavkm is this a regression from 1.1.X?

@rynowak no, this isn't a regression from 1.1.x. It is difference from Mvc 5 though.

Running into the same exact issue. It would be really great you could fix this for the ASP.NET 2.1 release. This is a show stopping bug in Razor Pages.
I'm not looking to run inherits and model in the same view file. I'd like to have a base class that all Razor Pages inherit from. Pretty simple. The basic scenario in #7559 should just work.
This issue has been open for ~10 months now. =/

Moving this to the Backlog as it's not a priority for the next release.

authors: HeyJoel bchavez mkArtakMSFT pranavkm rynowak


text:
Correct Type.IsAssignableFrom() polarity

#3482
see new tests; many failed without fixes in the product code
ModelBindingHelper.ConvertValuesToCollectionType<T>() -> CreateCompatibleCollection<T>()
make FormFileModelBinder / HeaderModelBinder collection handling consistent w/ GenericModelBinder++
add checks around creating collections and leaving non-top-level collections null (not empty)
add checks around binding collections to read-only properties
add support for binding IFormFileCollection properties

nit: Correct a few existing test names since nothing is not the same as ModelBindingResult.Failed()

/cc @rynowak

:watch: I don't really have a gripe with the code changes or tests here.... but this just seems like something that becomes much harder to explain to anyone how it works and why.

:up::date:

:shipit: after removing the try/catch

:up::date:

:shipit: again!

d3c2463

authors: dougbu rynowak


text:
Fixing race in distributed cache tag helper

If an exception is thrown by an instance, another awaiting request could grab the worker task, and get into an infinite loop.
The fix removes the worker task before warning other requests to acquire another worker task or process it themselves.
Checked with @JunTaoLuo on his box it couldn't be repro-ed with the fix, but currently running it 100 times to be sure.

#4407

Ran 100 iterations without hangs. I think this is good to go.

:shipit: discussed offline w/ @sebastienros and agree this is ready to go.

authors: JunTaoLuo dougbu sebastienros


text:
[WIP] add source link support to portable pdbs

This builds off the csproj branch. I just demos adding source link support. It has the same changes I made to https://github.com/aspnet/EntityFramework/pull/7726. Please see the comments there. Let's see if this build is better maintained.

@ctaggart,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

Closing this pull request. It was just an example of how easy it is to add.

authors: ctaggart dnfclas


text:
Consider not tracking TagHelper bound attributes in Context.AllAttributes

Today whenever a user has a TagHelper bound attribute we allocate a TagHelperAttribute for it and push it into Context.AllAttributes. We've yet to make use of their existence in Context.AllAttributes and in the case that a TagHelper author truly wants to know the value of an attribute added by another TagHelper they can also bind it to gain access to its value.
This would be a more impactful replacement for https://github.com/aspnet/Razor/issues/704 and is mutually exclusive.

This is by design.

authors: Eilon NTaylorMullen

repo: aspnet/Razor


text:
ASPNETCORE 2.0 ClaimsPrincipal IsAuthenticated but SignInAsync is not IsAuthenticated (and user is null) using cookies

Hi
I had a ASPNETCORE application using Authentication cookie It was working perfectly with 1.1.
After the changes in 2.0 i have been reading up and down regarding the migration and have changed to:
services.AddAuthentication()
                .AddCookie(options =>
                {
                    options.LoginPath = new PathString("/Account/Login");
                    options.AccessDeniedPath = new PathString("/Account/Forbidden/");
                    //options.ExpireTimeSpan = TimeSpan.FromDays(60);
                    //options.SlidingExpiration = true;
                });

I have also changed the signin from the Authenticator to httpcontext signin.
await httpContext.SignInAsync(actual.ClaimsPrincipal)
i have also tried with the new:
await AuthenticationHttpContextExtensions.SignInAsync(httpContext, CookieAuthenticationDefaults.AuthenticationScheme, actual.ClaimsPrincipal)
Even though the ClaimsPrincipal IsAuthenticated, the roles andf claims are good. The SignIn does nothing!
The HttpCointext.User is null.
Something is wrong. I have tried every combination i can with the startup configuation. I have read ever stack overflow and github issue. Nothing helps.
The log file says:
2017-09-18 21:38:18.2931 | INFO | Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler | AuthenticationScheme: Identity.Application signed in. |
2017-09-18 21:38:45.7513 | INFO |
Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler | AuthenticationScheme: Cookies signed in. |
the first message comes from the SignInManager.PasswordSignInAsync. The second from HttpContext.SignIn.
Does anybody know why the SignInManager.PasswordSignInAsync auth schema is "Identity.Application"
Does anybody know why HttpContext.User is null after the login?
This is a real issue for us!!! :-/

If you are using identity, you don't need to call AddAuthentication/AddCookie, and you need to sign in using the IdentityConstants.ApplicationCookie scheme
If you don't actually want to use identity, then you should remove the call to AddIdentity and then your direct SignIns would match the cookie you added

Wow. Fast answer. Thanks.!
A also just added this:
`option.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
            option.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;

            option.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;

            option.DefaultSignOutScheme = CookieAuthenticationDefaults.AuthenticationScheme;

            option.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;

            option.DefaultForbidScheme = CookieAuthenticationDefaults.AuthenticationScheme;

`
It also seamed to help!

HI again
I have tried removing AddAuthentication/AddCookie and using IdentityConstants for the identity and signin etc. Doesn't appear to work...

When precisely is HttpContext.User null? Note that property should never return null but it may return an anonymous user. Are you checking it on this same request, on the next request, etc.?

Hi Chris
Thanks for re-openning. I did feel there was a little loose end here.
Forst i should mention that i have followed https://docs.microsoft.com/en-us/aspnet/core/migration/1x-to-2x/identity-2x from top to toe.
I am not using any 3rd party integrations (facebook, google, etc.) only pure identity.
What i am noticing in the ClaimsPrincipalFactory is that when the ClaimsIdentity is created and even though the default cookie schema is being used, the SignInManger.PasswordSignInAsync gets logged to use  "Identity.Application"schema.
This essentially means that:

When the HttpContext.SignInAsync uses the claimsIdentity the cookies are not the same.

If i do not override the option.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; the sign in with th identity does not pass to HttpContext.User. Even though HttpContext.SignIn does not throw or anything

In 2.0 If i do override the option.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; the HttpContext.User is null after successful login and a new http request.

In 2.0 If i do override the option.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;  the HttpContext.User is null after the HttpContext.SiginAsync**, e.g.

await httpContext.SignInAsync(DefaultCookiesNames.AuthorizationCookie, actual.ClaimsPrincipal).ConfigureAwait(false);                     var user = httpContext?.User;
In aspnetcore 1.1 there HttpContext.User was not null after HttpContext.SignInAsync maybe because of the: AutomaticAuthenticate = true, AutomaticChallenge = true, is no longer present?

Lastly why is the Identity cookie still being created when i have overwritten it everywhere possible?

Thanks, Rik

SignInManager always will sign in to IdentityConstants.ApplicationScheme.  What exactly are you trying to do?  Are you trying to sign in cookies yourself/not use SignInManager?
DefaultAuthenticateScheme is what controls which scheme's identity gets set to httpContext.User by default, AddIdentity() sets this to IdentityConstants.ApplicationScheme.
If you don't want the application cookie, you can't use any of SignInManager's SignIn methods.

Hi Hao
Thats fine that it always uses "IdentityConstants.ApplicationScheme".
However, as far as i could test without the "option.DefaultSchemeXxxx" changes to the service colleciton for AddAuthentication extension  the HttpContext SignIn does not work with the claimsPrincipal, and then there is nothing added to HttpConext.User
This was working in 1.1. And i do feel MS has broken something here.
Ofcause we should be able to use the signin manger together with the httpcontext signin. Without making schema changes in multiple places.
2.0 really broke something that was very simple here...

I'm not exactly sure what you are trying to do, but to clarify exactly what's going on.
SignInManager.SignInAsync(user) results in a call to httpContext.SignInAsync(IdentityConstants.ApplicationScheme, userClaimsPrincipal)
Calling httpContext.SignInAsync(claimsPrincipal) is using the AuthenticationOptions.DefaultSignInScheme as the scheme.
httpContext.User gets set by the middleware from UseAuthentication() to AuthenticationOptions.DefaultAuthenticateScheme

Hi
But why does SignInManager.SignInAsync(user), goto
(httpContext.SignInAsync(IdentityConstants.ApplicationScheme, userClaimsPrinciple)
It isn't supporting the claims principle factory anymore? that also makes the identity.
I guess this is the problem. I want to (as i did in aspnetcore1) generate the claims and identity in the claimsprinclpe factory., But the SignInManager.SignInAsync(user) does not user the factory :-/
Configuration:
services.AddIdentity<AppUser, AppRole>()                 .**AddClaimsPrincipalFactory<IClaimsPrincipalFactory>()**                 .AddUserStore<IUserStore>()                 .AddRoleStore<IRoleStore>()                 .AddUserManager<UserManager>()                 .AddRoleManager<RoleManager>()                 .AddSignInManager<SignInManager>()                 .AddDefaultTokenProviders();
Claims factory:
`public class ClaimsPrincipalFactory : IClaimsPrincipalFactory
{
public Task CreateAsync(AppUser appUser)
{
return Task.Run(() =>
{
if (appUser?.Roles == null)
{
return new ClaimsPrincipal();
}
var claims = new []{
CreateClaimIfValue(ClaimTypes.NameIdentifier, appUser.Id),
CreateClaimIfValue(ClaimTypes.Name, appUser.DisplayName),
CreateClaimIfValue(ClaimTypes.Email, appUser.Email),
CreateClaimIfValue(ClaimTypes.GivenName, appUser.FirstName),
CreateClaimIfValue(ClaimTypes.Surname, appUser.LastName)
}.Where(x=>x!=null).ToList();
if (appUser.Roles != null && appUser.Roles.Any())
{
claims.AddRange(appUser.Roles.Distinct().Select(role => new Claim(ClaimTypes.Role, role.Name)));
}
var identity = new ClaimsIdentity(DefaultCookiesNames.AuthorizationCookie);
identity.AddClaims(claims);
var claimsPrincipal = new ClaimsPrincipal(identity);
            return claimsPrincipal;
        });
    }

    private static Claim CreateClaimIfValue(string type, string value)
    {
        return !string.IsNullOrWhiteSpace(value) ? new Claim(type, value) : null;
    }`

authors: HaoK Tratcher generik0

repo: aspnet/Security


text:
Fix SRI values for jquery

Resolves https://github.com/aspnet/templating/issues/520

@kichalla @mkArtakMSFT can someone take a look at this quickly to verify it?

I will send out a PR for IdentityUI fix

Are there any other files in templates, which will need to be updated? Can you please double check that, please.

authors: kichalla mkArtakMSFT natemcmaster

repo: aspnet/templating


text:
Issue generating PDF using html string

I use the following code to generate a PDF using the ASPOSE.PDF package.  My requirements meant that while generating the PDF, I need the output in a memory stream and not saved to disk.  So couldn't use the aspose code that takes a save file path as a parameter.  Here's what I had:
public Stream GeneratePdfStream(string html)
{
    // Verify our license is loaded before using.
    VerifyLicense();

    // Turn our string into bytes using encoding.
    using var stream = new MemoryStream(Encoding.ASCII.GetBytes(html ?? string.Empty));

    // Create HTML load options
    HtmlLoadOptions htmloptions = new HtmlLoadOptions();
    htmloptions.HtmlMediaType = HtmlMediaType.Print;
    htmloptions.PageInfo.Margin.Bottom = 0;
    htmloptions.PageInfo.Margin.Top = 0;
    htmloptions.PageInfo.Margin.Right = 0;
    htmloptions.PageInfo.Margin.Left = 0;

    // Load HTML file
    Document pdfDocument = new Document(stream, htmloptions);

    // Convert HTML file to PDF
    Stream memoryStream = new MemoryStream();

    // Save output as PDF format
    pdfDocument.Save(memoryStream);
    memoryStream.Seek(0, SeekOrigin.Begin);
    return memoryStream;
}

This means that I can then download the stream for the PDF via a web API or I can convert to Base64, depending on my use case.
Calling this method with this parameter works fine:
var html = "
This is a test
";
var pdfStream = GeneratePdfStream(html);

using (FileStream fs = File.Create("somePath.pdf"))
{
      fs.CopyTo(pdfStream);
}

However, when I use a more real-world example, i.e. this:
// Roughly, a 10kb worth of content here.
var html = "<!doctype html>   <meta charset='utf-8'> <meta charset='utf-8'> <meta http-equiv='X-UA-Compatible' content='IE=edge'> <title>Invoice</title>

 example's® Customer Services
 P: 00800 53847 501
 https://www.example.com/GB/en_GB/contact
 Shop: example.com

Invoice

BILL TO

 {{BillingAddress:FirstName}} {{BillingAddress:LastName}}
 {{BillingAddress:Address1}}
 {{BillingAddress:Address2}}
 {{BillingAddress:Address3}}
 {{BillingAddress:City}}
 {{BillingAddress:PostalCode}}
 {{BillingAddress:Country}}

P: {{BillingAddress:Telephone}}

SHIP TO

 {{ShippingAddress:FirstName}} {{ShippingAddress:LastName}}
 {{ShippingAddress:Address1}}
 {{ShippingAddress:Address2}}
 {{ShippingAddress:Address3}}
 {{ShippingAddress:City}}
 {{ShippingAddress:PostalCode}}
 {{ShippingAddress:Country}}

P: {{ShippingAddress:Telephone}}

SOLD BY

 example Strauss & Co Europe
 Airport Building
 someplace 19
 1831 Diegem
 Belguim

 Order No.
 {{ORDERNUMBER}}

 Order Date
 {{ORDERDATE}}

 Invoice No.
 {{INVOICENUMBER}}

 Issue Date
 {{ORDERDATE}}

Dear Customer,

Thank you for shopping on example.com.

If your order comes in multiple shipments, each invoice will show the initial shipping charge but you will only be charged once for your order.

If you have any questions relating to your purchase, please visit us at example.com. Please check our Help Centre section for further guidance.

In case of returns, please note that you have 28 days to return any item.

We look forward to seeing you next time.

example's® Customer Service

VAT amount and price are in: GBP

 Product Code	 Description	 Size	 Qty	 VAT%	  Line Total
(Inc VAT)

 ABC123	  Umbrella1 	 100cm x 100cm	 1	 19.99	 60.00

 ZXY987	  Umbrella2 	 100cm x 100cm	 1	 19.99	 60.00

Payment Info

Customer No. {{CUSTOMERNUMBER}}

Payment Method. {{PAYMENTMETHOD}}

SUBTOTAL
	 {{CURRENCYSYMBOL}}{{SUBTOTAL}}

 SHIPPING	 {{CURRENCYSYMBOL}}{{SHIPPINGTOTAL}}

 VAT	 {{CURRENCYSYMBOL}}{{VAT}}

TOTAL

{{CURRENCYSYMBOL}} {{TOTAL}}

 Vat Registration Number: GB 111 111 111

Company Registration Number: 0424 656 991

Place Of Registration: 181 someplace, Canada

Registered office address:  Someplace 19, 181 Someotherplace

  ";

var pdfStream = GeneratePdfStream(html);

using (FileStream fs = File.Create("somePath.pdf"))
{
      fs.CopyTo(pdfStream);
}

This fails at the following line in the GeneratePdf method:
Document pdfDocument = new Document(stream, htmloptions);
It never steps beyond this line.  I can see this output to debug console in Visual Studio:
Exception thrown: 'System.MissingMethodException' in System.Private.CoreLib.dll

'testhost.exe' (CoreCLR: clrhost): Loaded 'zx_58deb2a6301a4e96b0b71407b2d74f51'. Module was built without symbols.
Exception thrown: '#=zT$tWUPWC0$36rF0x5R0MIrd44UNN_lb$xzK12V4=' in Aspose.Pdf.dll
Exception thrown: '#=zT$tWUPWC0$36rF0x5R0MIrd44UNN_lb$xzK12V4=' in Aspose.Pdf.dll
Exception thrown: '#=zT$tWUPWC0$36rF0x5R0MIrd44UNN_lb$xzK12V4=' in Aspose.Pdf.dll
Exception thrown: '#=zT$tWUPWC0$36rF0x5R0MIrd44UNN_lb$xzK12V4=' in Aspose.Pdf.dll
Exception thrown: 'System.InvalidOperationException' in Aspose.Pdf.dll

I only reference the Aspose.Pdf package, no others.  What would be wrong with the approach above?  I also tried the approach recommended here:  https://docs.aspose.com/display/htmlnet/HTML+to+PDF+Conversion  and also get the same issue with the html string above.
Thanks

2 years to get a response... wow - thanks for that(!)

Can you give a link to that forum? So I can log in the correct place next time.  Thank you

@rmccabe24

Also, please try to post your inquiry on official Aspose.PDF Support forum which is the right place to discuss such issues.

We have shared our forum link in our previous message. Here is it: https://forum.aspose.com/c/pdf


text:
Ajouter pair:Group à Archipel

Reprendre les mêmes prédicats que pair:Organization

Prérequis: ajouter un container /groups sur le middleware

@capucinemasson @mathildesauvage
Mathilde a dit vendredi que vous aviez des erreurs lors de la création. Aviez-vous noté le prérequis ci-dessus qui indiquait qu'il fallait créer un container /groups sur le middleware ? C'est le fichier /src/middleware/boilerplates/pair-ldp-server/containers.js qui doit être édité. Si vous ne travaillez pas avec un middleware local, je vous propose de faire une PR pour qu'il soit ajouté sur data.virtual-assembly.org (je m'occuperai de le déployer ensuite).

Hello Sebastien,
On a bien édité
sur  /src/middleware/boilerplates/pair-ldp-server/containers.js.
Normalement ca c'est bon. Maintenant, notre serveur nous indique ces
erreurs dans la console. Qu'en pense tu ? Si tu dispo tu peux aussi nous
retrouver ici  jusqu'a 17h30. Tu t'introsuis les screens des erreurs.
Merci beaucoup par avance
Capucine et Mathilde
Participer à la réunion Zoom
https://us04web.zoom.us/j/75542539276?pwd=cEZ6RDY2RXhUSWJPcE1rQmU0UU5Ldz09
[image: Capture d’écran 2021-04-13 à 16.25.08.png]
[image: Capture d’écran 2021-04-13 à 16.25.18.png]
Le lun. 12 avr. 2021 à 12:28, Sébastien Rosset @.***> a
écrit :

@capucinemasson https://github.com/capucinemasson @mathildesauvage
https://github.com/mathildesauvage
Mathilde a dit vendredi que vous aviez des erreurs lors de la création de
groupes. Aviez-vous noté le prérequis ci-dessus qui indiquait qu'il fallait
créer un container /groups sur le middleware ? C'est le fichier
/src/middleware/boilerplates/pair-ldp-server/containers.js qui doit être
édité. Si vous ne travaillez pas avec un middleware local, je vous propose
de faire une PR pour qu'il soit ajouté sur data.virtual-assembly.org (je
m'occuperai de le déployer ensuite).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/assemblee-virtuelle/semapps/issues/599#issuecomment-817693409,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ARCRSZPAHPOKSXBPZDDRK4LTILDN3ANCNFSM4YGDMQZQ
.

Salut @capucinemasson
J'ai vu ton message trop tard. Par ailleurs tes captures d'écran ne sont pas passées dans ton commentaire Github.
S'il y a des soucis pour lancer le middleware en local, je propose que vous fassiez une PR avec la modif et que je déploie sur data.virtual-assembly.org

repo: assemblee-virtuelle/semapps


text:
ActivityPub guide

Closes #324

@bouviermullerp Je t'ai mis en reviewer au cas tu veux essayer de t'y coller :-)
Le guide est visible ici https://website-egmzn7xir.vercel.app/docs/guides/activitypub


text:
Iterating through namedarrytuple

Iterating through namedarraytuple currently behaves as iterating through the underlying tuple. I think the desired behavior should be iterating through the underlying array instead? I can write a custom iterator to get around this, but I was wondering if the behavior is intended.

Not planning any changes here, but if you come up with something that seems useful, please reopen!  :)

authors: ankeshanand astooke

repo: astooke/rlpyt


text:
Parser drops second **kwargs

https://play.ruff.rs/8503f0e1-7965-4515-8043-b711159a466b
The second kwargs must be preserved in the AST

Related: https://github.com/astral-sh/ruff/issues/10653

authors: MichaReiser dhruvmanila

repo: astral-sh/ruff


text:
[flake8-pyi] Implement PYI062

Summary
Implements Y062 from flake8-pyi, mostly adopted from Rule::DuplicateUnionMember (without the | BinOp parts).
Currently DuplicateUnionMember also doesn't have an autofix for Union[] cases, so implementing both together seems like a good idea.
Test Plan
cargo test / cargo insta review

Hm the typeshed ecosystem checks look concerning, do you know what's going on there?

@zanieb Doesn't seem to reproduce locally at least with copypasting the concerned files :/

@tusharsadhwani can you try rebasing your PR on the latest main? Maybe it's out of sync.

@tusharsadhwani can you try rebasing your PR on the latest main? Maybe it's out of sync.

I think something might be up with the ecosystem checks when it comes to typeshed. I've had several odd results on some of my other PRs that have touched PYI checks, e.g. https://github.com/astral-sh/ruff/pull/11128. I want to try to look into this today.

Can confirm, merging main doesn't fix the issue.

I think something might be up with the ecosystem checks generally when it comes to typeshed. I've had several odd results on some of my other PRs that have touched PYI checks, e.g. #11128. I want to try to look into this today.

Oh, I see. @AlexWaygood Can you open a new issue to keep track of it? No need to go into detail there but if you're unable to look into it we're still aware of it.

I think something might be up with the ecosystem checks generally when it comes to typeshed. I've had several odd results on some of my other PRs that have touched PYI checks, e.g. #11128. I want to try to look into this today.

Oh, I see. @AlexWaygood Can you open a new issue to keep track of it? No need to go into detail there but if you're unable to look into it we're still aware of it.

Done:

#11305

I double-checked again, and I cannot reproduce the ecosystem results locally on my clone of typeshed. I checked out this PR branch locally in my ruff clone, and then ran this command from the directory of my typeshed clone, with the following results
% cargo run --manifest-path ../ruff/Cargo.toml -- check stubs stdlib --isolated --select=PYI062 --preview --no-cache
    Finished dev [unoptimized + debuginfo] target(s) in 0.10s
     Running `/Users/alexw/dev/ruff/target/debug/ruff check stubs stdlib --isolated --select=PYI062 --preview --no-cache`
All checks passed!

I also confirmed that the same command did highlight duplicate literal members if I purposefully introduced some to a random .pyi file in typeshed.

authors: AlexWaygood dhruvmanila tusharsadhwani zanieb


text:
ruff-check: update docs for fix_only

Summary
Docs-only change to make the behavior when ruff check --fix-only and / or ruff check --diff (which implies fix-only) a bit more explicit.
Closes #11955

Thank you!

authors: MichaReiser wyardley


text:
Attach dangling comments to comprehension instead of if or in node

Summary
This PR fixes the attachment of dangling comments for comprehensions.
The comprehension formatting used to attach some dangling comments to the iter or ifs node as dangling comments.
This causes problems when the iter or if nodes have their own custom logic for handling dangling comments.
For example, binary expressions use the dangling comments to store comments after the operator.
Attaching dangling iter comments to the binary expression misguides the binary expression formatting because
it now formats it as if it has trailing operator comments, which it has not.
This PR fixes the issue by attaching all special comprehension comments as dangling comments to the comprehension and use indexing
to split the comments during formatting.
Test Plan
cargo test. Added test, added debug assertions for nodes that can never have dangling comments (wasn't possible before)

Current dependencies on/for this PR:

main

PR #7693   👈

This comment was auto-generated by Graphite.


text:
uv hangs on install from JFrog Artifactory, but only when building source distributions

uv version 0.1.16 hangs indefinitely on certain installs for me when using --index-url to install from JFrog Artifactory. I am not able to get this to happen when installing from the usual Internet/pypi.org. Fortunately, I am able to reliably reproduce my issue with a particular mix of 3 old, simple packages together, or when they're a part of a larger requirements.txt:
Repro
to repro, run in the official python:3.11-slim docker image:
python3 -m venv testenv
. testenv/bin/activate

# install uv from Internet
pip install uv

# install these 3 packages from an Artifactory cache endpoint
uv pip install --index-url "https://$USERNAME:$TOKEN@subdomainnamegoeshere.jfrog.io/artifactory/api/pypi/pypi/simple" binpacking==1.5.2 expbackoff==0.1.1 frozendict==2.4.0 --no-deps --no-cache --verbose

the end of the verbose logs before it hangs:
...
<similar for expbackoff==0.1.1>
...
<similar for binpacking==1.5.2>
...
DEBUG uv_distribution::source::download_source_dist filename="frozendict-2.4.0.tar.gz", source_dist=frozendict==2.4.0
uv_distribution::source::build_source_dist
DEBUG uv_distribution::source Building: frozendict==2.4.0
uv_dispatch::setup_build package_id="frozendict==2.4.0", subdirectory=None

Workaround
Pretty simple - just do regular pip install for those upfront, then uv pip install for the rest!
Can anyone else using JFrog Artifactory reproduce this issue? I ran this on an EC2 instance in AWS region us-east-1.

Thanks, I think I'll need to setup an Artifactory repo to reproduce.

Tangential, is there a way to specify the index-url for a project? Without needing to specify it for each new package install.

You can use an environment variable e.g. UV_INDEX_URL — we'll add support for reading a persistent configuration file in the future too.

@charliermarsh Following up - I think you can close this issue. I'm no longer able to repro this as of version 0.1.18. There was another (separate) issue where I got HTTP 401 (unauthorized) errors for versions 0.1.22, 0.1.23, but I didn't observe that behavior again as of 0.1.24. Everything seems to work as of the latest version (at time of writing: 0.1.35).

@charliermarsh Following up - I think we can close this issue. I'm no longer able to repro this as of version 0.1.18. There was another (separate) issue where I got HTTP 401 (unauthorized) errors for versions 0.1.22, 0.1.23, but I didn't observe that behavior again as of 0.1.24. Everything seems to work as of the latest version (at time of writing: 0.1.35).

Oh great! Thank you for following up.

authors: charliermarsh cmwetherell skellys zanieb

repo: astral-sh/uv


text:
Git references are not normalized in lockfile

The lockfile currently differentiates between identical Git references depending on how they are declared. For example:
[project]
name = "project"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = [
    "uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@0.0.1"
]

version = 1
requires-python = ">=3.12"

[[distribution]]
name = "project"
version = "0.1.0"
source = "editable+."
sdist = { path = "." }

[[distribution.dependencies]]
name = "uv-public-pypackage"
version = "0.1.0"
source = "git+https://github.com/astral-test/uv-public-pypackage?rev=0.0.1#0dacfd662c64cb4ceb16e6cf65a157a8b715b979"

[[distribution]]
name = "uv-public-pypackage"
version = "0.1.0"
source = "git+https://github.com/astral-test/uv-public-pypackage?rev=0.0.1#0dacfd662c64cb4ceb16e6cf65a157a8b715b979"
sdist = { url = "https://github.com/astral-test/uv-public-pypackage?rev=0.0.1#0dacfd662c64cb4ceb16e6cf65a157a8b715b979" }

Versus:
[project]
name = "project"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = [
    "uv-public-pypackage",
]

[tool.uv.sources]
uv-public-pypackage = { git = "https://github.com/astral-test/uv-public-pypackage", tag = "0.0.1" }

version = 1
requires-python = ">=3.12"

[[distribution]]
name = "project"
version = "0.1.0"
source = "editable+."
sdist = { path = "." }

[[distribution.dependencies]]
name = "uv-public-pypackage"
version = "0.1.0"
- source = "git+https://github.com/astral-test/uv-public-pypackage?rev=0.0.1#0dacfd662c64cb4ceb16e6cf65a157a8b715b979"
+ source = "git+https://github.com/astral-test/uv-public-pypackage?tag=0.0.1#0dacfd662c64cb4ceb16e6cf65a157a8b715b979"

[[distribution]]
name = "uv-public-pypackage"
version = "0.1.0"
- source = "git+https://github.com/astral-test/uv-public-pypackage?rev=0.0.1#0dacfd662c64cb4ceb16e6cf65a157a8b715b979"
+ source = "git+https://github.com/astral-test/uv-public-pypackage?tag=0.0.1#0dacfd662c64cb4ceb16e6cf65a157a8b715b979"
- sdist = { url = "https://github.com/astral-test/uv-public-pypackage?rev=0.0.1#0dacfd662c64cb4ceb16e6cf65a157a8b715b979" }
+ sdist = { url = "https://github.com/astral-test/uv-public-pypackage?tag=0.0.1#0dacfd662c64cb4ceb16e6cf65a157a8b715b979" }

I'm not sure if we can normalize to the revision because the commit pointed to by a tag/branch can change, but we could disambiguate between references before locking.

I think it's correct that we write different values here. Is it getting in your way somewhere?

Not getting in the way, @konstin pointed it out in https://github.com/astral-sh/uv/pull/4406.

I think this is as-intended.

authors: charliermarsh ibraheemdev


text:
Favicon has white space around it

So ugly! Unclear why.

Awful

authors: charliermarsh zanieb


text:
Remove duplicate paragraph on composer doc

Should fix https://github.com/astriaorg/docs/issues/46

Thanks for issue and PR submission. We resolved this in this larger PR migrating to VitePress (https://github.com/astriaorg/docs/pull/45)

Thanks @jbowen93

repo: astriaorg/docs


text:
TAC Updates

@jacquesalice, @rnikutta

Hi @avichalk , are these notebooks supposed to be updating the ones in the TeenAstronomyCafe directory or the e-TeenAstronomyCafe directory? Because they look like the notebooks in the e-TeenAstronomyCafe dir, but this PR is to update the ones in TeenAstronomyCafe...

Hi,
In the instructions I was forwarded I was told to replace the notebooks in the TeenAstronomyCafe directory (6_EPO/TeenAstronomyCafe/). But looking through the notebooks in the e-TeenAstronomyCafe directory, those are much closer to the ones I've been working on. Should my pull request have been for the e-TeenAstronomyCafe directory? The notebooks I edited were all on Google Collab, if that helps narrow it down.
Thanks.

Hi @avichalk , the NBs in 'e-TeenAstronomyCafe' are meant to be run on Google Collab. The NBs in 'TeenAstronomyCafe' might run on Collab, but were never tested nor intended for Collab.
Please double-check with, e.g. Connie Walker, Mark Newhouse, and @DavidVargasMora . If needed, please make a new PR for the 'e-' directory, and close this one.

Yes, I think it is the e- directory. I will close this request and open a new one. Sorry for the inconvenience.

authors: avichalk jacquesalice rnikutta

repo: astro-datalab/notebooks-latest


text:
Wigner FFT + IFFT is not the identity for 'DH' sampling and low bandwidths

First of all, thanks again for this nice library. While working with it, I've noticed some unexpected results in my project, which eventually boil down to the fact that applying the inverse Wigner FFT on the Wigner FFT does not yield the original input, not even at low bandwidth (L=8) and dh sampling (This is actually one of the only cases that I've tested thoroughly). In contrast, an equivalent setup for the $S^2$ transforms seems to work as expected.
So I wondered if this is indeed a problem, or it is to be expected.
I've also attached a small example where I test this out:
L = 8
sampling = 'dh'
a = s2fft.sampling.s2_samples.phis_equiang(L, sampling=sampling)
b = s2fft.sampling.s2_samples.thetas(L, sampling=sampling)
g = s2fft.sampling.s2_samples.phis_equiang(L, sampling=sampling)
f_grid = jnp.meshgrid(g, b, a, sparse=True, indexing='ij')
f_s2 = jnp.squeeze(jnp.sin(f_grid[1]) * jnp.cos(f_grid[2]))
flm = s2fft.transforms.spherical.forward_jax(f_s2, L, sampling=sampling, reality=True)
f_s2_back = s2fft.transforms.spherical.inverse_jax(flm, L, sampling=sampling)
assert jnp.allclose(f_s2, f_s2_back, atol=1e-4), ("Spherical forward + inverse transform is"
                                                  " not the identity")

f_so3 = jnp.sin(f_grid[0]) * jnp.cos(f_grid[1]) * jnp.sin(f_grid[2])
flmn = s2fft.transforms.wigner.forward_jax(f_so3, L, L, sampling=sampling, reality=True)
f_back = s2fft.transforms.wigner.inverse_jax(flmn, L, L, sampling=sampling)
assert jnp.allclose(f_so3, f_back, atol=1e-2), ("Wigner forward + inverse transform is not "
                                                "the identity")

The first assertion passes, but the second one fails.
I've also looked around at other reported issues and found e.g.

#209, but this seems to only appear for higher values of N than I'm testing here
https://github.com/astro-informatics/s2fft/pull/170#issuecomment-1831649757 but this is specific to the HEALPix as far as I understand.

It would be great if you could tell me if I misunderstood something or if this is indeed a bug / numerical issue. Thanks in advance!

Hey @PhilippMisofCH so one of the assumptions of spherical harmonic (and by extension Wigner) transforms is that the underlying signals are band-limited (see e.g. section IV.A of this paper). For signals that are not band-limited the truncation of the summation in equation 9 doesn't hold with equality.
Generally
When you generate a random signal in pixel space it isn't necessarily band-limited, and therefore the (on its face reasonable) assumption that forward followed by inverse should return the original signal doesn't hold.
Specifically
The checkerboard example you use here is a bit of a trick problem I think.

For the spherical harmonic transform you use $f(\theta, \phi) = \sin\theta \cos\phi$. As $\theta \rightarrow 0$ the effective band-limit (maximum frequency) in $\phi \rightarrow 0$, which you can see by considering the case where $\theta = 0$ the function must necessarily be the same $\forall \phi$ as these are all the same locations on the sphere. What is making this function appear to work in the example is that $\sin\theta \rightarrow 0$ as $\theta \rightarrow 0$ and therefore $f(\theta,\phi) \rightarrow 0$ $\forall\phi$ which more closely satisfies (but by no means exactly) the effective band-limit in $\phi$ (everything is just 0). If you instead used $\cos\theta$ in $f(\theta,\phi)$ you will see much more substantial errors at both poles due to this.

For the Wigner transform you use $f(\alpha, \beta,\gamma) = \sin\alpha\cos\beta\sin\gamma$. As per the above argument as $\beta\rightarrow0$ the $\cos\beta$ component doesn't kill the $\gamma$ and $\alpha$ dependencies, and therefore the signal fails to satisfy the effective band-limiting. Changing $\cos\beta$ to $\sin\beta$ reduces these errors somewhat, again for the reasons outlined above, but this is really just hiding the underlying band-limiting issue. If you explicitly band limit your function by  you will find machine precision (or at least that's what I find on my side).

Sidenote
As you mention, if you increase $N$ beyond $\sim 8$ or so you will start to see errors being introduced by the recursion. We've recently implemented more stable recursions for these cases which you can pick up easily through the precompute versions of these transforms. These should be stable $\forall N \leq L$, as always if you have any issues picking this functionality up let us know  :)

Thanks a lot for your detailed explanation! Your analysis of my particular example is spot on, I did not notice that.
I think one of my mistakes is that I assumed a signal generated on a DH grid is effectively band limited and we could still accurately reconstruct the signal at those points, though the signals would deviate quite a bit if compared at other points than the original grid.
My motivation for this was supported by the following working example in the 2d case, where I don't explicitly generate a signal out of a Fourier representation with a corresponding band limit:
L = 8
rng = jax.random.PRNGKey(1234)
f_2d = jax.random.normal(rng, (L, L))
flm = jnp.fft.fft2(f_2d)
f_2d_back = jnp.fft.ifft2(flm)
assert jnp.allclose(f_2d, f_2d_back, atol=1e-8), ("2D fast Fourier + inverse transform is not the identity")

But I assume the actual problem is that I just don't fully understand the sampling theorems on a sphere yet, which is of course not relevant for a Github issue, so since you confirm that the original example works as expected, I'd consider this issue as resolved.
Regarding your sidenote: That is indeed useful to me, I will have a look at it!

authors: CosmoMatt PhilippMisofCH


text:
Private network

Is it possible to connect to a Private Stellar network instead of the main net / oficial test net?

Hello! I’m afraid no, private networks are not supported at the moment. However, I believe it’s easy to add, I will look into it

@JFGHT I just pushed the code for using any network passphrase and updated the README on that part. You can check it out

@charlie-wasp thanks for the fast answer.
Maybe I'm wrong but doesn't this need a change as well?
https://github.com/astroband/astrograph/blob/9cda54c203bf3031f2a73de928c68c8ba38242ee/src/datasource/horizon/base.ts
Horizon could be in a private server :)

@JFGHT ah, yes, definitely :) Thank you! I pushed the fix for this too, now Astrograph supports HORIZON_ENDPOINT environment variable

Looks done!

authors: JFGHT charlie-wasp

repo: astroband/astrograph


text:
Add argument: only cleanup if all tasks succeeded

Please describe the feature you'd like to see
Right now, astro.sql.cleanup deletes temporary tables once upstream tasks are done. However, it does not currently distinguish between upstream tasks finishing because of success vs failure.
I would like cleanup to have an optional argument that prevents cleanup if any upstream task fails. This would be useful during DAG development, where I may not want to keep regenerating all temporary tables while bugfixing failing tasks.
Describe the solution you'd like
An optional boolean argument to cleanup that instructs no cleanup in case of any upstream failure (e.g., pass_on_failure).

Thanks, @scottleechua ! I agree the flag skip_on_failure would be an excellent addition.
Do you have interest and availability to implement this feature? We could support you in getting up to speed if you'd like to!
Otherwise, we'll add it to a milestone and implement it as soon as possible.

@tatiana Yep, I'd be glad to contribute! If you could let me know where to look in the codebase, I'll have a look.
(And if you have any guidelines for contributors, too!)
Many thanks 😄

Hi @scottleechua! Thank you very much.
The cleanup operator implementation is mostly in python-sdk/src/astro/sql/operators/cleanup.py
We'd be introducing skip_on_failure in a similar place to run_sync_mode:
Tests are available at:

unit tests: python-sdk/tests/sql/operators/test_cleanup.py
integration tests: tests_integration/sql/operators/test_cleanup.py

There's a development guide and the contribution guide.
Please let me know how it goes - there's lots of room to improve our docs, and any feedback is much appreciated!
Also, if you'd like to pair on this, we can do it - London and Singapore are not that far and I'm optimistic we could find a time that would work for both.

Hi @tatiana ! Opened a PR as above, can continue the conversation there!
While I couldn't get a dev environment running (the make commands in the development guide were throwing errors), I could run the nox lints and tests just fine. 😄

authors: scottleechua tatiana

repo: astronomer/astro-sdk


text:
Add basic UTO unit-test

Description
What is the current behavior?
Currently, the basic framework for unit-test cases is missing from UTO
related: #1724
What is the new behavior?
Added basic setup for unit-test cases, so that other developers can leverage it.
Does this introduce a breaking change?
Nope
Checklist

[ ] Created tests which fail without the change (if possible)
[ ] Extended the README / documentation, if necessary

Looks good. We can also add CI changes to run the test in this PR.

I'll add a separate PR for CI, meanwhile, you can also add few tests.


text:
add task owner to dbt operator

Description
add owner information to DbtxxxOperator
Related Issue(s)

#1065
Breaking Change?

Checklist

[ ] I have made corresponding changes to the documentation (if required)
[x] I have added tests that prove my fix is effective or that my feature works

here is  the result in airflow web ui

@tatiana
plz check this

repo: astronomer/astronomer-cosmos


text:
Document describing the affiliated package review process

Ready for initial review! (Template emails still need to be written, but the rest can be reviewed)
Preview here

@taldcroft - I've addressed your comments.

I made some tweaks to the language. I don't think it's anything substantive.

Thanks @kelle!

Had a quick look only - but was very happy with that (and hope that this will help clear the pipeline a bit - having a package waiting for review since April, I've got some personal stake there...)

This was approved by all coordinators and no objections from anyone on the list, so I'll go ahead and merge!

authors: astrofrog kelle mhvk

repo: astropy/astropy-procedures


text:
TPCF no random pairs

The TPCF functions should throw a warning when there are no random pairs in a radial bin.  As of now, they continue ahead and return 'inf'.  This can be confusing to the user.

@duncandc - what's the status of this Issue?

I forgot about this 'problem'.  I'll work on it.

done.

authors: aphearin duncandc

repo: astropy/halotools


text:
rls-vscode seem to have issues compiling async-attributes

It appears that projects that depend on async-attributes break rust-lang/rls-vscode#755. I am not exactly how rls-vscode is compiling because I am unable to reproduce issue by running cargo check / cargo build however I do see following error from vscode output:
{"message":"cannot lex `source_file` without source: /Users/gozala/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-1.0.3/src/lib.rs","code":null,"level":"error: internal compiler error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror: internal compiler error\u001b[0m\u001b[0m\u001b[1m: cannot lex `source_file` without source: /Users/gozala/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-1.0.3/src/lib.rs\u001b[0m\n\n"}
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:880:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.44.0-nightly (f509b26a7 2020-03-18) running on x86_64-apple-darwin

note: compiler flags: -C prefer-dynamic -C debuginfo=2 --crate-type proc-macro

note: some of the compiler flags provided by cargo are hidden

{"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: aborting due to previous error\u001b[0m\n\n"}

I am reporting this issue here because it appears that issue is with async-attributes.
I am not seeing same error if I just use quote instead async-attributes so I am not sure what is the problem.

@Gozala this seems like an issue with rls-vscode, and probably not something we can do much to solve here. My understanding is that rls-vscode is not actively developed anymore with most of the effort going into rust-analyzer instead. To my knowledge rust-analyzer doesn't have the same problems, and I'd recommend switching to that instead.
It's a bit of an unfortunate answer, but we don't really have the resources on our side to help solve the issue for rls-vscode.

Thanks @yoshuawuyts, turns out it was neither of two and problem was this https://github.com/rust-lang/rust/issues/69933
Thanks for letting me know about efforts beings shifted towards rust-analyzer, I’ll give that a try.

authors: Gozala yoshuawuyts

repo: async-rs/async-attributes


text:
docs: added table of contents and introduction document for Studio tool

Description
Added the following document for Studio tool for #552

Table of contents
Introduction

For Usage, I was unable to think of what content to start with.
Usage is not possible without explaining the Navigation Panel. What if I am not left with unique content for each document.

lol don't freak out yet @Jagrutiti  ... this to me seems like a possibility for removing usage but keeping the other topics in the Table of Contents... thoughts, @magicmatatjahu?

@alequetzalli @Jagrutiti Sorry for such a delay! Yes, we can now remove Usage section and add it in the next PRs. Usage of Studio is hard to describe, because you can use it by CLI (start it), by studio.asyncapi.com and by docker - we should think if it's necessary to describe, but we can :)

This PR awaits review.
cc: @alequetzalli , @magicmatatjahu

Yes, thank you for the reminder @Jagrutiti!
I am finally able to review this PR, I will finish it by Friday tmw. Thank you for your patience during the past months when it got super busy for me interviewing and onboarding the GSOD writers.
Excited to continue working with you on this one! ✨😄

Hi @alequetzalli
I have been selected as a GSoC contributor. I might not be able to work on them for a few more months.
I do not want these PRs to go stale. CC’d you to confirm we are on the same page. Will resume working on them after GSoC.
Take your time to review the PR.
Hope you have a great time with your GSoD contributors.
Looking forward to working with you :)

@Jagrutiti @alequetzalli this PR begs for some attention. 🥺

Review is pending on this PR. I can continue once @alequetzalli  finds time to review.

Hi @Amzani,
Thank you for taking your time to review.
Except adding the concept definition link (I could not find them) I have made all the changes based on your suggestion.

Thanks @Jagrutiti let's wait for @alequetzalli for final review

let's merge thisssss @Amzani 😃

Just went through the comments. Thanks for the approval.

/rtm

Hey there @Jagrutiti ( or @Amzani ? 😸 ), are you able to accept my commit suggestions? I would love to help merge this ❤

/rtm

@Amzani did you accept my commmit suggestions? It doesn't look like it, thus blocking the merge from happening. :)

@magicmatatjahu can't merge this PR without your approval. can you take a look?

authors: Amzani Jagrutiti KhudaDad414 alequetzalli magicmatatjahu

repo: asyncapi/studio


text:
style: alignment on tools/cli and tools/generator

Description
This PR adds some style fixes for the tools/cli page which includes button and text margin changes.
Before
The button has ml-2 class for all screen sizes, ideally it should only be added for <md devices. and the Example heading should have the mb-4 class same as the above Installation heading.

After

closing this one as a pr has already been raised for this issue

repo: asyncapi/website


text:
fix: broken link to generator github actions

Description
There is a broken link in the AsyncAPI Generator Installation Guide (https://www.asyncapi.com/docs/tools/generator/installation-guide#uninstall-asyncapi-cli) that needs to be updated.
Current Link: https://github.com/marketplace/actions/generator-for-asyncapi-documents
Correct Link: https://github.com/marketplace/actions/generator-validator-converter-and-others-all-in-one-for-your-asyncapi-docs
Related issue(s) Resolve https://github.com/asyncapi/website/issues/3190

Hi @lucky29-git there's already PR opened solving the same https://github.com/asyncapi/website/pull/3071

@DhairyaMajmudar Oh I see, btw the file changed in #3071 is edit-page-config.json which is different from the 3 files I changed.
Should I revoke my PR ?

Yeah, correct so this PR is trying to update the internal non-working links, no need revoke it, wait until maintainers review and merge it : )

@sambhavgupta0705 can you please review this too?

@quetzalliwrites @TRohit20 please take a look

closing this as duplicate https://github.com/asyncapi/website/pull/3217


text:
Global CSS cannot be imported from within node_modules.

This is the output error:
./node_modules/bootstrap/dist/css/bootstrap.min.css
Global CSS cannot be imported from within node_modules.
Read more: https://err.sh/next.js/css-npm
Location: node_modules/react-notification-timeline/index.js
"Reach out to the maintainer and ask for them to publish a compiled version of their dependency."
Thanks

@jcoelh0 I created a nextjs package next-remove-imports to solve the problem.
Example: https://codesandbox.io/s/nextjs-example-react-md-editor-qjhn7?file=/pages/index.js

repo: atapas/notifyme


text:
MediaSession API

Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant.

[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update

How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Checklist:

[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
[x] Any dependent changes have been merged and published in downstream modules

@atapas Could you please review and stage them if its good?
thanks :)

repo: atapas/webapis-playground


text:
🛑 Wedding HTTPS is down

In a97ed8c, Wedding HTTPS ($WEDDINGHTTPS) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Wedding HTTPS is back up in 8a8984e.

repo: atatkin/milos-uptime


text:
🛑 Wedding HTTPS is down

In 79d4eb1, Wedding HTTPS ($WEDDINGHTTPS) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Wedding HTTPS is back up in 8270823.


text:
🛑 Wedding HTTPS is down

In ff13e40, Wedding HTTPS ($WEDDINGHTTPS) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Wedding HTTPS is back up in e6e8690.


text:
🛑 Wedding HTTPS is down

In eeee328, Wedding HTTPS ($WEDDINGHTTPS) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Wedding HTTPS is back up in a92c499.


text:
🛑 Wedding HTTPS is down

In 87a6c04, Wedding HTTPS ($WEDDINGHTTPS) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Wedding HTTPS is back up in 051b78a.


text:
🛑 Wedding HTTPS is down

In 9a3f6a1, Wedding HTTPS ($WEDDINGHTTPS) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Wedding HTTPS is back up in 805ae1b.


text:
🛑 Wedding HTTPS is down

In c8605c1, Wedding HTTPS ($WEDDINGHTTPS) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Wedding HTTPS is back up in eb95813.


text:
🛑 Wedding HTTPS is down

In 01d0b23, Wedding HTTPS ($WEDDINGHTTPS) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Wedding HTTPS is back up in 7bbcc7e.


text:
🛑 Wedding HTTPS is down

In 0a9e359, Wedding HTTPS ($WEDDINGHTTPS) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Wedding HTTPS is back up in d659e0f.


text:
🛑 Wedding HTTPS is down

In 6e41074, Wedding HTTPS ($WEDDINGHTTPS) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Wedding HTTPS is back up in 14744f3.


text:
Rename check_vmware_datastore to check_vmware_datastore_size ?

With the future implementation of a plugin to monitor datastore performance (#505) and datastore (in)accessibility (#507), the check_vmware_datastore plugin should probably be renamed to check_vmware_datastore_size.
I believe I originally intended to make the plugin capable of monitoring most/all attributes related to datastores, but even if implementing the additional support with subcommands, that likely packs too much functionality in one place. Instead, keeping the functionality separate is probably the best direction for now.
While this isn't exactly a breaking change, it could certainly impact deployment tooling and documentation which makes referenced to the current plugin name. As soon as decision is made to proceed with this change I need to start giving a heads up for at least 1-2 releases before doing so.

Note: I'm already referring to the plugin internally as being specific to "size":
https://github.com/atc0005/check-vmware/blob/8bb1795317981bcd63a81fb63638a83baf742cd6/internal/config/constants.go#L169
https://github.com/atc0005/check-vmware/blob/8bb1795317981bcd63a81fb63638a83baf742cd6/cmd/check_vmware_datastore/main.go#L64-L67

Note to self: Don't forget to update the contrib/README.md file with a new tree listing.

Perhaps using a space suffix is the better approach?

I'm leaning this direction.

usage could reasonably be interpreted to mean that activity is occurring
size could potentially be interpreted to mean that the total size is within some threshold

e.g., making sure that its capacity isn't resized past a certain point

space seems to be the more explicit of the naming suffixes available.


text:
Prepare GitHub Actions Workflow for installing rsyslog's Ubuntu PPA-provided packages

Base goals (as I understand them):

[ ] Install packages for all LTS versions of Ubuntu

all available packages?

Extended goals:

[ ] Run config validation?
[ ] Run testbench?

rsyslog/rsyslog-pkg-ubuntu#69

Example of the cron schedule syntax here:

https://github.com/cloudalchemy/ansible-grafana/blob/master/.github/workflows/labeler.yml

Examples of the standard workflow that I use for Go-based builds:

https://github.com/atc0005/check-cert/blob/master/.github/workflows/lint-and-build-code.yml
https://github.com/atc0005/check-cert/blob/master/.github/workflows/lint-docs.yml

Upstream PR accepted, work complete.


text:
change NMSSH version 2.2.6 -> 2.2.8 / Xcode9 compatibility

NMSSH has been updated for XCode8.3 and XCode9 compatibility.

First PR! 🎉 Congrats mon Chico. 😉

Thanks @Deub27! Fell free to add some other changes

authors: Deub27 MonsieurDart nicolaslauquin

repo: atelierdumobile/appdeploy


text:
Request (need testing): use DevContainer's wayland socket feature

What's going on?
With the default settings in fedora38 (wayland), the x11 passthrough didn't work due to privilege issues.
After fiddling a while, I found this config in vscode (defualt true, see https://github.com/microsoft/vscode-remote-release/issues/550):
{
    "dev.containers.mountWaylandSocket": true
}

It turns out that newer versions don't need to set X11 or wayland sockets manually.
After removing the following lines, the wayland passthrough did work properly:
https://github.com/athackst/vscode_ros2_workspace/blob/ce2f256e13486afa5d9d84cda9994dcf0848a6c3/.devcontainer/devcontainer.json#L15-L16
https://github.com/athackst/vscode_ros2_workspace/blob/ce2f256e13486afa5d9d84cda9994dcf0848a6c3/.devcontainer/devcontainer.json#L20-L24
What needs your help? (What I couldn't test)

[ ] Does this work with audio, under wayland?
[ ] Does this work with WSL?
[ ] Does this work with X11 (Does anyone still uses X11 based DEs, anyways?)

After further testing, it turns out the Qt binaries shipped with humble doesn't support wayland, so we still need X11 passthrough.

I've come up with another solution that works nicely on fedora, credit goes to osrf/rocker and this post:
{
    "runArgs": [
        "--volume=/tmp/.${devcontainerId}.xauth:/tmp/.Xauthority"
    ],
    "containerEnv": [
        "XAUTHORITY": "/tmp/.Xauthority"
    ],
    "initializeCommand": "if [ ! -f /tmp/.${devcontainerId}.xauth ]; then touch /tmp/.${devcontainerId}.xauth; fi && xauth nlist :0 | sed -e 's/^..../ffff/' | xauth -f /tmp/.${devcontainerId}.xauth nmerge -",
}

Since this has gone out of the original issue's scope, I'll close and create a new one.