whereHas() not working with MorphTo()

The whereHas() method for querying a polymorphic relationship doesn't seem to be working.
Here are the relationships:
Transaction.php

public function transactionable()
    {
        return $this->morphTo('transactionable');
    }

Reservation.php

public function transactions()
    {
        return $this->morphMany('Transaction', 'transactionable');
    }

Project.php

public function transactions()
    {
        return $this->morphMany('Transaction', 'transactionable');
    }

And here is what I am trying to do:
return Transaction::whereHas('transactionable', function($q){
        return $q->where('id', '=', '1');
    })->get();

Result:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'transactions.' in 'where clause' (SQL: select * from `transactions` where (select count(*) from `transactions` where `transactions`.`transactionable_id` = `transactions`.`` and `id` = 1) >= 1)

Is this possible?

Running into the same issue. Any more information on it?

I have the same problem. Very sad.

I ran the code:
$tasksQuery->whereHas('taskable', function ($q) use ($search) {
    $q->where('title', 'like', "%{$search}");
});

but it throw an exception.

I reaallly need this asap, so I'm going to look into it in a few days and try to debug it. I don't know anything about the code, so if anyone could clarify what I should be looking for, go ahead.

Yup same here. Wonder if this was ever working?

I think this kinda impossible currently, because if you see the MorphTo class were derived from BelongsTo relation class, but in BelongsTo model relationship declaration of the model or foreign key were explicitly configured, whereby in MorphTo relationship is not pointing to related model.
This polymorphism relationship only fully capable when the model instance/object were loaded whereby the data_type value that pointing to related model class can be obtained. And in whereHas situation, the builder class need to gather all the query related information such as filter, binding and etc to be use later on query generation and execution. It's impossible to create a queries without knowing the kind row/data type that will be retrieve later
You can have a look at file Eloquent\Relations\BelongsTo.php, method 'getRelationCountQuery' this is where everything is falling apart.
I'm sure @taylorotwell and others core developer were fully aware about this issue, but it might be too hacky to make this possible. Anyway it's just my opinion.

Looks like this is a no-fix then.

Err. Any workaround then?

What about throwing a better exception when it happens? Also would like to
see a work-around :-) Also, what about maybe passing a parameter that's an
array of possible table/model names?
On Thu, Feb 5, 2015 at 10:52 AM, Sebastiaan Luca<EMAIL_ADDRESS>wrote:

Err. Any workaround then?
—
Reply to this email directly or view it on GitHub
https://github.com/laravel/framework/issues/5429#issuecomment-73103451.

--
Sabrina Gelbart
Web Design & Development, Graphic Design, Motion Graphics
www.Sabrina-Gelbart.com
skype: sabrina.gelbart
cell:<PHONE_NUMBER>

You could try to have the Builder class to look ahead for the value of the morphed relation class. Code provided is the only proof of concept, it's not a workaround or a suitable solution. Please do not use in your code/project.
As you can see the line with variable $look_ahead is trying to fetch($parent::first) the data/model instance and get a morphed relation of it.
illuminate/database/Illuminate/Database/Eloquent/Builder.php
	protected function getHasRelationQuery($relation_name)
	{
		return Relation::noConstraints(function() use ($relation_name)
		{
			$relation =  $this->getModel()->$relation_name();

			if( get_class($relation) == 'Illuminate\Database\Eloquent\Relations\MorphTo'){
				$parent = $relation->getParent();
				$look_ahead = $parent::first();
				$relation = $look_ahead->{$relation_name}();
			};

			return $relation;
		});
	}

By using this the whereHas execution will return a value without failing, although it might not returning the right data due to the poor look ahead mechanism. It might be a good start point to explore other possibilities.

Thanks @wajatimur! By using an adjusted version of your code, I can use whereHas by providing the …able_type. It only works for a single type, but in a sense, that's only logical. Does what it needs to for me.
/**
 * Get the "has relation" base query instance.
 *
 * @param  string  $relation
 * @return \Illuminate\Database\Eloquent\Builder
 */
protected function getHasRelationQuery($relation)
{
	return Relation::noConstraints(function() use ($relation)
	{
		$name = $relation;
		$relation = $this->getModel()->$relation();

		if (get_class($relation) === 'Illuminate\Database\Eloquent\Relations\MorphTo') {
			$lookAhead = $this->getModel()->where($name . '_type', '=', 'App\Models\Auth\Users\Admin')->first();
			$relation = $lookAhead->{$name}();
		};

		return $relation;
	});
}

Feedback is appreciated.

Hi @Quagh, glad its work! A whereHas method will construct COUNT SQL query for each level of whereHas query plus with WHERE query using addWhere method in Builder class if I'm were not mistaken.
By not having to scheme deeper on the Builder class code and i think the only possible solution is to place a placeholder in the generated query and it will refer back to some special method such as getHasRelationQueryMorphed to get an appropriate sub query to be inject. But anyway, its just a theory.

I'm not really following you when you mention to put a placeholder in the generated query. Can you elaborate on that?
Anyway, I forked the Laravel repo and applied my changes to them. If anyone's interested, check out https://github.com/Quagh/framework/tree/database/fix_whereHas_with_morphTo.
Here's an example of how to use it. You just pass a string or array of strings of types it should look for. In my opinion, that's the only workable way the query builder can gather all the necessary elements to apply the whereHas. Another way would be to query the whole table, check for all different able_types, find the models, check the fields/relationships on there, etc. But not really do-able.
 $this->whereHas('userable', function ($query) use ($id) {
    $query->where('id', '=', $id);
}, '>=', 1, [User::formatUserableType('admin'),User::formatUserableType('contact')]);

Composer.json:
"require": {
    "laravel/framework": "dev-database/fix_whereHas_with_morphTo as 4.2.17"
},

"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/Quagh/framework.git"
    }
],

And this is the query it produces when executing the code above (in my app);
select * from `users` where `users`.`deleted_at` is null and ((select count(*) from `admins` where `users`.`userable_id` = `admins`.`id` and `id` = ? and `admins`.`deleted_at` is null and `users`.`userable_type` = ?) >= 1 or (select count(*) from `contacts` where `users`.`userable_id` = `contacts`.`id` and `id` = ? and `contacts`.`deleted_at` is null and `users`.`userable_type` = ?) >= 1)

As you see, it wraps a single whereHasquery in parenthesis. This to make sure where users.deleted_at is null applies to all has queries when providing multiple able types.
Trying to run phpunit tests right now to verify it doesn't break anything else. I don't have much experience writing tests myself, so if anyone feels like it, go right ahead :)
Again, feedback / testing appreciated.

:+1: Same here

Yep! Same here!

 Anyway can anybody confirm, does this issue still exist in Laravel 5?

Still having this issue in Laravel 5

I'm also seeing the same issue in L5 (5.0.30).  Would be great to have an official fix soon as the bugs been around for a while.  Thanks to @Quagh for the interim solution though - I'll check that out

We're open to pull requests. :)

Would love to but it's a level of voodoo slightly above my pay grade!  Sorry if I sounded demanding... ; )

@GrahamCampbell I think I can do a pull request, though I'd love some feedback on my implementation. It requires an extra variable (and clutters the morph class a bit), but it's the only viable solution I've come up with so far. It works though, which I think is the most important part :)

@Quagh Just send the PR and you'll get feedback :wink:

Are there any news for the PR? :(

Haven't really had time to look into it. My code's available so if anyone wants to have a go at it… Should work out-of-the-box with some cleanup.

@nkeena, please correct me if I'm wrong, but in your example, you are trying to find the transactions of both Reservation and Project with id = 1. Is that right? You could do the same simply by querying for
transactionable_id in your Transactions table.
If you know which model you want to search, you can use a join instead of a whereHas. Following @nkeena's example:
return Transaction::join('reservations', 'transactions.transactionable_id', '=', 'reservations.id')
    ->where('reservations.id', 1);
})->get();

I'm kind of pressed with time, but as soon as I can I'll post a use case similar to what I faced.

So, no official fix for this? :(
Now I hate polymorphic tables :P

@Aragami23 this is current limitation on this feature.
@pedromanoel not working on polypmorhic as relation between table is dynamic were determined upon query.

not yet???? ;(

I don't think there's any other solution than to pass it a list of models the query has to check for. See my example https://github.com/laravel/framework/issues/5429#issuecomment-74334956.

@sebastiaanluca, thanks for comment. Is that solution fit to laravel 5.1.*?

@dehypnosis I suppose, but haven't tested it as I didn't need the functionality anymore.

As this thread was closed, but I needed polymorph support for whereHas method I have adopted @sebastiaanluca to be compatible with Laravel 5.2.
Here is my gist https://gist.github.com/ddctd143/03b92aed6c76986dbd99
Those two files extends laravel default builder, can be used with model that points use CustomBuilder.php instead of default laravel Model.php

@ddctd143 Will this work with Laravel 5.0?

I made the code by @ddctd143 work with Laravel 5.0 if anyone wondering:
Just change the code at line 36-37 from:
$queryType = $this->shouldRunExistsQuery($operator, $count) ? 'getRelationQuery' : 'getRelationCountQuery';
to:
$queryType = 'getRelationCountQuery';
Yes, I still use 5.0, for client's PHP version compatibility purposes. Laravel evolve so fast I can't expect all our client to have the latest PHP.

An easier workaround, without the need to change Laravel code, is to use $query->has('relation', '>', 0) instead of the (implicit) $query->has('relation', '>=', 1). That also avoids the exists query because shouldRunExistsQuery specifically checks for >= 1:
// From Illuminate\Database\Eloquent\Builder.php

protected function shouldRunExistsQuery($operator, $count)
{
    return ($operator === '>=' && $count === 1) || ($operator === '<' && $count === 1);
}

Note however that the performance will be bad! So to alleviate that, first limit your result set and then use count instead of exists:
MyModel::has('relation', '>', 0)->where(...)->get(); // slow!
MyModel::where(...)->has('relation', '>', 0)->get(); // much faster.

Or, when you use scopes like function scopeHavingRelations():
MyModel::where(...)->havingRelations()->get();

@mk-relax This wont work.
I tried
$model = $model->has('advertable', '>', 0, 'and', function ($q) {
    $q->where('area', '>=', $this->fromArea);
});

And laravel does not know which polymorph table to use. It inserts laravel_reserved_0 instead of related table name. Attached error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'area' in 'where clause' (SQL: select count(*) as aggregate from `adverts` where `category_id` = 1 and exists (select * from `advert_locations` where `advert_locations`.`advert_id` = `adverts`.`id` and `location_id` in (2196)) and (select count(*) from `adverts` as `laravel_reserved_0` where `laravel_reserved_0`.`id` = `laravel_reserved_0`.`advertable_id` and `area` >= 40 and `laravel_reserved_0`.`deleted_at` is null) > 0 and `laravel_reserved_0`.`deleted_at` is null)

@vjoao There won't be a fix as this issue was closed while ago.

+1

Is there an update for this?
I'm trying to filter on a polymorphic table.
Currently I’m able to filter through all the feeable objects…
        $total = 0;
        foreach ($this->fees as $fee){
            $total += $fee->feeable->fee;
        }
        return $total;
    }```
but now I would like to only count the total fees from the feeable objects who only match either `App\TuitionFee::class` and `App\FacilityFee::class`.

I believe my question relates to this, right?

Did you mean filtering on relation? Have you look at constrain eager loading?
On 26 Sep 2016, at 7:58 PM, pavankataria <notifications<EMAIL_ADDRESS>wrote:
Is there an update for this?
I'm trying to filter on a polymorphic table.
Currently I’m able to filter through all the feeable objects…
public function totalFees(){
$total = 0;
foreach ($this->fees as $fee){
$total += $fee->feeable->fee;
}
return $total;
}
but now I would like to only count the total fees from the feeable objects who only match either App\TuitionFee::class and App\FacilityFee::class.
I believe my question relates to this, right?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/laravel/framework/issues/5429#issuecomment-249550392, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAU5IX4Q3LYmwkjqL5awBIqnOYnFgbUZks5qt7OAgaJpZM4CWoDL.

If someone is having this issue, here is a workaround : perform a filter on the collection after the where requests. Using the example given by nkeena at the beginning of this thread :
return Transaction::where(...)->get()->filter(function ($value, $key) {
    return $value->transactionable->myField == 'myValue';
});

It doesn't do exactly the same thing as a whereHas would : it gets more Transaction items in database than necessary. But it works.

Should one even be allowed to execute whereHas() on a morphTo() relation while it is not working? I suggest to throw an exception for easier debugging.
And to make it work, could we add an array to the model that has the morphTo() relation to describe the possible classes it is linked to? This would enable us to add orWhereHas's for each entry in that array in the way @blankhua suggested. This would help at least some people. In case the array doesn't exist or doesn't have any entries for that relation, the exception I suggested above could be thrown.
If some people agree that this could be a viable solution, I can probably make a PR.

@GrahamCampbell Is anyone seeing my latest comment? Since the issue is closed. Or should I open a new one? I'd really like some feedback on it.

@JeroenVanOort wht to restrict ? everything works with modifications provided here by others or by me in gists. I'm using morphTo with whereHas since Laravel 5.1

I think there should be a restriction when calling whereHas() on a morphTo() relation because it doesn't work, a least not out of the box. But, no restriction is needed when we can make it work, possibly the way I suggested. I think it would be a valuable addition if it can be made to work.

@JeroenVanOort can you submit PR to fix this issue, so that there is ability to use whereHas() on morphTo() ?
I think that restriction is not solution. After restriction would be made some of us, would need to hack code once more, so that temporary solution that is working for now would work again after restriction will be applied.

I came up with BelongsToMorph relationship type, and got whereHas working. Obviously, it only works on a single type, so you need to have explicit relationship declaration for each type.
// Model
class Comment extends Model
{
    public function post()
    {
        return BelongsToMorph::build($this, Post::class, 'commentable');
    }

    public function note()
    {
        return BelongsToMorph::build($this, Note::class, 'commentable');
    }
}

Source: https://gist.github.com/brunjick/3022fee8afa53e45a6b89da3f16b3815

It's very strange, that solution still is absent in official package. Hey, Taylor, want you think about this problem?

@dihalt This issue was closed while ago. I'm still using workaround code provided here by others, and modified by me. Laravel is now at version 5.4 and problem still exists. Maybe you could open new issue ?

Another workaround:
Add to Transaction.php
`
public function reservation()
{
return $this->blongsTo('Reservation::class');
}
public function project()
{
return $this->blongsTo('Project::class');
}
`
And do:
return Transaction::where('transactionable', 'reservation')->whereHas('reservation', function($q){         return $q->where('id', '=', '1');     })->get();

Pleeease

I came across this issue today in Laravel 5.5. I'll be joining the workaround crew for now.

Having had a this problem a while ago, we wrote a composer package that extends the Eloquent Builder class and implements a work around for this issue. It's not perfect but it does the trick.
https://github.com/rapidwebltd/Improved-Polymorphic-Eloquent-Builder
It's currently designed for Laravel 5.1, but shouldn't be too hard to adapt for Laravel 5.5. Contributions welcome!

@DivineOmega your solution is good.
but it is do not support for whereHas in polymorphic whereHas.
so i send to 'pull request' that solution for this problem to that repository.

I searched how to fix where query with morphed table, and come to here and not solved yet :3rd_place_medal:

As a temporary workaround, you could declare a relationship for each type.
Transaction.php

    public function transactionable()
    {
        return $this->morphTo('transactionable');
    }
    public function reservation()
    {
        return $this->belongsTo(Reservation::class, 'transactionable_id')
            ->where('transactions.transactionable_type', Reservation::class);
    }
    public function project()
    {
        return $this->belongsTo(Project::class, 'transactionable_id')
            ->where('transactions.transactionable_type', Project::class);
    }

Reservation.php

    public function transactions()
    {
        return $this->morphMany(Transaction::class, 'transactionable');
    }

Project.php

    public function transactions()
    {
        return $this->morphMany(Transaction::class, 'transactionable');
    }

And then query the model like this:
    return Transaction::whereHas('reservation', function($q){
        return $q->where('id', '=', '1');
    })->orWhereHas('project', function($q){
        return $q->where('id', '=', '1');
    )->get();

It's not perfect but worked for me so I though I should share it in case someone has the same use case.

Just upgraded to Laravel 5.6, this bug is still present. Can please we re-open this issue?

Just ran into this issue today as well laravel 5.6.20

@flyrmyr this is a wont-fix. There is no non-hacky way of doing this.

Ran in the same problem today. Maybe this could be mentioned in the documentation.

Same problem with 5.6

@thisdotvoid's solution here with BelongsToMorph seems to work without issue in 5.6.x

@Braunson yes it works but only for explicit relationships.

@thisdotvoid's solution works in Laravel 5.6.29 (implemented a few minutes ago). It will be nice to have an official way to do this in a close future :)

polymorphic relations.... same problem here! they are a pain in my ass...

Same problem here  5.7.9

This party never going to end..

We are working on a solution for this issue: https://github.com/laravel/ideas/issues/1651
The current draft focusses on use cases where the same constraint should be applied for all types:
Event::whereHasPolymorphic('eventable', [Post::class, Video::class], function ($query) {
    $query->where('title', 'like', '%'.$search.'%');
});

You can also provide a wildcard and let Laravel get the possible types from the database:
Event::whereHasMorph('eventable', '*', function ($query) {
    $query->where('title', 'like', '%'.$search.'%');
});

A concern with this approach is that it makes applying different constraints more complicated:
Event::where(function ($query) {
    $query->whereHasMorph('eventable', Post::class, function ($query) {
        //
    })->orWhereHasMorph('eventable', Video::class, function ($query) {
        //
    });
});

An alternative solution could be an associative array. This would simplify different constraints but complicate cases with the same constraint for multiple types:
Event::whereHasMorph('eventable', [
    Post::class => function ($query) {
        //
    },
    Video::class => function ($query) {
        //
    },
]);

What's your option on this? Would you typically use the method with a single or multiple constraints?

Laravel 5.8.27 will add whereHasMorph(): #28928

woooooo ... i hardly can believe this! thank you so much

stops the warning but not result set
return $this->morphMany(MODEL::class, 'name','type','pk');

this works for me.
Transaction.php
public function transactionable()
{
    return $this->morphTo('transactionable');
}
public function reservation()
{
    return $this->morphInstanceTo(Reservation::class, 'transactionable', 'transactionable_type', 'transactionable_id', 'key');
}
public function project()
{
    return $this->morphInstanceTo(Project::class, 'transactionable', 'transactionable_type', 'transactionable_id', 'key');
}

Reservation.php
public function transactions()
{
    return $this->morphMany(Transaction::class, 'transactionable', 'transactionable_type', 'transactionable_id');
}

Project.php
public function transactions()
{
    return $this->morphMany(Transaction::class, 'transactionable', 'transactionable_type', 'transactionable_id');
}

Hello Friends
I got solution in Laravel official document pleas check below link.
solution Here
I hope this link will be usefull for you.

thanks bro you are god


Can't run iOS or Android on Starbucks wifi

Strange but interesting I wish I could give you more info but after 3 hours of trying t debug this I got nothing. App doesn't go past the loading screen on iOS or android when running 'ionic run android' no console logs and no errors. Maybe I am doing something wrong. It also doesn't work at my apartment's public wifi. Ionic cli 2 ionic version 1.3.1

Hello! Unfortunately im not sure their is anything we can do on our end to help this. This sounds like an issue related to reliable internet and not an ionic issue. Sorry that i can not help further. Thanks for using Ionic! I would recommend maybe tethering to another device if possible.


Re-process versions.tools-version

I just tried to pull some stats from the database about the Swift tools version that @Sherlouk kindly added support for recently, and unfortunately, we only have information for 166 packages as those are the packages that have moved their default branch forward since the change.
It would be useful, for when we roll out analysis changes like this, to be able to force an analysis pass for the three significant versions of every package (default branch, latest release, and latest beta) for when we add or change the logic in the analysis phase.
After we just chatted about this, I know this is not trivial. But, I think it's worth considering a change where we can ask a package to re-analyse, without triggering a diff in the reconciliation where packages are treated as new versions.

Re-processing under way on dev via
 trap : TERM INT; while true; do ./Run re-analyze-versions --before 2020-06-25 --limit 10; sleep 10; done

I've started with an older date to get a smaller scope (but it affects 2077 packages nonetheless). Looking good so far, we should be done with that first test in ~40 mins.
Once that's done and validated, I'll re-run it with --before 2021-01-13. That's the day after we merged #877 and deployed the targets addition to Product. I.e. from 2021-01-12 we've running the latest versions update logic (with tools_version being correctly populated quite a while before targets).

Re-processing under way on dev via
 trap : TERM INT; while true; do ./Run re-analyze-versions --before 2020-06-25 --limit 10; sleep 10; done

I've started with an older date to get a smaller scope (but it affects 2077 packages nonetheless). Looking good so far, we should be done with that first test in ~40 mins.
Once that's done and validated, I'll re-run it with --before 2021-01-13. That's the day after we merged #877 and deployed the targets addition to Product. I.e. from 2021-01-12 we've running the latest versions update logic (with tools_version being correctly populated quite a while before targets).

Staging is now fully processed. Will do prod next and then close this.

Staging is now fully processed. Will do prod next and then close this.

prod is done as well now, with --before 2021-01-13 🎉

prod is done as well now, with --before 2021-01-13 🎉


[1.10.2][1.0.3] Compatibility with Immersive Engineering power

I can't seem to get power to transfer into the Power Input Plug when using Immersive Engineering's Wire Connectors.

is the generator from AR as well or are you using a generator from another mod?
Reason I ask is that I'm finding neither IE nor EnderIO are pulling power from AR generators however EnderIO can put power into AR machines at least.  I've not been able to insert power with IE either.

I got a fix for the enderIO stuff, but Immersive Engineering is not something I can easily fix.  As far as I can tell problem with IE is that he's not using Forge's Capability system to extract and/or insert energy into blocks but rather checks for the existance of Tesla or RF interfaces on the tileentity.  For me to do that would require me to backport to the old way of handling power, which is much more rigid.  I'll look into submitting a pull request and/or developing a workaround.

Submitted a pull request to IE to allow it to insert power into blocks implementing the Forge Capability system here: https://github.com/BluSunrize/ImmersiveEngineering/pull/1821.

is the generator from AR as well or are you using a generator from another mod?

I didn't try the AR generators, I used creative capacitors from IE and EnderIO with the wire connectors from IE.

Alright, either way testing with the patches to libvulpes and the pull request to IE seems to work fine in every case.  Compat should work with the next builds of IE and LibVulpes.


Added DropDownTemplate / DropDownTextProperty to specify a different template / property name in the drop down list

Added DropDownTemplate to specify a different template in the drop down list vs control
Added DropDownTextProperty to specify a different text property in the drop down list vs control
Uses the normal template / property name if undefined so no breaking changes.

I'm afraid that I don't understand how this is different compared to Template/ValueTemplate.

When using Template/ValueTemplate I am getting "Operator '==' incompatible with operand types 'String' and 'Zone_VM'" using the below
<RadzenDropDown<EMAIL_ADDRESS><EMAIL_ADDRESS>TValue="Zone_VM"<EMAIL_ADDRESS>FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" AllowFiltering="true">     <ValueTemplate>         @((context as Zone_VM).City)     </ValueTemplate>     <Template>        @((context as Zone_VM).ZoneDisplayFriendly)     </Template> </RadzenDropDown>
OR
<RadzenDropDown<EMAIL_ADDRESS><EMAIL_ADDRESS>TValue="Zone_VM"<EMAIL_ADDRESS>ValueProperty="@nameof(Zone_VM.City)" TextProperty="@nameof(Zone_VM.ZoneDisplayFriendly)" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" AllowFiltering="true"> </RadzenDropDown>
Location.CurrentZone is an object
however when I use my implementation replacing ValueTemplate with Template and Template with DropDownTemplate it is working, looks like the error is coming from SelectItemFromValue or OnParametersSetAsync in DropDownBase, I'm currently investigating if maybe there is currently a bug , should the above be working with ValueTemplaate / Template?

Seems like line 1252 in DropDownBase (SelectItemFromValue) when T is an object is causing the error comparing the object to whatever type ValueProperty is instead of comparing it to the ValueProperty of value (ex Foo.value == Bar instead of Foo.value == Bar.value), changing
SelectedItem = view.AsQueryable().Where(DynamicLinqCustomTypeProvider.ParsingConfig, $@"{ValueProperty} == @0", value).FirstOrDefault();
to the below does seem to make Template / ValueTemplate work like this PR for me, let me know if you want me to make a PR for this, I don't think it should break anything, seems like there are some other functions that have this bug as well (UpdateSelectedItems, line 1241), but I haven't done a full search yet
SelectedItem = view.AsQueryable().Where(DynamicLinqCustomTypeProvider.ParsingConfig, $@"{ValueProperty} == @0", GetItemOrValueFromProperty(value, ValueProperty)).FirstOrDefault();

Template/ValueTemplate gives you the ability to customize what should be displayed in the DropDown or when the value is chosen. TextProperty gives you the same if the templates are not defined and it will be used for filtering. ValueProperty is used when you need to perfect lookup using @bind-Value.

@Greg-MM I think you just need to set TextProperty and your scenario should work without any changes.

I tried that, the error comes in when bind-Value is not a string, but an object.
Changing String value to Customer value on the "Define Text & Value properties" demo and hitting run will cause the InvalidCastException upon selecting a value, so I think the above changes in the comment changing
value to GetItemOrValueFromProperty(value, ValueProperty) will allow binding the DropDown value to an object instead of just a string
`@using RadzenBlazorDemos.Models.Northwind
@inherits DbContextPage

@code {
Customer value;
IEnumerable customers;
protected override async Task OnInitializedAsync()
{
    await base.OnInitializedAsync();

    customers = dbContext.Customers;
}

}`

When binding to the entire object you should not set ValueProperty:
@using RadzenBlazorDemos.Models.Northwind

@inherits DbContextPage

<RadzenDropDown @bind-Value=@value Data=@customers TextProperty="@nameof(Customer.CompanyName)"  />

@code {
    Customer value;
    IEnumerable<Customer> customers;

    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();

        customers = dbContext.Customers;
    }
}

Awesome, thanks a lot its working now, would you be interested in a PR with code that throws an exception when ValueProperty is defined and T is not String, or maybe just null out the property, was trying to think of a way of detecting at compile time, best bet would probably be some sort of Roslyn analyzer, but I haven't done any of that and don't have time to go down that rabbit hole at the moment.
Also looking to implement this same functionality of binding to objects, different Template and ValueTemplate to the AutoComplete control by making it a generic class as it more fits the free form entry that I am going for, is this something that you would want a PR for, I'm really only testing in WASM so it would need some decent testing on Server / Hybrid environments as it will likely be much more significant changes to that class?

We prefer not to throw such exception, also the DropDown component is already enough complex and we would like to avoid more coupling with other components - the AutoComplete component also don’t have ValueProperty. I’m closing this PR - use our forum in the future to avoid unnecessary coding.


Feature request: "You're connected" indicator

I'm testing Burrow, and noticed that there's no indication that you're connected. I think most servers send you something like "Looking up your hostname" messages which makes it more obvious.
A little message saying you're connected might be helpful. I've attached a screenshot of a successful connection to a testnet, with no messages.

Hmm, this is an interesting one for sure. I think waiting for just a moment and then displaying our own "Connected!" message if none comes from the server would work pretty decently. Kinda wanna keep ircdog relatively light, always printing a Connected! message feels a little strange.
I'll play around with it, might not be that bad once I try it out for realsies. Thanks very much for the suggestion!

If we get readline support (#28), the prompt won't display until we successfully connect to the remote, which will help somewhat.
We might also consider a verbose mode (compare netcat).

fwiw, netcat's behaviour:
✨ ~ % nc irc.libera.chat 6667
:cadmium.libera.chat NOTICE * :*** Checking Ident
:cadmium.libera.chat NOTICE * :*** Looking up your hostname...
:cadmium.libera.chat NOTICE * :*** Found your hostname: husky.lolnerd.net
^C
✨ ~ % nc irc.libera.chat 6667 -v
Connection to irc.libera.chat (2001:470:1:dea::95) 6667 port [tcp/ircd] succeeded!
:cadmium.libera.chat NOTICE * :*** Checking Ident
:cadmium.libera.chat NOTICE * :*** Looking up your hostname...
:cadmium.libera.chat NOTICE * :*** Found your hostname: husky.lolnerd.net

Yeah, that's similar to what we print unconditionally in --listen mode:
https://github.com/ergochat/ircdog/blob/dd3d41b84e2b44a063735190571b039a06e4ca93/ircdog.go#L417
I'm sold, let's get a verbose mode.

Added --verbose in 8e33735f54e4ec779156e46dd4fd69a7e77c3fc6


Win-sudo 'UAC elevation was canceled' error

I just installed win-sudo on Windows 10 1909 OS build 18363.815, but once I try to do sudo or su, I always get an error of: UAC elevation was canceled.
Here's the input above:
fath0m@THINKPAD-T480S MINGW64 /
$ su
UAC elevation was canceled

and
fath0m@THINKPAD-T480S MINGW64 /
$ sudo echo 1
UAC elevation was canceled

Once I type a sudo command, it waits for a few seconds and then outputs the error.

@fath0m I may have fixed this with my PR at https://github.com/imachug/win-sudo/pull/43, though I'm running into some other errors, feel free to give it a try.

@fath0m I may have fixed this with my PR at #43, though I'm running into some other errors, feel free to give it a try.

Thanks for the reply and effort. I didn't manage to make it work, so now I'm using https://www.npmjs.com/package/win-sudo and it is working perfectly.


feat: extensible factories

Extend current code by registering new plugin/strategy before invoking release-please. This makes possible to extend this tool by composition, instead of inheritance (forking).
Closes #1341

The only weirdness I see is that the tests for registering new types leaves the entries registered (because we're basically using global scope), but I don't see a good way around that right now.

You are right about that, this might break some tests if they would be executed in a different order (especially cli.ts which have lists of supported types in a snapshot).
I've added unregister* functions, which are only used in tests. I know, it is an anti-pattern, but tests depending on execution order are a problem just waiting to happen. I'd call it lesser evil 👿

Ready :)


build(docker): enable snapshot for memdb by default

Codecov Report
Base: 90.52% // Head: 90.52% // No change to project coverage :thumbsup:

Coverage data is based on head (641c112) compared to base (466de76).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #29   +/-   ##
=======================================
  Coverage   90.52%   90.52%
=======================================
  Files          33       33
  Lines        2449     2449
=======================================
  Hits         2217     2217
  Misses        158      158
  Partials       74       74

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.


extension returns the same email

Description
After some time when i click generate private duck address extension keeps returning the same email
Steps to Reproduce
i don't know how to reproduce it. it show up after some time
Expected behavior:
extension generates new email when requested
Actual behavior:
extension generates the same email
Versions

Extension: 2024.7.24
Browser: Vivaldi
OS: Windows

Additional Information
in dev tools i see request to https://quack.duckduckgo.com/api/email/addresses fails with net::ERR_SSL_CLIENT_AUTH_CERT_NEEDED

failed http request HAR file
{
  "log": {
    "version": "1.2",
    "creator": {
      "name": "WebInspector",
      "version": "537.36"
    },
    "pages": [],
    "entries": [
      {
        "_initiator": {
          "type": "script",
          "stack": {
            "callFrames": [
              {
                "functionName": "fetchAlias",
                "scriptId": "6",
                "url": "chrome-extension://bkdgflcldnnnapblkhphbgpggdiikppg/public/js/background.js",
                "lineNumber": 30342,
                "columnNumber": 13
              }
            ],
            "parent": {
              "description": "await",
              "callFrames": [
                {
                  "functionName": "refreshAlias",
                  "scriptId": "6",
                  "url": "chrome-extension://bkdgflcldnnnapblkhphbgpggdiikppg/public/js/background.js",
                  "lineNumber": 30375,
                  "columnNumber": 17
                },
                {
                  "functionName": "",
                  "scriptId": "6",
                  "url": "chrome-extension://bkdgflcldnnnapblkhphbgpggdiikppg/public/js/background.js",
                  "lineNumber": 25562,
                  "columnNumber": 74
                },
                {
                  "functionName": "onMessage",
                  "scriptId": "6",
                  "url": "chrome-extension://bkdgflcldnnnapblkhphbgpggdiikppg/public/js/background.js",
                  "lineNumber": 904,
                  "columnNumber": 27
                }
              ]
            }
          }
        },
        "_priority": "High",
        "_resourceType": "fetch",
        "cache": {},
        "request": {
          "method": "POST",
          "url": "https://quack.duckduckgo.com/api/email/addresses",
          "httpVersion": "",
          "headers": [
            {
              "name": "Referer",
              "value": ""
            },
            {
              "name": "DNT",
              "value": "1"
            },
            {
              "name": "Authorization",
              "value": "Bearer 123"
            },
            {
              "name": "User-Agent",
              "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/<IP_ADDRESS> Safari/537.36"
            }
          ],
          "queryString": [],
          "cookies": [],
          "headersSize": -1,
          "bodySize": 0
        },
        "response": {
          "status": 0,
          "statusText": "",
          "httpVersion": "",
          "headers": [],
          "cookies": [],
          "content": {
            "size": 0,
            "mimeType": "x-unknown"
          },
          "redirectURL": "",
          "headersSize": -1,
          "bodySize": -1,
          "_transferSize": 0,
          "_error": "net::ERR_SSL_CLIENT_AUTH_CERT_NEEDED"
        },
        "serverIPAddress": "",
        "startedDateTime": "2024-08-15T18:15:44.523Z",
        "time":<PHONE_NUMBER>03987,
        "timings": {
          "blocked":<PHONE_NUMBER>03987,
          "dns": -1,
          "ssl": -1,
          "connect": -1,
          "send": 0,
          "wait": 0,
          "receive": 0,
          "_blocked_queueing": -1
        }
      }
    ]
  }
}

errors reported by extension
Error in event handler: Error: tried to detect trackers before rules were loaded at _Trackers.getTrackerData (chrome-extension://bkdgflcldnnnapblkhphbgpggdiikppg/public/js/background.js:5263:19) at blockHandleResponse (chrome-extension://bkdgflcldnnnapblkhphbgpggdiikppg/public/js/background.js:17708:31) at handleRequest (chrome-extension://bkdgflcldnnnapblkhphbgpggdiikppg/public/js/background.js:17676:30)

Error in event handler: Error: tried to detect trackers before rules were loaded at _Trackers.findTracker (chrome-extension://bkdgflcldnnnapblkhphbgpggdiikppg/public/js/background.js:5348:19) at Object.isTracker (chrome-extension://bkdgflcldnnnapblkhphbgpggdiikppg/public/js/background.js:24263:46) at dropTracking3pCookiesFromResponse2 (chrome-extension://bkdgflcldnnnapblkhphbgpggdiikppg/public/js/background.js:25234:50)

Uncaught (in promise) Error: Duplicate script ID '1-script-injection-isolated-world'

Uncaught (in promise) TypeError: Failed to fetch

if i open https://quack.duckduckgo.com/api/email/addresses in tab manually then extension starts generating new emails again

I am getting the same problem.
Also, when I go to the above addresses, I get an "invalid token" page.


Add ARCHITECTURE.md file

Awesome, thanks for compiling this! This will prove very valuable to contributors.
Would it make sense to link to the file from the ReadMe? Not sure if people would randomly stumble across it otherwise.

I guess.


Openshift - Deploying container image of Oracle SOA suite

Hi,
Am trying to deploying container image of Oracle SOA Suite, in OpenShift platform [openshift-online.com], with following steps.

Accepted the license at https://container-registry.oracle.com
Tried to deploy an image at Openshift side, but seeing an error -
Could not load image metadata.
you may not have access to the container image "docker.io/library/<IP_ADDRESS>:latest"

Am i missing any steps ?

Probably several, but very few of these images are tested with OpenShift. The URL you're getting in the error seems to indicate that you're not specifying the source of the image correctly, but I've never played with OpenShift, so I don't know how that's configured.

Initial issue is resolved,m post giving the correct URL. Now status of POD is "InvalidImageName" and not able to see any other error details.

Did you end up entering the correct image path?

Did you end up entering the correct image path?


Include first failed job name in event emitted when JobSet fails, as well as the JobSet failure condition

Fixes #466

Include first failed job name in event emitted when JobSet fails, as well as the JobSet failure condition.
Move constants into a separate constants package
Move all success policy related helper functions into a separate file

/hold
/lgtm
I have a minor nit around constants naming but otherwise this looks good to me.

/retest

All tests are passing locally but the build fails in e2e CI? odd...

Not sure why we did this but it bit us again...
https://github.com/kubernetes-sigs/jobset/blob/main/Dockerfile
Docker file is copying elements one by one in pkg.

All tests are passing locally but the build fails in e2e CI? odd...

Not sure why we did this but it bit us again...
https://github.com/kubernetes-sigs/jobset/blob/main/Dockerfile
Docker file is copying elements one by one in pkg.

Ahhhh not again... this dockerfile will be the death of me. Fixing

/hold cancel

@kannon92 I fixed the dockerfile but lgtm was removed because of this, can you take another look please?

/lgtm


LiveReload - Indefinite loop in Firefox

What version of Remix are you using?
v1.7.6
Steps to Reproduce

create-remix using defaults
Add a loader to app/routes/index.tsx that sleeps for 1 second
Open http://localhost:3000 in Firefox Developer Edition (I'm using 108.0b6 (64-bit) macOS silicon)
Make a change to the file to cause remix rebuild while the firefox window is in view (focus state doesn't seem to matter)
Page continually reloads until window is no longer in view (focus state doesn't seem to matter)

export const loader: LoaderFunction = async () => {
        await new Promise((resolve) => setTimeout(resolve,1000));
        const data = { key: "value" };
        return json(data);
}

Expected Behavior
The page should only live reload once
Actual Behavior
The page reloads in a looping manner. Normal behavior can be observed in chrome or by removing the sleeping timeout.

I have been banging my head against a wall for 24 hours about why my OAuth 2 flow doesn't work and the reason is this bug. My login flow reloads infinitely in Firefox but works as expected in Chrome.
import { useLoaderData, Form } from "@remix-run/react";
import authenticator from "../../services/auth.server";

export let loader = async ({request}) => {

  let user = await authenticator.isAuthenticated(request)
  if( user ) {
    console.log("Login says: authenticated!")
    console.log(user)
    return user
  } else {
    console.log("Login says: not authenticated")
    console.log(user)
    return false
  }

}

export default function Login() {
  let user = useLoaderData()
  if(user) {
    return (

You are logged in!!!

    )
  } else {
    return (

        <Form method="get" action="/auth/mastodon">
          <button>Login</button>
        </Form>

    )
  }
}

After further digging I think this might be a result of an existing issue with LiveReload: https://github.com/remix-run/remix/issues/2997

I don't even have to change a file, just the initial load in firefox makes it trip up.

Alright, soon as the tests pass we'll merge that PR and then the fix will be available in the nightly releases until the next official release goes out next week.
So you can either wait for the nightly tonight, wait for next week, or copy/paste this and use it instead:

copy/paste this
export const LiveReload =
  process.env.NODE_ENV !== "development"
    ? () => null
    : function LiveReload({
        port = Number(process.env.REMIX_DEV_SERVER_WS_PORT || 8002),
        nonce = undefined,
      }: {
        port?: number;
        /**
         * @deprecated this property is no longer relevant.
         */
        nonce?: string;
      }) {
        let js = String.raw;
        return (


fix(project): point to correct main file.

Hi @RWOverdijk, I've tried the patch in our app that uses aurelia-orm and aurelia-datatable and both are working fine. Also, the original issue with uglify barfing has been resolved. Thanks for making the change.


Paterva / Maltego link

Paterva / Maltego website has changed from https://www.paterva.com/ to https://www.maltego.com/.

Fixed. Thank you.


Missing Error handling in the whole react-application

Is your feature request related to a problem? Please describe.
So this feature is related to a problem, there is no proper error-handling and this is necessary for an deployed application because, if by any chance any error occurs the whole application will crash, preventing the app from becoming unresponsive or crashing we need error-handling.
Describe the solution you'd like
Centralized Error Handling: Global error boundaries allow you to centralize error handling logic in one place (e.g., at the app's entry point), making it easier to manage and maintain error-handling code.
Consistency: With a global error boundary, you can ensure a consistent error-handling strategy throughout your application. You don't have to repeat error-handling code in multiple places.
Describe alternatives you've considered
A descent alternative could be to use simple try and catch blocks, but that won't be providing us robustness that is required to be maintained in a deployed application.
Additional context
Please feel free to ask any questions and I would be happy to add this feature to enhance the robustness of the application, kindly assign me this issue.

Would you like to work on this one @AnuravModak ?

yeah, please assign this to me

Thanks @AnuravModak, amazing job!


Creation of hydra wallet arbitrary number of decimal shares

Right now it only supports shares of 100
It should allow input of any decimal length share value, and scale up the total shares by that number
i.e. if i set a shares to 33.3 it will make totalShares 1000 and share 333 or if I do 33.33 it will do 10000 and share 3333

Changing to support entering custom share amount + checks to ensure form shares sum up to total shares specified.
https://github.com/cardinal-labs/hydra-ui/pull/6


How can we go inside individual container?

How can we go inside the individual container.
$ sudo docker attach es0    (But no to avail.)

@masifpak , if you're wanting to go into a container to inspect and edit the file system, such as configuration files, then use docker exec.

Actually i installed ssh and supervisor. In supervisor.conf I added the following lines.
[supervisord]
nodaemon=true
[program:sshd]
command=/usr/sbin/sshd -D
[program:elasticsearch]
command=/bin/bash -c "/start"
In docker file I just replaced start script with    CMD ["/usr/bin/supervisord"]
But when I run this container, it just exited. How can I troubleshoot the reason of exit.

Even though using supervisord to add ssh into the container is technically valid, it is actually one of the Docker anti-patterns. Did docker exec not achieve what you needed?
As far as troubleshooting, see if docker logs reveals anything about the failure.

Good. I read Docker anti-patterns. I should not use ssh. Please help me understanding some part of Dockerfile and start script.
# ## Dockerfile
1- touch /data/.CREATED /conf/.CREATED        # Why to create ".CREATED" files.
2- VOLUME ["/data","/conf"]                                # /data and /conf is being mount on host machine so that elastic data store on host to avoid container getting large.
3- USER elasticsearch                                   # Does it mean every thing run in container with this user
4- ENV OPTS=-Dnetwork.host=non_loopback   # I could not understand purpose of this command.and why assignment sign "="
# start script****
Please give some explanation of the following script part.
5-  if [ -f /conf/env ]; then
. /conf/env                                                       # what is doing this " . /conf/env"
fi
6-  OPTS="$OPTS   -Des.path.conf=/conf
-Des.path.data=/data
-Des.path.logs=/data
-Des.transport.tcp.port=9300
-Des.http.port=9200"
I know what is happening here but how we are assigning multiple parameters in one variable.
7-  if [ -n "$CLUSTER" ]; then
OPTS="$OPTS -Des.cluster.name=$CLUSTER"
if [ -n "$CLUSTER_FROM" ]; then
if [ -d /data/$CLUSTER_FROM -a  !  -d /data/$CLUSTER ]; then
echo "Performing cluster data migration from $CLUSTER_FROM to $CLUSTER"
mv /data/$CLUSTER_FROM /data/$CLUSTER
fi
fi
fi
In this part where it is taking cluster name from and why migration in just creating ES cluster.
8- if [ -n "$PUBLISH_AS" ]; then
OPTS="$OPTS -Des.transport.publish_host=$(echo $PUBLISH_AS | awk -F: '{print $1}')"
OPTS="$OPTS -Des.transport.publish_port=$(echo $PUBLISH_AS | awk -F: '{if ($2) print $2; else print 9300}')"
fi
#What is being done in second OPTS.
9- if [ -n "$PLUGINS" ]; then
for p in $(echo $PLUGINS | awk -v RS=, '{print}')
do
echo "Installing the plugin $p"
$ES_HOME/bin/plugin install $p
done
fi
Which plugins are in PLUGIN directory.

One more thing.
when i run container without volumes mapping it run fine.
sudo docker run -h es0 --name es0 -d -p 9200:9200 -p 9300:9300 es:latest
but when i run using volumes as below it sends permission error. Any clue please?
sudo docker run  -it -h es0 --name es0  -v /opt/oescluster/es0/data:/data:rw -v /opt/oescluster/es0/conf:/conf:rw   -p 9200:9200 -p 9300:9300 es:latest
cp: cannot create regular file '/conf/elasticsearch.yml': Permission denied
cp: cannot create regular file '/conf/logging.yml': Permission denied
Starting Elasticsearch with the options -Dnetwork.host=non_loopback -Des.path.conf=/conf   -Des.path.data=/data   -Des.path.logs=/data   -Des.transport.tcp.port=9300   -Des.http.port=9200

Deep questions :) Let me see if I can remember what all I was doing there:
First some background about container UIDs. Related to this issue https://github.com/docker/docker/issues/7198, coordinating the file ownership of attached volumes gets a little strange when the container UID (elasticsearch=999 in this case) does not match an existing host UID. FYI, here's how I confirmed the container UID of elasticsearch:
> docker run --rm itzg/elasticsearch id elasticsearch
uid=999(elasticsearch) gid=999(elasticsearch) groups=999(elasticsearch)

Your follow-on observation about "Permission denied" is related to this. If you run just
id

on your host system, I'm guessing the uid does not match the container's 999.  I haven't tried this lately, but overriding USER with -u, as described here, to match what your id reports will probably resolve this.

Since I wanted the container process to run as non-ROOT, later in the Dockerfile with a USER elasticsearch, I found I had to pre-create the volume attach point and fix the directory ownership. This might have since been fixed in Docker, but creating empty directories wasn't enough. I needed to put a placeholder file in there, hence the touch

Partially correct. A container getting large is actually not a problem as long as you have a sufficiently large /var/lib/docker filesystem. On some of my systems I dedicate a separate LVM space for that mount point specifically. With 1.9+, docker volume has become an elegant way to further tune the backing store of volumes rather than attaching host directories to achieve the same. In fact, you can use alternate technologies like GlusterFS to back the volumes.

Yes. By default, container processes run as root. I'm personally not convinced that's all that bad, but there's plenty of discussion out there that claims to be very nervous about running application processes as root...even within a container (kernel control group and namespace).

That gets passed as-is to the Java invocation of the Elasticsearch service itself, hence the = within the assignment. As for non_loopback, please refer to here for background. Keep in mind that the IP address selected would still be "container local", so only containers on the same Docker network can resolve to it.

That was a little trick I introduced when I needed to override the -e settings of the original container creation, such as changing cluster membership. What I do is docker exec into the container, add the overrides to /conf/env and restart the container to pick up the environment change.

Later $OPTS gets passed as a bare string to the Java invocation. At that point, Java will interpret each -Dvar=value part as an argument each.

This is the second half of the trick I introduced at 5. In order to migrate an existing ES node from one cluster to another with all possible data retention, the cluster-named data directory (an ES convention) needs to be renamed or else the existing node joining the new cluster starts with an empty data directory. This technique might warrant a wiki page, if you're interested in me going deeper into this.

That's to be flexible and allow PUBLISH_AS to be given as just "es-host" or "es-host:9304" where the later declares a specific port. In the first, case a default transport port of 9300 is used.

PLUGIN doesn't refer to a directory, but rather a comma separate list of community ES plugins, as described here

I'm closing to close out the issue, but @masifpak , feel free to ask more questions as they come up.


feat: CodeCommit events support (#964)

Issue: #964
Description of changes:
Add new source event type CodeCommit.
This creates an EventBridge Rule to trigger a lambda function after any changes in a repository.
Description of how you validated changes:
Created a CodeCommit repository from the AWS console, and then deployed a template with a lambda function the was successfully triggered.
Checklist:

[x] Write/update tests
[ ] make pr passes
[x] Update documentation
[x] Verify transformed template deploys and application functions as expected
[x] Add/update example to examples/2016-10-31

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Codecov Report

Merging #1443 into develop will decrease coverage by 0.09%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #1443      +/-   ##
===========================================
- Coverage    94.42%   94.32%   -0.10%
===========================================
  Files           78       78
  Lines         4554     4704     +150
  Branches       912      936      +24
===========================================
+ Hits          4300     4437     +137
- Misses         119      123       +4
- Partials       135      144       +9

Impacted Files
Coverage Δ

samtranslator/model/apigateway.py
97.10% <0.00%> (-0.86%)
:arrow_down:

samtranslator/swagger/swagger.py
92.43% <0.00%> (-0.46%)
:arrow_down:

samtranslator/model/api/api_generator.py
95.04% <0.00%> (-0.10%)
:arrow_down:

...nslator/model/preferences/deployment_preference.py
100.00% <0.00%> (ø)
:arrow_up:

samtranslator/translator/translator.py
98.38% <0.00%> (+0.01%)
:arrow_up:

samtranslator/model/sam_resources.py
94.06% <0.00%> (+0.07%)
:arrow_up:

samtranslator/model/eventsources/push.py
90.43% <0.00%> (-0.10%)
:arrow_down:

samtranslator/translator/logical_id_generator.py
90.90% <0.00%> (+0.90%)
:arrow_up:

Continue to review full report at Codecov.

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


Per HttpRoute(API) cluster creation

Description:
With the current implementation a cluster is created per each of the routes. For example in the following HttpRoute, 3 clusters will be created one for each "/abc", "/def" and "/ghi".
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: HTTPRoute
metadata:
  name: httpbin
spec:
  parentRefs:
    - name: eg
  hostnames:
    - "www.example.com"
  rules:
    - backendRefs:
        - group: ""
          kind: Service
          name: httpbin
          port: 80
          weight: 1
      matches:
        - path:
            type: PathPrefix
            value: /abc
        - path:
            type: PathPrefix
            value: /def
        - path:
            type: PathPrefix
            value: /ghi

Envoy proxy uses a cluster to represent a backend service (host and port) and there's NO point of creating multiple clusters if each route of the same HttpRoute points to the same cluster. The current approach is not very scalable if Envoy proxy is used for an API gateway with several thousands APIs deployed as memory usage increases with the number of clusters created. If we can have an implementation where we can choose to create clusters per HttpRoute, then we can support a wide range of API gateway related use cases. For example the a swagger / OpenAPI 3 can be directly converted to a HttpRoute and deployed in Envoy Proxy where only 1 cluster is created per API.
I also know that Gateway API is supposed to be a super set of Ingress API and basically targeted at improving the Ingress API with additional capabilities. But IMO in order to fully utilize the features of Envoy proxy, we should consider the use cases related to API gateways too.
Any plans to support these API gateway related use cases in future ? Or is this fully focused on ingress related use cases ?

thanks for raising this issue, adding this to the 0.3.0 milestone
in case someone would like to pick this one, here's one suggestion on how to dedup clusters

naming the RouteDestination IR https://github.com/envoyproxy/gateway/blob/2fb3ca8954705dabbcfa08007b658655fcb60f46/internal/ir/xds.go#L239 or creating a wrapper struct around the list
https://github.com/envoyproxy/gateway/blob/2fb3ca8954705dabbcfa08007b658655fcb60f46/internal/ir/xds.go#L169
reusing the named RouteDestination in the Gateway API translator
https://github.com/envoyproxy/gateway/blob/2fb3ca8954705dabbcfa08007b658655fcb60f46/internal/gatewayapi/translator.go#L630
reusing the named RouteDestination in the xds Translator https://github.com/envoyproxy/gateway/blob/2fb3ca8954705dabbcfa08007b658655fcb60f46/internal/xds/translator/cluster.go#L42

I think it's important to remember that this is a first cut at Gateway API support @NomadXD, it's in no way intended to be final.
I think that deduping clusters like this is a great optimization that, as you say, will reduce memory usage substantially.

@arkodg Can you assign me this ?

@youngnick @arkodg Opened a PR to fix this. Kubernetes Gateway Spec supports backendRefs at spec.rules and spec.rules.matches.
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  name: bar-route
spec:
  parentRefs:
  - name: example-gateway
  hostnames:
  - "bar.example.com"
  rules:
  - matches:
    - headers:
      - type: Exact
        name: env
        value: canary
    backendRefs:
    - name: bar-svc-canary
      port: 8080
  - backendRefs:
    - name: bar-svc
      port: 8080

With the PR I opened (#623 ) we are looking only at the backendRefs in spec.rules and creating a single cluster with load balance endpoints. And I think the ideal case would be to create per route clusters (Resource level clusters) only if the user has specified spec.rules.matches and use backendRefs at spec.rules to create API level clusters.

@NomadXD both the cases could be solved if the backendRefs.Name is treated as a unique key within the Gateway API Translator.
related https://github.com/envoyproxy/gateway/pull/623#discussion_r1000994536
So the Gateway API Translator would

map all K8s Services to a top level Destinations map
link each Route to the above destination using a key, the key here being the backendRefs FQDN

Hi Everyone,
I am interested to know if the Envoy Gateway supports importing OpenAPI specifications. Thank you.

Hi Everyone,
I am interested to know if the Envoy Gateway supports importing OpenAPI specifications. Thank you.

hey @y0zg recommend creating a new GH issue to discuss your issue, since its unrelated to this one


Email alerts sent once not multiple times

How can I have the email alerts with no change in "warning" status sent only once?
Or at least make the interval longer?
Seems it's set at 2 hours before it repeats the email.
Ty.

You can set a NOTIFICATION_INTERVAL environment variable - the default is 120 (interval in minutes, i.e. 2 hours)


pjlink power state feedback

Is it possible to add a feedback that would change the background color depending on the power state of the projector?

According to the specification, there is a "Power status query POWR ?"

This would be useful to have. Wouldn't be that hard to implement I would have thought

This would be useful to have. Wouldn't be that hard to implement I would have thought

I highly recommend this request! at least power and shutter-status is needed.


chore: Upgrade gitalk version;

chore: Upgrade gitalk version;

I have checked in my own project. No error.

thank you very much for your contribution to the development of the project


Fix Start over button

Details
We seem to no longer be saving accounts in setup in the bankAccountList Onyx key, so this call is unnecessary. Additionally, we should navigate the user to the beginning of the VBA flow.
Fixed Issues
$ https://github.com/Expensify/App/issues/8497
Tests

Log into the app.
Go to any Workspace and select Connect bank account > Connect online with Plaid.
Use Wells Fargo Bank account.
username: user_good, password: pass_good.
Select Savings account.
Fill out all random information on Company information page.
Click Save and Continue.
Close the modal.
Go back to Workspace > Connect bank account.
Click Start over button and confirm.
Verify that you are brought back to the beginning of the flow.
Verify that no errors appear in the console.

[x] Verify that no errors appear in the JS console

PR Review Checklist

Contributor (PR Author) Checklist

[x] I linked the correct issue in the ### Fixed Issues section above
[x] I wrote clear testing steps that cover the changes made in this PR

[x] I added steps for local testing in the Tests section
[x] I added steps for Staging and/or Production testing in the QA steps section
[x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)

[x] I included screenshots or videos for tests on all platforms
[x] I ran the tests on all platforms & verified they passed on:

[x] iOS / native
[x] Android / native
[x] iOS / Safari
[x] Android / Chrome
[x] MacOS / Chrome
[x] MacOS / Desktop

[x] I verified there are no console errors (if there’s a console error not related to the PR, report it or open an issue for it to be fixed)
[x] I followed proper code patterns (see Reviewing the code)

[ ] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
[x] I verified that comments were added to code that is not self explanatory
[x] I verified that any new or modified comments were clear, correct English, and explained “why” the code was doing something instead of only explaining “what” the code was doing.
[ ] I verified any copy / text shown in the product was added in all src/languages/* files
[ ] I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team on the original GH to get the correct copy.
[ ] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named “index.js”. All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

[ ] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[x] I followed the guidelines as stated in the Review Guidelines
[x] I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
[x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[ ] If a new component is created I verified that:

[ ] A similar component doesn't exist in the codebase
[ ] All props are defined accurately and each prop has a /** comment above it */
[ ] Any functional components have the displayName property
[ ] The file is named correctly
[ ] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[ ] The only data being stored in the state is data necessary for rendering and nothing else
[ ] For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
[ ] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
[ ] All JSX used for rendering exists in the render method
[ ] The component has the minimum amount of code necessary for its purpose and it is

[ ] If a new CSS style is added I verified that:

[ ] A similar style doesn’t already exist
[ ] The style can’t be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)

[ ] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[ ] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.

PR Reviewer Checklist

[ ] I verified the correct issue is linked in the ### Fixed Issues section above
[ ] I verified testing steps are clear and they cover the changes made in this PR

[ ] I verified the steps for local testing are in the Tests section
[ ] I verified the steps for Staging and/or Production testing are in the QA steps section
[ ] I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[ ] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)

[ ] I checked that screenshots or videos are included for tests on all platforms
[ ] I verified tests pass on all platforms & I tested again on:

[ ] iOS / native
[ ] Android / native
[ ] iOS / Safari
[ ] Android / Chrome
[ ] MacOS / Chrome
[ ] MacOS / Desktop

[ ] I verified there are no console errors (if there’s a console error not related to the PR, report it or open an issue for it to be fixed)
[ ] I verified proper code patterns were followed (see Reviewing the code)

[ ] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
[ ] I verified that comments were added to code that is not self explanatory
[ ] I verified that any new or modified comments were clear, correct English, and explained “why” the code was doing something instead of only explaining “what” the code was doing.
[ ] I verified any copy / text shown in the product was added in all src/languages/* files
[ ] I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team on the original GH to get the correct copy.
[ ] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named “index.js”. All platform-specific files are named for the platform the code supports as outlined in the README.
[ ] I verified the JSDocs style guidelines (in STYLE.md) were followed

[ ] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[ ] I verified that this PR follows the guidelines as stated in the Review Guidelines
[ ] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[ ] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[ ] If a new component is created I verified that:

[ ] A similar component doesn't exist in the codebase
[ ] All props are defined accurately and each prop has a /** comment above it */
[ ] Any functional components have the displayName property
[ ] The file is named correctly
[ ] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[ ] The only data being stored in the state is data necessary for rendering and nothing else
[ ] For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
[ ] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
[ ] All JSX used for rendering exists in the render method
[ ] The component has the minimum amount of code necessary for its purpose and it is broken down into smaller components in order to separate concerns and functions

[ ] If a new CSS style is added I verified that:

[ ] A similar style doesn’t already exist
[ ] The style can’t be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)

[ ] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[ ] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.

QA Steps
Same as the steps in the Tests section.

[ ] Verify that no errors appear in the JS console

Screenshots
Web
https://user-images.githubusercontent.com/22219519/165627801-6d8aa820-5b68-4853-908d-6c72d0ed9ef5.mov
Mobile Web
https://user-images.githubusercontent.com/22219519/165627767-a325d867-b6e1-4f70-a349-882f43f49d06.mov
Desktop
https://user-images.githubusercontent.com/22219519/165627702-7c3ff108-6933-4422-96b2-11fd92523103.mov
iOS
https://user-images.githubusercontent.com/22219519/165627664-6d764ca6-c2bb-46ff-982e-38afc6d47070.mov
Android
https://user-images.githubusercontent.com/22219519/165627644-4c148bd9-5021-4699-b6cb-ad20322d2709.mov

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

🚀 Cherry-picked to staging by @sketchydroide in version: 1.1.57-8 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

🚀 Deployed to production by @chiragsalian in version: 1.1.57-17 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅


[Run][Program] NullReferenceException UpdateUWPIconPath

Microsoft PowerToys version
Version: <IP_ADDRESS>
Installation method
GitHub
Running as admin
Yes
Area(s) with issue?
General
Steps to reproduce
Version: <IP_ADDRESS>
OS Version: Microsoft Windows NT 10.0.19045.0
IntPtr Length: 8
x64: True
Date: 2024/4/8 19:29:24
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Plugin.Program.Main.UpdateUWPIconPath(Theme theme)
at Microsoft.Plugin.Program.Main.OnThemeChanged(Theme currentTheme, Theme newTheme)
at Wox.PublicAPIInstance.OnThemeChanged(Theme oldTheme, Theme newTheme)
at PowerLauncher.Helper.ThemeManager.SetTheme(Boolean fromSettings)
at PowerLauncher.Helper.ThemeManager.ApplicationThemeManager_Changed(ApplicationTheme currentApplicationTheme, Color systemAccent)
at Wpf.Ui.Appearance.ApplicationThemeManager.Apply(ApplicationTheme applicationTheme, WindowBackdropType backgroundEffect, Boolean updateAccent, Boolean forceBackground)
at Wpf.Ui.Appearance.ApplicationThemeManager.ApplySystemTheme(Boolean updateAccent)
at Wpf.Ui.Appearance.SystemThemeWatcher.UpdateObservedWindow(IntPtr hWnd)
at Wpf.Ui.Appearance.SystemThemeWatcher.WndProc(IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
✔ Expected Behavior
No response
❌ Actual Behavior
No response
Other Software
No response

Did it only happen once or are you able to reproduce it?
If you start PowerToys Run are you able to search for Windows Store apps?
/needinfo

Only once  now it’s okay  do you speak Chinese?
发自我的 iPhone

在 2024年4月9日，23:17，Davide Giacometti @.***> 写道：
Did it only happen once or are you able to reproduce it?
If you start PowerToys Run are you able to search for Windows Store apps?
/needinfo

I don't speek Chinese.
The code that crashed is executed when Windows theme (light/dark/high contrast) is changed.
Can you try to change the theme with PowerToys Run running in background and check if you are able to reproduce the crash?
/needinfo

My computer  Everyday auto Change (light/dark/high contrast)mode .just once like this. but today I update the App. 发自我的 iPhone在 2024年4月10日，00:04，Davide Giacometti @.***> 写道：
I don't speek Chinese.
The code that crashed is executed when Windows theme (light/dark/high contrast) is changed.
Can you try to change the theme with PowerToys Run running in background and check if you are able to reproduce the crash?
/needinfo
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

This was released wit v0.82.0.


Does this project can be trained with torch.nn.DataParallel ?

I want to train Speech-Transformer with multi GPU, so i change some code of the train.py, like
model = model.cuda(device=devices[0])
model = nn.DataParallel(model, device_ids=devices)
and also change the variabls like
padded_input = padded_input.cuda(device=devices[0])
padded_target = padded_target.cuda(device=devices[0])
input_lengths = input_lengths.cuda(device=devices[0])
the devices is GPU list, like device=[0,1] defined in config.py
after these changes , i run the train.py got the following errors:
RuntimeError: Gather got an input of invalid size: got [16, 16, 4335], but expected [16, 25, 4335] (gather at /pytorch/torch/csrc/cuda/comm.cpp:226)
This project can be trained in one GPU, can't this project be trained in multi GPU ?

hello，Have you encountered this problem
Traceback (most recent call last):
File "G:/github/Speech-Transformer-master/Speech-Transformer-master/train.py", line 170, in
main()
File "G:/github/Speech-Transformer-master/Speech-Transformer-master/train.py", line 166, in main
train_net(args)
File "G:/github/Speech-Transformer-master/Speech-Transformer-master/train.py", line 73, in train_net
logger=logger)
File "G:/github/Speech-Transformer-master/Speech-Transformer-master/train.py", line 115, in train
pred, gold = model(padded_input, input_lengths, padded_target)
File "F:\python\lib\site-packages\torch\nn\modules\module.py", line 541, in call
result = self.forward(*input, **kwargs)
File "G:\github\Speech-Transformer-master\Speech-Transformer-master\transformer\transformer.py", line 35, in forward
input_lengths)
File "F:\python\lib\site-packages\torch\nn\modules\module.py", line 541, in call
result = self.forward(*input, **kwargs)
File "G:\github\Speech-Transformer-master\Speech-Transformer-master\transformer\decoder.py", line 106, in forward
dec_output = self.dropout(self.tgt_word_emb(ys_in_pad) * self.x_logit_scale +
File "F:\python\lib\site-packages\torch\nn\modules\module.py", line 541, in call
result = self.forward(*input, **kwargs)
File "F:\python\lib\site-packages\torch\nn\modules\sparse.py", line 114, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "F:\python\lib\site-packages\torch\nn\functional.py", line 1484, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected tensor for argument #1 'indices' to have scalar type Long; but got torch.cuda.IntTensor instead (while checking arguments for embedding)
thanks again

No, you cannot.

i modify the code mostly the pad_list function in  transformer/utils to achieve that, but the gpu usage is not very high, it seems that should change the dataloader which is on the fly to extract feature, making the cpu op become the bottleneck.


Sdpa api

Summary
This gunna take a second

Failing with
msg = "torch.* op returned non-Tensor _SDPAParams call_function <class 'torch._C._SDPAParams'>"

    def unimplemented(msg: str):
        assert msg != os.environ.get("BREAK", False)
>       raise Unsupported(msg)
E       torch._dynamo.exc.Unsupported: torch.* op returned non-Tensor _SDPAParams call_function <class 'torch._C._SDPAParams'>
E
E       from user code:
E          File "/home/drisspg/meta/transformer_nuggets/transformer_nuggets/sdpa/sdpa.py", line 36, in sdpa_prototype
E           return attn_mask.dispatch(query, key, value, attn_mask, causal, scale, dropout_p)
E         File "/home/drisspg/meta/transformer_nuggets/transformer_nuggets/sdpa/attn_bias.py", line 172, in dispatch
E           sdpa_params = SDPAParams(query, key, value, None, dropout_p, causal)
E
E       Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
E
E
E       You can suppress this exception and fall back to eager by setting:
E           import torch._dynamo
E           torch._dynamo.config.suppress_errors = True

../pytorch/torch/_dynamo/exc.py:184: Unsupported


[TestNet] Error 500 after going to transaction page

Environment:
Win 10 Home (64 bit) Version 1709 Build 16299.371
Browser:
Chrome 66.0.3359.139 (64 bit)
Description:
In most cases I'm getting internal server error after going to transaction pages. While going through "Last 5 Transactions" section and opening each transaction it seems that some of them works and some don't. I've found three different states of transaction pages:

Internal server error
Working properly
Empty transaction (?)

Examples:

Internal server error:
https://neoscan-testnet.io/transaction/2af70f710396c3bd487031b2ca6987cf74ecfa6aa3b135c4035bbfa7984952f7
https://neoscan-testnet.io/transaction/a789f1eda99929b291923f19c606ee775b03170b007a85b22e15909e99fd0b0b
https://neoscan-testnet.io/transaction/72d5fb61f24a92351fc778d291a6aaf2a1d1e7decd3ab0d91eff939136661407
Working properly:
https://neoscan-testnet.io/transaction/3c96442c8ced50c4d8f2dc4216cf47d41f77ca1d65c17853bbdb4eea635c51fb
https://neoscan-testnet.io/transaction/54e3028e69a6d31423158fa56cdf202107fd33831c34e0085cd7a0701bc16c8b
Empty transactions (?):
https://neoscan-testnet.io/transaction/3a466f42dabaf9d65bf93d7bb71794a2056b881075cbd947bb6eec604b25e541
https://neoscan-testnet.io/transaction/3a466f42dabaf9d65bf93d7bb71794a2056b881075cbd947bb6eec604b25e541

Fixed.


[Solved]citations can not be rendered

I have installed hexo-renderer-pandoc, and followed the tutorial in Readme.md.

Problem
However, the citation can't show as excepted. ( Cf. §Conclusion on page http://bitwan.science/2015/10/21/ch2-1-9-Changing-the-case-geometry/ )
I read a lot of your Chinese Blog, and knew that hexo-renderer-pandoc may not work well with hexo 3.0. However, I am just using Hexo 3.1.1.
My Configuration

My working environment is as bellow:

hexo 3.1.1
pandoc <IP_ADDRESS>
pandoc-citeproc 0.7.2

The configuration involving hexo-renderer-pandoc is :

pandoc:
  filters:
    - pandoc-citeproc
  extra:
    - bibliography: "/path/to/bibfile.bib"

Hexo theme is Next ( https://github.com/iissnan/hexo-theme-next )

General pandoc syntax can be render, but the citation using pandoc-citeproc still couldn't resolve.

Problem solved.
Solution
I pull the lastest hexo-renderer-pandoc from github.
Cause of Problem
The plugin installed by npm install hexo-renderer-pandoc --save  is too old.

Hi @nirvana6 ,
Thanks for report that. I will update the npm package later.


avivg/blockifier/use_api_WORD_WIDTH_and_remove_blockifier_WORD_WIDTH

This change is

#1966  👈
main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @avivg-starkware and the rest of your teammates on  Graphite


feat: add anticheat service

Describe your changes
This PR adds bancho.py's optional modular anticheat (or BOMA in short). It is written in C# with dotnet 7 and the PR already includes readme instructions on how to set everything up and added a script for installing dotnet on Ubuntu 18, 20 and 22 since it requires adding Microsoft's package feed.
Bancho.py publishes a json object containing all useful score data (including the beatmap and player) to an AMQP service on score submission, to be specific right after the score has been added to the database and before any modifications to the player stats are done in order to publish informations as if they were before the score got submitted.
We use RabbitMQ for that. As per readme instructions, you download docker.io and create a docker container for rabbitmq which can then be started and stopped.
As cmyui suggested, the implemention of publishing the score upon submission can be made a bit broader to also include non-anticheat consumers on the query.  The connection details (host and port) for RabbitMQ are configured in the .env file. There is also an option to enable the RabbitMQ publishing because not every server might use it. By default it is disabled.
In bancho.py, the pip package aiopika is used to communicate with RabbitMQ. The service is initialized and shut down the same way bancho.py handles redis and mysql. I added app/usecases/rabbitmq.py which handles publishing the data.
There also is a function for serializing the score object to json which might look bloated at first but after trying various ways to serialize the data I found that this is the best way to have control over what's being published.
The anticheat is kept pretty simple. For logging, I chose to follow bancho.py's output and color scheme. The application loads the config.json on startup which contains the RabbitMQ information, as well as more anticheat-related settings.
Then it initializes a ScoreQueue object, a wrapper around .NET's queue that subscribes to the queue and populates the underlying queue object with incoming score objects that are being deserialized using Newtonsoft.Json and the models found in src/Models.
After that is done, all checks stored in src/Checks are loaded using reflection.
All checks implement the abstract Check class as an interface for the checks. The anticheat processor passes the consumed score as a parameter to the PerformCheck method. From there, checks can be done to to validate the score.
The abstract class provides helper methods/properties for returning the CheckResult object. For example, you can request a restriction via return Restrict("reason") or tell the anticheat to take no action using return NoAction.
public override CheckResult PerformCheck(Score score)
{
    if (score.Mode == GameMode.VN_STD && score.PP >= 1500)
        return Restrict("Exceeded the PP limit of 1500pp");

    return NoAction;
    }

This checks whether the user did a PP play of more than or equal to 1500pp on the vanilla standard gamemode and if so, restricts the user with the provided reason.
After these checks are instantiated, the AnticheatProcessor is being initialized that contains the anticheat's lifetime cycle. It dequeues the score object, does a non-performant heavy check on whether the score is eligible for running through the checks that might be performance-intensive (e.g. user is whitelisted or restricted) after which the real checks are performed.
The checks themselves return a CheckResult object which contains the type of action the anticheat should react with (currently only None or Restrict are implemented), as well as additional properties for them, like the restriction message. If a restriction is requested, further checks are not being done to save resources.
The anticheat can be started by going into the anticheat folder and running ./run.sh. The script makes sure dotnet run is executed with the correct arguments. ./run.sh runs the anticheat in the debug configuration (which is different from the debug in the config.json file which only enables debug logging).
I plan on adding more functionality to the anticheat soon (e.g. parsing the replay data into frames that can be processed or adding caches for players so the anticheat can remember certain flags or other kinds of information about the player). But for no, I want to keep the anticheat's state on the initial PR as simple as possible.
Checklist

[X] The changes pass pre-commit checks (make lint)
[X] The changes follow coding style

pre-commit.ci autofix


 The empty value should be instead cached or default value of memory used.

cc: @pakrym, @davidfowl

Fixed in #1245


Redux Selector that contains the user agents for the chosen release.

Given an the useragent feathers endpoint
When the selectUserAgent selector is applied
Then the result will include all user agents from the current release.

This is implemented in #130.


Build out alternative authentication for SDKs

The Java and C# SDKs use the auth format as described here:
https://github.com/Azure/azure-sdk-for-java/blob/master/AUTH.md
We should generate this file when users login to enable single-sign-on across SDKs.

I am fine with generating this file, 2 things to clarify

I assume this is for service principal only?
A service principal can have more than one subscription, we need a clearly definition for what is the 'default' subscription; otherwsie this filed should be an array
If we also support user account, then "tenant" can also be a list, we need mechanism to choose which is the default. Again, this field should be an array.

@JasonRShaver : Why cant the existing information that is there in the current accesstokens file? Using that would enable them to work when there is no Py CLI in picture but Xplat is there.

Add an --export-auth param to the az account show command.
If the user is logged in as a user instead of a service principal, it outputs an error Auth files can only be generated for service principal identities.  Use 'az ad sp create-for-rbac' to generate a new service principal
az account show -h

Command
    az account show: Show the specified subscription.  If no subscription is provided, the default subscription is shown

Arguments
    --subscription      : Show the specified, by name or id, subscription
    --export-auth      : Export an auth file to the provided path for use with the Java and .NET Azure SDKs.  Default: my.azureauth

Global Arguments
    --debug    : Increase logging verbosity to show all debug logs.
    --help -h  : Show this help message and exit.
    --output -o: Output format.  Allowed values: json, jsonc, list, table, tsv.  Default: json.
    --query    : JMESPath query string. See http://jmespath.org/ for more information and examples.
    --verbose  : Increase logging verbosity. Use --debug for full debug logs.


Make error

I think I followed the instructions correctly but got...
make -C ../../minichlink all
make[1]: Entering directory '/home/Mike/Risk5/ch32v003fun/minichlink'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/Mike/Risk5/ch32v003fun/minichlink'
../../minichlink/minichlink -w blink.bin flash -b
Found WCH Link
WCH Programmer is CH549 version 2.7
link error, nothing connected to linker
Could not setup interface.
make: *** [../../ch32v003fun/ch32v003fun.mk:53: cv_flash] Error 223
Mike@mx:~/Risk5/ch32v003fun/examples/blink

Issue solved... I had two programmers plugged in ... oops sorry...

Out of curiuosity, what is your target cpu? Can you paste the output from when it was working?

$ make
riscv64-unknown-elf-gcc -o blink.elf ../../ch32v003fun/ch32v003fun.c blink.c -g -Os -flto -ffunction-sections -static-libgcc -march=rv32ec -mabi=ilp32e -I/usr/include/newlib -I../../ch32v003fun -nostdlib -I. -Wall -T ../../ch32v003fun/ch32v003fun.ld -Wl,--gc-sections -L../../ch32v003fun/../misc -lgcc
riscv64-unknown-elf-size blink.elf
   text	   data	    bss	    dec	    hex	filename
    660	      0	      8	    668	    29c	blink.elf
riscv64-unknown-elf-objdump -S blink.elf > blink.lst
riscv64-unknown-elf-objdump -t blink.elf > blink.map
riscv64-unknown-elf-objcopy -O binary blink.elf blink.bin
riscv64-unknown-elf-objcopy -O ihex blink.elf blink.hex
make -C ../../minichlink all
make[1]: Entering directory '/home/Mike/Risk5/ch32v003fun/minichlink'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/Mike/Risk5/ch32v003fun/minichlink'
../../minichlink/minichlink -w blink.bin flash -b
Found WCH Link
WCH Programmer is CH32V307 version 2.8
Part Type (A): 0x0010 (This is the capacity code, in KB)
Part UUID    : 60-7e-ab-cd-c8-93-bc-48
PFlags       : ff-ff-ff-ff
Part Type (B): 00-30-05-00
Interface Setup
Image written.
Mike@mx:~/Risk5/ch32v003fun/examples/blink

The little dev board is marked "QSZNTEC" for the CH32V004 - F4P6
Running MX-Linux...
Mike

all good?  If so close?

Not an issue, only occurred because I had two devices connected and tried to upload to wrong one...


Stop at last frame after completing animation

@mifi
I want animation to stop at the last frame once animation completes, I am try this
last_frame = PlayerRef.current.state.instance.totalFrames
PlayerRef.current.goTo(last_frame)
Doesn't seem to work, is there any alternative to this.

For this use case i think it’s better to instead use lottie-web directly.
Or you might be able to achieve by setting loop=false

Thank you for the reply loop={false} could not do the trick, will try lottie-web directly now.


allow optional arguments even if not used

when providing a callback many people can just, rather than use an arrow function () => this.whatever(), they can provide the whole function as a callback and that may trigger TS errors since that callback can host arguments.
With this change we allow any kind of callback which IMO is more correct

This should already work right out of the box via casting:
function foo (callback: () => void) {}
function bar(arg1: string, arg2: number) {}

// Simply cast the function reference as `any`
foo(bar as any);

Example on TypeScript Playground
Changing the type of the callback of both forceUpdate and setState is incorrect in my opinion, because we don't call it anywhere with arguments.

I'm ambivalent here. I guess if I had a concern, it'd be that there are probably a lot of these same cases in the definitions we'd have to update.

I agree that this can be avoided but IMO ts definitions shouldn't be restrictive as you're force to explicitly specify your edge cases with as any and since any it self is kinda wildcard.
ig types should only specify that arguments may actually exist but preact doesn't give any info about.
What do you think?

Would it be easier to define a type UserCallback that we use everywhere a generic callback function is allowed, and then we could allow arbitrary arguments to UserCallback?

-1 I'm against including such a change, because it would open a can of worms and will hide errors. Example:
// `arg1` is non-optional, and the function won't work when
// it isn't supplied. TS makes sure that this is the case.
function foo(arg1: string) {
   // do something with arg1, eg throws when arg1 is not present
}

// Although foo will definitely throw, this error could not be caught anymore by TS.
forceUpdate(foo);

@marvinhagemeister I don't understand your message :\
(...args) makes arguments optional because isn't up to preact interact with'em

Changing the type of the callback of both forceUpdate and setState is incorrect in my opinion, because we don't call it anywhere with arguments.

ofc we never call callbacks with arguments, but user could provide anyother callback that has arguments defined for whatever reason. Imo we should provide restrictive definitions if needed.

in your comments here: https://github.com/developit/preact/pull/1073#issuecomment-385001656
in such a case user should be aware of his own code and that parameter must be optional. Basically he wants some function to be called when render_callbacks came to an end and he doesn't need to wrap its finisher with another function which doesn't receive parameters bcoz we (preact) told TS to complain if any user do such a thing, which IMO is quite common (code reusing) :\

@k1r0s If the user knowingly supplies a callback that expects arguments, than that would be a bug. It is definitely up to us as to how the function signature should look like, because we are the one who will call it after all.
// changed signature as suggested in this PR
function forceUpdate(cb: (...args: any[]) => void) {
  cb();
}

function foo(arg1: string) {
  if (arg1 === undefined) {
    throw new Error("Should never happen");
  }
}

// Will throw, although types would say that this is valid
forceUdpate(foo);

@marvinhagemeister, thanks to be here. I think u're completely right. And I was wrong. If some developers are used to provide own defined callbacks, then they should use optional parameters to explicitly specify that behavior.
correct code on typescript playground


.NET 6: Host ASP.NET Core in a Windows Service

This page is outdated and not correct with aspnet 6

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

ID: b0bd8cb8-7e28-8c4d-a550-3aea8f3ab4dd
Version Independent ID: 4b60d24e-ef05-15e5-10b4-483094081bf3
Content: Host ASP.NET Core in a Windows Service
Content Source: aspnetcore/host-and-deploy/windows-service.md
Product: aspnet-core
Technology: aspnetcore-hostdeploy
GitHub Login: @Rick-Anderson
Microsoft Alias: riande

It would be very useful to get this documentation updated.
I've tried to put together a way to host blazor server in worker designed to run as a windows service in order to have a service host it's own small web interface but I've been unable to get anything that works.

I'm working this one as a crossover issue for Blazor, too. I'll investigate a few reported errors as I work through the updates. Updates include removing the 2.x pieces and adding bits for 5.x and 6.x. I'll deal with PS script updates. Note that the PS updates move all guidance to working PS 7 commands. We don't document old tooling.

Sorry folks! Change of plans. One of the docs team members will take care of the general updates first (3/4 open issues), then I'll come in later and address the Blazor-specific issue later.

Note to the doc author working this issue. There's a community-supplied sample on ...
Minimal API windows service sample
https://github.com/dotnet/AspNetCore.Docs/pull/25037
... that is here but isn't added to the text of the topic. I felt it could be merged and then tied in here when this issue is worked.


Face Deblurring

add in awesome face operations folder

Can I work on this issue under GSSoC'21? Kindly assign it to me.

assigning


Update README.md with the latest release info

Hi!
Please update the README.md file to mention the latest released version of the library.
On the Maven central, the latest release is 1.2, but the README.md file mentions version 1.0.3 in the Maven dependency description.
Also, please mention that version 1.2 requires Java 9 or later.
And thanks for the cool project!
Eli

Thanks for the feedback! The README.md has been corrected.