text:
Unable to use MorphTo relationship

I'm trying create JSON APIs for a model which has a polymorphic morphTo relationship. I created the relationship following the documentation (in particular the section on morphTo present in this page), but I'm unable to use it correctly. I'll give you further details below.
My (simplified) structure is the following:
users
id
name
businesses
id
name
addresses
addressable_type
addressable_id
street_number
A user and a business can have multiple addresses, while a single address is associated either to a user or a business. This is summarized by a morphTo polymorphic relationship called addressable and leads to:
Addressable.php
class Address extends Model
{
  // Other code

  /**
     * An address morphs to an addressable
     *
     * @return \Illuminate\Database\Eloquent\Relations\MorphTo
     */
    public function addressable()
    {
        return $this->morphTo('addressable');
    }
}

Business.php
class Business extends Model
{
  // Other code

  /**
     * A business may morph to many addresses
     *
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
     */
    public function addresses()
    {
        return $this->morphMany(Address::class, 'addressable');
    }
}

Same for user
At this point I map the relationship onto the resources' schemas:
BusinessSchema.php
class BusinessSchema extends Schema
{
  // ....

  HasMany::make('addresses'),

  // ....
}

Same for user
AddressSchema.php
class AddressSchema extends Schema
{
  // ....

  MorphTo::make('addressable')->types('users', 'businesses'),

  // ....
}

Every other detail needed to map this relationship (for example in AddressRequest.php, or while defining the routes for addresses, businesses and users) is then filled in correctly. This is reasonably proved by the fact that every other relationship but this (polymorphic) one works fine.
Testing the newly implemented API I can create an address, I can modify and then delete it: everything seems to work perfectly.
Nonetheless, while trying to get the related business or user for an address, i.e. GET 127.0.0.1:8000/v1/addresses/1/addressable, I get the following error:
No schema for JSON:API resource type addressables
I can't figure out what the problem might be.

@niccolovettorello1997 Have you registered your schema in Server.php ?

Thanks for raising this issue. Reading it, I feel like I've missed something from the documentation, but it has been a while since I used a morph-to relationship.
Can you provided a stack trace for where the No schema for JSON:API resource type addressables error is originating from? It'll help me work out what's going on and potentially whether I've missed something from the documentation.

Hi @lindyhopchris, do you have any news regarding this problem?
Thanks a lot

Sorry, just not had the time.
I believe you need to follow what is explained here when discussing polymorphic to-many relationships, i.e. it's the same issue with polymorphic to-one relations:
https://laraveljsonapi.io/docs/2.0/digging-deeper/polymorphic-to-many.html#query-parameters

Hello!
I tried to follow the polymorphic-to-many chapter and adapt it to polymorphic-to-one relations, however I keep on having the same issues reported by OP.
Particularly, I have a morphTo relation between model A and models B and C. I will call this relation X.
What I did:

I wrote both XQuery and XCollectionQuery.

In ASchema, I included in method fields():
MorphTo::make('X')->types('B','C')

In api.php I included:
 $server->resource(A, JsonApiController::class)->relationships(function ($relations) {$relations->hasOne('X');)};

In Server.php, I included in method serving():
LaravelJsonApi::registerCollectionQuery(XQuery::class, 'X');
LaravelJsonApi::registerCollectionQuery(XCollectionQuery::class, 'Xs');

Xs stands for the plural of X.

Yet, when I try a GET over api/v1/As/1/X, I still get the answer
LogicException: No schema for JSON:API resource type X.
I do get proper results for a GET over api/v1/As?include=X.
Any suggestion will be appreciated.
Thanks!

Hello,
I happen to be facing the exact same issue.
Did you find a solution to using morphTo() relationship?
I am getting the exact same error, telling me there is No Schema for relationship name.
Find attached my stack trace for the error generation:

authors: atapatel codocedo lindyhopchris niccolovettorello1997 thedanmwangi


text:
Error: [BABEL] unknown: Preset /* your preset */ requires a filename to be set when babel is called directly,

Laravel Mix Version: @6.0.42 (npm list --depth=0)
Node Version (node -v): v17.4.0
NPM Version (npm -v): 8.3.1
OS: macOS

Description:
getting the following error when running Babel (+react+ typescript):
 Error: [BABEL] unknown: Preset /* your preset */ requires a filename to be set when babel is called directly,

babel.transform(code, { filename: 'file.ts', presets: [/* your preset */] });
See https://babeljs.io/docs/en/options#filename for more information.
    at validateIfOptionNeedsFilename (/Users/xxx/mobilityshop-api/node_modules/@babel/core/lib/config/full.js:331:11)
    at /Users/xxx/mobilityshop-api/node_modules/@babel/core/lib/config/full.js:343:52
    at Array.forEach (<anonymous>)
....

I cant seem to fix it, I googled all the options but none worked.
Steps To Reproduce:
webpack.mix.js
let mix = require('laravel-mix');

mix.babel(`./resources/ts/bundles/user.tsx`,`public/user.js`).setPublicPath('public');

babel.config.js:
module.exports = {
    presets: [
        ["@babel/preset-env",
            {
                "useBuiltIns": "usage",
                "corejs": 3
            }],
        "@babel/preset-typescript",
        ["@babel/preset-react", {
            "runtime": "automatic"
        }],
    ],
    "plugins": [
        "@babel/proposal-class-properties",
        "@babel/proposal-object-rest-spread"
    ],
};

using mix.ts() works but it would bring our build time to 2 minutes so we'd rather avoid that.

adding webpack config explicitly doesnt seem to fix anything:
mix.webpackConfig({
    devServer: {
        port: '8101',
        host: "0.0.0.0",
        allowedHosts: 'all',
        headers: {
            "Access-Control-Allow-Origin": "*",
        },
    },
    resolve: {
        symlinks: false,
    },
    output: {
        path: path.resolve(__dirname, "public"),
        filename: "[name].js",
    }
})

I have the same problem. Still no solution?

source: gharchive/issue

authors: joelharkes xDemonRU

repo: laravel-mix/laravel-mix

license: MIT

license_type: permissive

license_source: github-api


text:
artisan cache:clear wipes all of Redis

Using Redis for both cache and session, when one calls cache:clear, it flushes the whole store:
$this->cache->store($storeName)->flush();
Indeed, in Cache\RedisStore, flush() clears the whole connection's contents:
$this->connection()->flushdb();
Could either the session or cache (or both) Redis keys be prefixed with what they are such that clearing one doesn't clear both?

This is intended.

You need to use a separate redis database if you want to avoid this.

By default redis gives you 16 databases, 0->15, and laravel uses db 0 by default.

The same problem occurs with memcached - it flushes the whole server and not just the entries for the executing application.
It's dangerous if there are multiple applications that uses the same memcached server for session - if one application runs cache:clear all users in all applications will get logedout.

example:
public function clear()
{
    $keys = $this->memcached->getAllKeys();
    foreach ($keys as $key) {
        if (Str::startsWith($key, $this->prefix)) {
            $this->memcached->delete($key);
        }
    }
}

@Gummibeer It's not a "problem". It's the correct behaviour. If you don't want that, you MUST setup a different database for cache and sessions.

By default, redis gives you 16 separate databases, but laravel out of the box will try to use database 0 for both sessions and cache.

It's, like I said, not just a redis thing. It's the same on memcached and I think on all others also. It couldn't be the goal to have a single memcached server for every application!?
We solved it yet by creating a custom cache driver and rewrite the flush method - but on production environments it's rly dangerous to flush the whole memcached, redis or what ever you choose as the cache driver.

It couldn't be the goal to have a single memcached server for every application!?

You absolutely can do that, BUT you must setup a physically separate database for each application.

but on production environments it's rly dangerous to flush the whole memcached, redis

No it's not. If you're reusing the database in other apps, then frankly, you've messed up. That would be like using the same database for all your apps and hoping the tables don't end up with the same name.

Solution: https://phphub.org/topics/2466

For anyone else visiting, I like to set up a minimum of 3 different databases: 0 is the default for things I like to cache manually (like foreign exchange rates every 10 minutes). 1 is for the application cache. 2 is for login sessions.
In config/database.php:
'default' => [
            'host' => env('REDIS_HOST', localhost),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_DB', 0),
        ],

        'cache' => [
            'host' => env('REDIS_HOST', localhost),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_CACHE_DB', 1),
        ],

        'session' => [
            'host' => env('REDIS_HOST', localhost),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_SESSION_DB', 2),
        ],

@willsmanley I usually add one for the queue and one for the horizon snapshots.

For anyone else visiting, I like to set up a minimum of 3 different databases: 0 is the default for things I like to cache manually (like foreign exchange rates every 10 minutes). 1 is for the application cache. 2 is for login sessions.
In config/database.php:
         'default' => [
            'host' => env('REDIS_HOST', localhost),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_DB', 0),
        ],

        'cache' => [
            'host' => env('REDIS_HOST', localhost),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_CACHE_DB', 1),
        ],

        'session' => [
            'host' => env('REDIS_HOST', localhost),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_SESSION_DB', 2),
        ],

Hi, i have a new questions, now i want to kick off all user by master, how can i do for clear redis db 2 (like your examples, session => redis db 2)

This might be helpful to others.
I used the config suggested by Scyllaly, but was still flushing the session when running php aritsan cache:clear
The issue for me was that I had left 'connection => 'cache' in the config above the list of connections. Thus, I ended up with the config below which now works:
`        'redis' => [
        'cluster' => false,
        'client' => 'predis',
        'driver' => 'redis',

        'default' => [
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_DB', 0),
        ],

        'cache' => [
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_CACHE_DB', 1),
        ],

        'session' => [
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_CACHE_DB_TWO', 2),
        ],

    ],`

authors: GrahamCampbell Gummibeer Scyllaly ahthomsen scottconnerly summerblue willsmanley

repo: laravel/framework


text:
DatabaseMigrations in tests does not rollback

Laravel Version: 5.4.12
PHP Version: 7.1.3
Database Driver & Version: MYSQL 5.7.17

Description:
My tests table is not being migrated after every tests. The data just keeps piling up without being reset.
Steps To Reproduce:
Add these lines in phpunit.xml:
<env name="DB_CONNECTION" value="mysql"/>
<env name="DB_DATABASE" value="kin-ball-v4-testing"/>

And then use the trait: use DatabaseMigrations; in your tests.
I don't even have an setup method in this test like this thread was saying:
https://laracasts.com/discuss/channels/testing/databasetransactions-databasemigrations-have-no-effect
Thanks,

Don't you also need to use Illuminate\Foundation\Testing\DatabaseTransactions trait for the migrations to rollback?

@brunogaspar Yeah, I import that and then use the trait in my class.
<?php

namespace Tests\Feature;

use Illuminate\Foundation\Testing\DatabaseMigrations;
use Tests\TestCase;

class SeasonTest extends TestCase
{
    use DatabaseMigrations;

@brunogaspar no, the migrations trait is sufficient on its own

Oh my bad, i need some sleep lol, thought it was not rolling back when something failed.

I found another thread with the same kind of error:
https://github.com/laravel/framework/issues/12161
But it was supposed to be fixed...

I think I found the issue.
Here is the code for DatabaseMigrations:
 public function runDatabaseMigrations()
    {
        $this->artisan('migrate');

        $this->app[Kernel::class]->setArtisan(null);

        $this->beforeApplicationDestroyed(function () {
            $this->artisan('migrate:rollback');
        });
    }

As you can see, it runs migrate:rollback instead of migrate:refresh

It migrates before and rolls back afterwards. Next time it migrates before and rolls back afterwards. I use it currently with two of my test suites with over 1000 tests.

Yeah your right. I don't know what I was thinking. For some reason I was thinking about my prod DB I guess.
But yeah, I know that that trait function gets called... I just don't know why it's not getting rolled back...

hmmm It looks like I can't replicate the issue, it runs rollback as normal, I suggest that you create a new fresh laravel app and test there, if it works then check if you made any changes to the migrator via a service provider or something in your project.

Hi,
I think I found out why. Homestead sets an local env variable which doesn't get overriden... so the APP_ENV never gets changed to testing.

authors: asivaneswaran brunogaspar devcircus themsaid


text:
dispatch function return

In version 5.4, dispatch ($job) returns a jobId, but after upgrading version 5.5, it returns an object.
I compared the two versions and found different ways of implementation.
version 5.4
function dispatch($job)
{
     return app(Dispatcher::class)->dispatch($job);
}

version 5.5+
function dispatch($job)
{
     return new PendingDispatch($job);
}

I want to get a jobId，because other services need it for polling queue consumption results.
Thank you in advance.

Please ask on the forums, since this is not a bug report in the core. :)

Check out the 5.4 to 5.5 upgrade guide. This issue is addressed there.
https://laravel.com/docs/5.5/upgrade

yep...  got it,Thansk you.^_^

authors: GrahamCampbell devcircus jiyis


text:
Undefined variable: slot

Laravel Version: 5.6.26
PHP Version: 7.1.14
Database Driver & Version:

Description:
I'm getting Undefined variable: slot when sending an email. It happened once. Tried sending an email after the error and it works. I just want to know what causes this error.

<div class="table">
{{ Illuminate\Mail\Markdown::parse($slot) }}
</div>

Hey, this repository is only for reporting bugs or issues within the Framework itself. If you need support, please use the forums:

https://laracasts.com/discuss
https://laravel.io/forum

Alternatively, you may use Slack (https://larachat.co/), Discord (https://discordapp.com/invite/mPZNm7A), or Stack Overflow (http://stackoverflow.com/questions/tagged/laravel).
Thanks!

authors: ahinkle mrkalmdn


text:
Cloning laravel/framework and executing phpunit fails

Hello. I want to contribute to the framework itself. I have forked and cloned the repo, run composer install and then phpunit
This is the output, I am using the latest homestead version.
vagrant@homestead:~/code/laravel/framework$ phpunit
PHPUnit 8.0.4 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.3.1-1+ubuntu18.04.1+deb.sury.org+1
Configuration: /home/vagrant/code/laravel/framework/phpunit.xml.dist

.............................................................   61 / 4002 (  1%)
.............................................................  122 / 4002 (  3%)
.............................................................  183 / 4002 (  4%)
.............................................................  244 / 4002 (  6%)
.............................................................  305 / 4002 (  7%)
.............................................................  366 / 4002 (  9%)
.............................................................  427 / 4002 ( 10%)
.............................................................  488 / 4002 ( 12%)
.............................................................  549 / 4002 ( 13%)
.............................................................  610 / 4002 ( 15%)
.............................................................  671 / 4002 ( 16%)
....S........................................................  732 / 4002 ( 18%)
.............................................................  793 / 4002 ( 19%)
.............................................................  854 / 4002 ( 21%)
.............................................................  915 / 4002 ( 22%)
.............................................................  976 / 4002 ( 24%)
............................................................. 1037 / 4002 ( 25%)
............................................................. 1098 / 4002 ( 27%)
............................................................. 1159 / 4002 ( 28%)
............................................................. 1220 / 4002 ( 30%)
............................................................. 1281 / 4002 ( 32%)
............................................................. 1342 / 4002 ( 33%)
............................................................. 1403 / 4002 ( 35%)
............................................................. 1464 / 4002 ( 36%)
............................................................. 1525 / 4002 ( 38%)
............................................................. 1586 / 4002 ( 39%)
............................................................. 1647 / 4002 ( 41%)
............................................................. 1708 / 4002 ( 42%)
............................................................. 1769 / 4002 ( 44%)
.........................................................FFF. 1830 / 4002 ( 45%)
..........................FEEEEEEEEEEEE...................... 1891 / 4002 ( 47%)
............................................................. 1952 / 4002 ( 48%)
............................................................. 2013 / 4002 ( 50%)
............................................................. 2074 / 4002 ( 51%)
............................................................. 2135 / 4002 ( 53%)
.................SSSS........................................ 2196 / 4002 ( 54%)
............................................................. 2257 / 4002 ( 56%)
............................................................. 2318 / 4002 ( 57%)
............................................FFF.............. 2379 / 4002 ( 59%)
............................................................. 2440 / 4002 ( 60%)
.........................................PHP Fatal error:  Method Swift_Message::__toString() must not throw an excepti
on, caught ErrorException: fopen(/tmp/d6bd3a501e2644c87eb37069beb308c7/body): failed to open stream: Permission denied
in /home/vagrant/code/laravel/framework/tests/Mail/MailSesTransportTest.php on line 0
PHP Fatal error:  Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debu
g\ExceptionHandler] is not instantiable. in /home/vagrant/code/laravel/framework/src/Illuminate/Container/Container.php
:962
Stack trace:
#0 /home/vagrant/code/laravel/framework/src/Illuminate/Container/Container.php(800): Illuminate\Container\Container->no
tInstantiable('Illuminate\\Cont...')
#1 /home/vagrant/code/laravel/framework/src/Illuminate/Container/Container.php(671): Illuminate\Container\Container->bu
ild('Illuminate\\Cont...')
#2 /home/vagrant/code/laravel/framework/src/Illuminate/Container/Container.php(619): Illuminate\Container\Container->re
solve('Illuminate\\Cont...', Array)
#3 /home/vagrant/code/laravel/framework/src/Illuminate/Foundation/Application.php(757): Illuminate\Container\Container-
>make('Illuminate\\Cont...', Array)
#4 /home/vagrant/code/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(159): Illuminate\Found
ation\Application->make('Illuminate\\Cont...')
#5 /home in /home/vagrant/code/laravel/framework/src/Illuminate/Container/Container.php on line 962

Fatal error: Method Swift_Message::__toString() must not throw an exception, caught ErrorException: fopen(/tmp/d6bd3a50
1e2644c87eb37069beb308c7/body): failed to open stream: Permission denied in /home/vagrant/code/laravel/framework/tests/
Mail/MailSesTransportTest.php on line 0

Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\Exc
eptionHandler] is not instantiable. in /home/vagrant/code/laravel/framework/src/Illuminate/Container/Container.php:962
Stack trace:
#0 /home/vagrant/code/laravel/framework/src/Illuminate/Container/Container.php(800): Illuminate\Container\Container->no
tInstantiable('Illuminate\\Cont...')
#1 /home/vagrant/code/laravel/framework/src/Illuminate/Container/Container.php(671): Illuminate\Container\Container->bu
ild('Illuminate\\Cont...')
#2 /home/vagrant/code/laravel/framework/src/Illuminate/Container/Container.php(619): Illuminate\Container\Container->re
solve('Illuminate\\Cont...', Array)
#3 /home/vagrant/code/laravel/framework/src/Illuminate/Foundation/Application.php(757): Illuminate\Container\Container-
>make('Illuminate\\Cont...', Array)
#4 /home/vagrant/code/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(159): Illuminate\Found
ation\Application->make('Illuminate\\Cont...')
#5 /home in /home/vagrant/code/laravel/framework/src/Illuminate/Container/Container.php on line 962

Commit info:
git branch -v
* 5.8 107ee4a83 [5.8] update changelog

https://github.com/laravel/framework/commit/107ee4a8321b0e7a58d256143a513aa7afd3bd73

@taylorotwell Sorry for bothering you. Any ideas? I want to contribute but I don't know if I am missing something.

Looks like your directories does not have read/write permissions for the user PHP runs as. There is nothing wrong with the test suite.

Sorry, I ignored the template because it wasn't a bug report nor a question about the use of Laravel itself:
I feel so dumb. I tried to sudo chmod 777 /tmp -R and also chmod 777 tests/ -R and even chmod 777 . -R, but the tests still fail. Am I doing something wrong?
(I know I can ask in the forums, but since this is related to laravel/framework itself and not about their usage I want to ask here)

I restarted homestead and run sudo chmod 777 /tmp -R again and the Fatal error is gone. Now I got a bunch of other errors, related to line encodings. For example:
1) Illuminate\Tests\Integration\Mail\RenderingMailWithLocaleTest::testMailableRendersInDefaultLocale
Failed asserting that 'name\r\n
' contains "name
".

I think this is related to the autoclrf feature of git. I will try to disable it and re-clone the entire repo.

Well... I recloned the repo with UNIX line endings and I still getting a lot of errors and I have to run sudo chmod 777 /tmp -R everytime I run the tests in homestead. So, I don't know what I am getting wrong.
It would be great to add more info about in the CONTRIBUTING.md

Hi there,
Looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

Laracasts Forums
Laravel.io Forums
Discord
Larachat
IRC
StackOverflow

authors: ahinkle driesvints jhm-ciberman


text:
laravel 5.8 verification email email/resend post method missing in route

Laravel Version: 5.8.*
PHP Version: 7.2.29

Description:
When you "click here to request another" button on resend verification email i am getting this message "The POST method is not supported for this route. Supported methods: GET, HEAD." we have to change resend verification method from get to post i have check verification email route is  also generating get route.
Steps To Reproduce:
need to modify Illuminate\Routing\Router
$this->get('email/resend', 'Auth\VerificationController@resend')->name('verification.resend');
need to be changed to
$this->post('email/resend', 'Auth\VerificationController@resend')->name('verification.resend');
Right now i have added following route in my web.php which work fine.
Route::post('email/resend','Auth\VerificationController@resend');

In 5.8, that route was a get request. In newer versions it changed to a post. You must be using routes from a different version than your stubs.

My mistake i down graded it from laravel 6 to 5.8 and did not noticed before. yes it is get in laravel 5.8.

Laravel Docs for upgrading to 6.0: https://laravel.com/docs/6.x/upgrade#email-verification-route
Changed from GET to POST request. Code provided.

authors: devcircus murph133 umefarooq


text:
Get NoConfigurationException on production env

Laravel Version: 7.0.1
PHP Version: 7.4.5
Database Driver & Version: unknown

Description:
Hello
I put my first laravel project on production environment and get this error when I call a api route:
Symfony\Component\Routing\Exception\NoConfigurationException:  in file /home/public_html/mydomain.com/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherTrait.php on line 182
I have only api.php routes. I have no route or view in web.php. I generated the key on production environment and installed the packages with composer install.

Could you show your routes/api.php file content? And which api did you call?

`<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------

API Routes

Here is where you can register API routes for your application. These

routes are loaded by the RouteServiceProvider within a group which

is assigned the "api" middleware group. Enjoy building your API!

*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
Route::post('register', 'AuthController@register');
Route::post('login', 'AuthController@login');
Route::post('user/validate', 'UserController@validateUser');
Route::post('password/request', 'PasswordController@request');
Route::post('password/reset', 'PasswordController@reset');
Route::post('contact', 'ContactController@send');
// TODO remove this
Route::post('login/password', 'LoginController@password');
// User
Route::get('user', 'UserController@getUser')->middleware(['auth:api']);
Route::post('user', 'UserController@save')->middleware(['auth:api']);
Route::get('user/remove/request', 'UserController@removeRequest')->middleware(['auth:api']);
Route::post('user/remove', 'UserController@remove')->middleware(['auth:api']);
// Wishlist
Route::get('wishlist', 'WishlistController@all')->middleware(['auth:api']);
Route::get('wishlist/{hash}', 'WishlistController@getByHash');
Route::post('wishlist/{hash}/login', 'WishlistController@login');
Route::get('wishlist/user/{hash}', 'WishlistController@getOwnByHash')->middleware(['auth:api']);
Route::put('wishlist/{id}', 'WishlistController@update')->middleware(['auth:api']);
Route::post('wishlist', 'WishlistController@insert')->middleware(['auth:api']);
Route::delete('wishlist/{id}', 'WishlistController@delete')->middleware(['auth:api']);
// Wish
// Route::get('wish', 'WishlistController@all')->middleware(['auth:api']);
// Route::put('wishlist/{id}', 'WishlistController@update')->middleware(['auth:api']);
Route::post('wish', 'WishController@insert')->middleware(['auth:api']);
Route::put('wish/{id}', 'WishController@update')->middleware(['auth:api']);
Route::delete('wish/{id}', 'WishController@delete')->middleware(['auth:api']);
// Donate
Route::post('donate', 'DonateController@insert');
Route::get('donate/export/{hash}', 'DonateController@export')->middleware(['auth:api']);
`
I try to call user/validate with "email"-parameter. I tried with http and https (I have a lets encrypt ssl certificate).

This exception comes from Symfony. No routes are configured which means this file may not be loaded, I guess. I have no idea. You have to debug your production environment by yourself.

Where can I ask for this error?

did you by any chance touch the App\Providers\RouteServiceProvider file?
could you show?

Not that I know.
My RouteServiceProvider:
<?php

namespace App\Providers;

use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Route;

class RouteServiceProvider extends ServiceProvider
{
    /**
     * This namespace is applied to your controller routes.
     *
     * In addition, it is set as the URL generator's root namespace.
     *
     * @var string
     */
    protected $namespace = 'App\Http\Controllers';

    /**
     * The path to the "home" route for your application.
     *
     * @var string
     */
    public const HOME = '/home';

    /**
     * Define your route model bindings, pattern filters, etc.
     *
     * @return void
     */
    public function boot()
    {
        //

        parent::boot();
    }

    /**
     * Define the routes for the application.
     *
     * @return void
     */
    public function map()
    {
        $this->mapApiRoutes();

        $this->mapWebRoutes();

        //
    }

    /**
     * Define the "web" routes for the application.
     *
     * These routes all receive session state, CSRF protection, etc.
     *
     * @return void
     */
    protected function mapWebRoutes()
    {
        Route::middleware('web')
             ->namespace($this->namespace)
             ->group(base_path('routes/web.php'));
    }

    /**
     * Define the "api" routes for the application.
     *
     * These routes are typically stateless.
     *
     * @return void
     */
    protected function mapApiRoutes()
    {
        Route::prefix('api')
             ->middleware('api')
             ->namespace($this->namespace)
             ->group(base_path('routes/api.php'));
    }
}

does php artisan route:list show any of the routes?

Hi
Try to run these commands at first:
php artisan route:clear
php artisan config:clear

Then try to run php artisan route:list and show output to us.
And can you show full api url that you called?

I did php artisan route:list. Then I realized, that I have to create my passport keys.
Now it works partly...
I have another problem with my routes:
message: "Too few arguments to function App\Http\Controllers\WishlistController::update(), 0 passed and exactly 1 expected"
I get this message from routes like this:
Route::put('wishlist/{id}', 'WishlistController@update')->middleware(['auth:api']);
My controller-function:
    public function update(int $id, Request $request)
    {
        $wishlist = App\Wishlist::find($id);

        if (!$this->_validateUser($wishlist)) {
            throw new HttpResponseException(response()->json(['error' => 'Unauthenticated'], 401));
        }

        $attributes = $request->all();
        return $this->save($wishlist, $attributes);
    }

Locally it works fine...

Sounds like this is not a framework issue.

authors: rniederer sergeByishimo taylorotwell vpankeev xuanquynh


text:
APP_KEY re-generation blocks encrypted casted attribute writting

Laravel Version: 8.52
PHP Version: 8.0
Database Driver & Version: Any

Description:
When a model attribute is using the encrypted cast (or any other variants such as encrypter:json), an APP_KEY update would block any future update on the model. A DecryptException will be thrown at save.
Of course, it is totally expected to be facing this exception when READING the encrypted attribute, but this souldn't (IMHO) occur when simply trying to write a new value.
Steps To Reproduce:

Create a simple table + model using encrypted cast

Schema::create('tests', function (Blueprint $table) {
    $table->id();
    $table->string('private_column');
    $table->timestamps();
});

class Test extends Model
{
    protected $casts = [
        "private_column" => "encrypted",
    ];
}

Create a first record

$model = new Test();
$model->private_column = "secret";
$model->save();

Update app key

php artisan key:generate

Try to update the record (Let's say to re-encrypt the value with the new APP_KEY)

$model = Test::first();
$model->private_column = "secret";
$model->save(); // or $model->update();

Illuminate\Contracts\Encryption\DecryptException with message 'The MAC is invalid.'

This is how things work. The model is hydrated with the encrypted value which is being decrypted. And thus fails because your app key got changed.

authors: driesvints pyrou


text:
Collection::every return true if collect empty

Laravel Version
10*
PHP Version
8.2
Database Driver & Version
No response
Description
Is it expected that the every method returns true if the collection items were empty?
Steps To Reproduce
collect()->every(fn() => die); //true
//doesn't matter what's inside the closure it return true when collection is empty

Hi there,
Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

Laracasts Forums
Laravel.io Forums
StackOverflow
Discord
Larachat
IRC

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!
Thanks.

authors: driesvints foremtehan


text:
#php artisan >>> Base table or view not found: ...

Tonight after rolling back all my migrations, I did a php artisan migrate and got:
{"error":{"type":"Illuminate\\Database\\QueryException","message":"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'my_database.my_table' doesn't exist (SQL: select * from `my_table` where `enabled` = yes order by `name` asc)","file":"\/vhosts\/mysite.local\/vendor\/laravel\/framework\/src\/Illuminate\/Database\/Connection.php","line":555}}
root@server:/vhosts/mysite.local

The funny thing is, I've been doing php artisan migrate:refresh for days with this setup without issue.
At first I thought it was some class file was calling my table and I needed to refresh the composer autoload:
# php artisan dump-autoload

SAME ERROR.  Then I just tried # php artisan. SAME ERROR.
What is going on?  I can't even dump my autoload or run ANY artisan commands. What would be automatically running that is calling my database tables while running the default artisan command?
routes.php only points to controller methods, no SQL in that file.
I removed my view composers as well just incase they were running for some weird reason.
bootstrap/start.php contains no DB queries.
global.php contains no DB queries.
Can't figure this out.  And I can't get a more -verbose error to show up.

for me , its was in the boot method of the app service provider as i set up a view::share() and i have already changed the database.

@Jakobud
This helped. Good thing you shared. Thanks

@devqx thx!

i make some changes  in my migration name
this line: "class CreatePermissionsTable extends Migration"
now when i run any command in Terminal i get this error:
"
In Connection.php line 664:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'note.permissions' doesn't exist (SQL: select * from permissions)
In PDOConnection.php line 79:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'note.permissions' doesn't exist
In PDOConnection.php line 77:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'note.permissions' doesn't exist
"
can any one help me ,please

Thank you @Jakobud

Correction on this for anyone interested. It was the constructor of the command that runs every time and thats where my query was. So that is good to know.

Thank you so much.
I added MyModel::firstOrCreate() in the constructor which caused the bug. There's also no clear error, so it took me a long time until I found your post.
Moving the code from the constructor to handle() solved the problems I had.

@Jakobud You solved my problem

@Jakobud You solved my problem

i make some changes in my migration name
this line: "class CreatePermissionsTable extends Migration"
now when i run any command in Terminal i get this error:
"
In Connection.php line 664:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'note.permissions' doesn't exist (SQL: select * from permissions)
In PDOConnection.php line 79:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'note.permissions' doesn't exist
In PDOConnection.php line 77:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'note.permissions' doesn't exist
"
can any one help me ,please

In the file app/Providers/AuthServiceProvider.php, verify if exists table note, to continue with o script.
if(Schema::hasTable('permissions')){
// your code
}

authors: Jakobud Keania-Eric adilk2005 adonaidiofanes codescamz devqx pedzed s-fraser2007 z-Shahsavan


text:
[5.2] Encryption: Test the IV length in invalidPayload method

Lately, I have upgraded my website from L 4.2.11 to the latest one. The Encryption cipher used before was MCRYPT_RIJNDAEL_128 which uses an IV with a length of 32. Since the payload in the cookies in users was encrypted using the old cipher, the EncryptCookies middleware threw an exception with this trace:
production.ERROR: exception 'ErrorException' with message 'openssl_decrypt(): IV passed is 32 bytes long which is longer than the 16 expected by selected cipher, truncating' in /home/www/MY/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php:95
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'openssl_decrypt...', '/home/www/...', 95, Array)
#1 /home/www/MY/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php(95): openssl_decrypt('Dbyr0401XlXcY6N...', 'AES-256-CBC', 'VyZn2WxfW9UgMrI...', 0, 'h\x82\x9Co\t\x9Fqx\\\x84\x8B\x16\x8B\x82P...')
#2 /home/www/MY/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(95): Illuminate\Encryption\Encrypter->decrypt('eyJpdiI6ImFJS2N...')
#3 /home/www/MY/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(76): Illuminate\Cookie\Middleware\EncryptCookies->decryptCookie('eyJpdiI6ImFJS2N...')
#4 /home/www/MY/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Cookie\Middleware\EncryptCookies->decrypt(Object(Illuminate\Http\Request))
#5 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#6 /home/www/MY/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#7 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#8 /home/www/MY/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#9 /home/www/MY/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(122): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#10 /home/www/MY/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(87): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#11 /home/www/MY/public/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#12 {main}

The obvious and simple trick would be to wrap the openssl_decrypt() in Encrypter.php:95 in a try catch block throwing a DecryptException exception, but this could be prevented since the beginning in the invalidPayload() method in the BaseEncrypter class by testing the length of the IV.
Since getIvSize() is used in the invalidPayload() method in the abstract invalidPayload() class, I declared it as an abstract method in it.
I would go ahead and define getIvSize() in the baseEnrypter class using openssl_cipher_iv_length() method, since the IV length might change in the future depending on the cipher declared in the config file.
At the end, I believe this might be considered as supporting an old version of laravel which is no longer done.

Please send to 5.1.

Okay

source: gharchive/pull-request

authors: GrahamCampbell KluVerKamp


text:
[5.3] Implement new password validation rule

Skeleton update: https://github.com/laravel/laravel/pull/3836
Docs update: https://github.com/laravel/docs/pull/2414
This new rule will allow to validate a given value to match the current logged in user's password. This is handy to require a user to fill in his/her password when submitting forms, etc. For example, when changing a password, you can now add an extra field to require the user's current password to be filled in as well.
This allows you to require a user to fill in his/her password on a form, for example, to change their password:
Validator::make($request->all(), [
    'current_password' => 'required|password',
    'password' => 'required|confirmed',
]);

And countless other examples where password validation can be required.
I'm still a bit unsure about the rule name. password seems a bit too general but on the other hand, it's pretty easy to use and remember. current_password seems a bit too long. passcheck is a bit weird. Feel free to suggest other ones.
I was unsure at first if this should be in core since this couples the auth and hasher component with the validation component. But on the other hand, the validation component already requires the contracts component so we can easily test this (see the added test). There's no extra coupling to the hasher and auth component since you'd only invoke them when the rule is being used.
Would love to get some more opinions on this so feel free to comment 😄

Btw, I wasn't sure because the contribution guide doesn't explicitly says so but I didn't update the Changelog file in this and my last two pr's. Should we do that for new feature pr's?

@driesvints I think it is better not to use auth inside validator, but pass the hash as a parameter to the rule.
Anyway, 👍 for the idea, I had to implement that in my projects several times.

@rkgrep @crynobone ok so more something like this?
    protected function validatePassword($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'password');

        $hasher = $this->container->make('hash');
        $currentPassword = $parameters[0];

        return $hasher->check($value, $currentPassword);
    }

This might be better indeed although it requires the user to always explicitly add the password to validate against. The previous example works more out of the box.
What we could also do is accept an optional parameter, that we have the best of both worlds and you can still pass a password if you like.
    protected function validatePassword($attribute, $value, $parameters)
    {
        $hasher = $this->container->make('hash');

        if ($givenPassword = Arr::first($parameters)) {
            return $hasher->check($value, $givenPassword);
        }

        $auth = $this->container->make('auth');

        if ($auth->guest()) {
            return false;
        }

        return $hasher->check($value, $auth->user()->getAuthPassword());
    }

@rkgrep @crynobone I've updated the PR now with these changes and added some extra tests for it.

@driesvints Just a thought here maybe we could allow the gaurd to be set via the parameters but not require it that way it's more developer friendly? :)
Keep it up! this is a addition on my oppion :+1:

Think I'm going to hold off on this for now since it's such a specialized rule.

@taylorotwell ok, no worries. Was worth a try :)

authors: driesvints morloderex rkgrep taylorotwell


text:
[7.x] Performance improvements

This PR improve asymptotic algorithmic complexity of validation, the speed-up is more than a constant number and it depends on the input size.
Validation tests are passed in my system. I don't know if they break anything. It should be backported to LTS versions. I don't regard this as a breaking change, but you may decide to choose portion of it for version 7, 6, and 5.5.
The performance may still be poor in some cases. But other improvements may require breaking changes or bigger changes.

Missing doc blocks... also, "I don't know if this breaks anything" doesn't inspire confidence.

There's a reason for removing duplicate keys: #4126

I added some phpdocs.
It is not easy to reverse engineer and understand the code. It took me 2 days so far.  I think my changes are good. No guarantee because it is complicated.

@staudenmeir I remove my changes on Relation. That has nothing to do with validation after all. Maybe Collection::unique() can be improved later. It takes O(n^2) time because the call to in_array inside reject().

5.5.

5.5 is no longer maintained. LTS support for it already ended.

There are changes here that appear breaking and I can't risk that on a point release. If you are concerned about people overwhelming your application check the size of the array before sending it to the validator.

So maybe Laravel 8

authors: GrahamCampbell halaei staudenmeir taylorotwell


text:
[1.x] Improve enabled flag

Currently, if you "disable" Pulse it acts as if you never installed it.

No events are registered
The dashboard is not accessible
The commands are not accessible
The pulse class is not registered as a singleton
etc.

This might seem like a good idea, but i think it is more problematic.
Imagine you are running Pulse and you are having troubles. You decide to "disable" pulse and redeploy your application.
If you had php artisan pulse:restart in your deploy script, you deployment just broke because we don't register that command any more.
I think that the enabled switch should really only impact the recorders. We already document that this is what the flag does.

Question
One question I do have, though, is if the pulse:work command and pulse:check command should first look to see if pulse is enabled before starting?

One question I do have, though, is if the pulse:work command and pulse:check command should first look to see if pulse is enabled before starting?

I think pulse:work should continue to work regardless of the setting. You might disable recording but still want to process your ingest backlog. If you don't want that to happen, you can stop the command. I.e. it would be more flexible.
Similarly, I think pulse:check probably shouldn't fail to start/continue - any supervisor stuff will just keep trying to bring it back. My question is whether it should continue to emit beat events?
Another question is if/how this should affect direct calls to Pulse::record that aren't in a recorder? E.g. in the user's controllers/jobs. I think it should probably be a no-op.

As we chatted about, we are fine with beats being emitted, as the recorders are disabled.
We've also made sure that we disable recording on boot when PULSE_ENABLED is false.

authors: jessarcher timacdonald

repo: laravel/pulse


text:
docker-compose: command not found

Sail Version
Whatever laravelsail/php83-composer:latest comes with, I guess.
Laravel Version
11
PHP Version
8.3.4
Operating System
Linux
OS Version
Linux 6.8 (Arch Linux)
Description
Both during installation and when running sail up I get the following errors:
./vendor/laravel/sail/bin/sail: line 201: docker-compose: command not found
./vendor/laravel/sail/bin/sail: line 583: docker-compose: command not found

I'm using Zsh as my shell and Docker v26.0.0. I suppose I can create an alias in the meantime.
Steps To Reproduce
curl -s "https://laravel.build/example-app" | bash
cd example-app
./vendor/bin/sail up

Wondering how this is possible because we have a check for this:
https://github.com/laravel/sail/blob/c4fcfa4d06b496b8bff7e6cccd1c32cc8aeea418/bin/sail#L162-L167

@AimForNaN Don't you have docker compose available?

Turns out it was a user error. I needed to install the docker-compose package.

authors: AimForNaN driesvints

repo: laravel/sail


text:
lark.exceptions.UnexpectedCharacters: No terminal matches ',' in the current parser context, at line 1 col 8

I get the following error when I run the self-query function in langchain，which relis on lark.
1.lark.exceptions.UnexpectedCharacters: No terminal matches ',' in the current parser context, at line 1 col 8
eq(year, '1928年') and eq(day, '1月')
^
Expected one of:
* LPAR
Previous tokens: Token('CNAME', 'year')
2‘lark.exceptions.UnexpectedToken: Unexpected token Token('COMMA', ',') at line 1, column 8.
Expected one of:
* LPAR
Previous tokens: [Token('CNAME', 'year')]

And have you already reported this with langchain? Why do you think this is a lark bug?

authors: CanIbeyourdog MegaIng

repo: lark-parser/lark


text:
建立私有 npm 仓库

我们后面肯定会有很多私有模块，私有的 npm 仓库还是需要的。
一来，npm 太卡，可以快速下载
二来，存在私有模块的需求。

可以放整个 node.js topic 方向考虑
不放这个 lark.js topic 方向考虑

恩 先关了

authors: demohi mobframe

repo: larkjs/lark

license: mit

license_source: bigquery


text:
Add Architecture Sunway Documents ... ?

hello/hi is possible to add document from sunway (used for a supercomputer in china) architecture, because i not found docs for this, or it is not a new architecture but based on in what?

Me Too, I'm Sorry.
It's Is A Idea But Unfortunately I Closed No Fix It, Because We Are Two For No Found It.

The Link CPU Is ::::::::::::: http://www.swcpu.cn/
But All Chinese :( Please Translate With Google Translate The PDF

Thank you!
I downloaded and translated two manuals from here:
https://www-swcpu-cn.translate.goog/list-207-1.html?_x_tr_sl=zh-CN&_x_tr_tl=en&_x_tr_sch=http
I got the Data Sheet, and the Software Interface Manual.  But neither of them describes the instruction set.
Do you find any documentation for the instruction set?

Do you find any documentation for the instruction set?
No, I Cant Get Here.

This is the original page: http://www.swcpu.cn/list-207-1.html

Is A Inspired From DEC Alpha.

authors: cheznewa larsbrinkhoff

repo: larsbrinkhoff/awesome-cpus


text:
Show commit message body in branch overview

Hi
I would like to suggest to show the commit message body (e.g. as a hoverbox) in the branch overview.

https://github.com/nicoespeon/gitgraph.js/issues/138

@patvo Feature is implemented. You can try with the latest build.

@patvo Feature is implemented. You can try with the latest build.

Thanks, works like a charm. This is a great improvement! 👍

authors: bigld christianguenter2 patvo

repo: larshp/abapGit


text:
Landing page still visible after login

When I arrive at the site while logged out, then log in, I'm not redirected to the discussions page.

I think this is referring to the discussions page that doesn't exist any more? I'm going to close but feel free to re-open if I'm wrong @jackcarter.

authors: jackcarter rickhanlonii

repo: larvalabs/pullup


text:
Update cloudwatch, dynamodb, kinesis, s3, sns, ... to 2.17.86

Updates

software.amazon.awssdk:cloudwatch
software.amazon.awssdk:dynamodb
software.amazon.awssdk:kinesis
software.amazon.awssdk:s3
software.amazon.awssdk:sns
software.amazon.awssdk:sqs
software.amazon.awssdk:sts

from 2.16.104 to 2.17.86.
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

Ignore future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "software.amazon.awssdk" } ]

labels: library-update, early-semver-minor, semver-spec-minor

Superseded by #778.


text:
Update scalacheck to 1.15.3

Updates org.scalacheck:scalacheck from 1.15.2 to 1.15.3.
GitHub Release Notes - Changelog - Version Diff
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

Ignore future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "org.scalacheck", artifactId = "scalacheck" } ]

labels: test-library-update, semver-patch

Codecov Report

Merging #421 (9943eb8) into master (41ab44d) will increase coverage by 0.34%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #421      +/-   ##
==========================================
+ Coverage   62.37%   62.71%   +0.34%
==========================================
  Files          38       38
  Lines        1289     1274      -15
  Branches        7        7
==========================================
- Hits          804      799       -5
+ Misses        485      475      -10

Impacted Files
Coverage Δ

core/src/main/scala/laserdisc/laserdisc.scala
62.50% <0.00%> (-4.17%)
:arrow_down:

core/src/main/scala/laserdisc/protocol/RESP.scala
91.26% <0.00%> (-0.07%)
:arrow_down:

cli/src/main/scala/laserdisc/cli/CLI.scala
0.00% <0.00%> (ø)

...src/main/scala/laserdisc/protocol/SortedSetP.scala
0.97% <0.00%> (+0.02%)
:arrow_up:

core/src/main/scala/laserdisc/protocol/GeoP.scala
86.61% <0.00%> (+0.60%)
:arrow_up:

...e/src/main/scala/laserdisc/protocol/ClusterP.scala
68.91% <0.00%> (+1.36%)
:arrow_up:

...e/src/main/scala/laserdisc/protocol/Protocol.scala
100.00% <0.00%> (+5.00%)
:arrow_up:

.../scala/laserdisc/protocol/LenientStringCodec.scala
66.66% <0.00%> (+16.66%)
: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 41ab44d...9943eb8. Read the comment docs.

authors: codecov-io scala-steward

repo: laserdisc-io/laserdisc


text:
Update slack-app-backend to 1.36.1

About this PR
📦 Updates com.slack.api:slack-app-backend from 1.30.0 to 1.36.1
📜 GitHub Release Notes - Version Diff
Usage
✅ Please merge!
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

⚙ Adjust future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "com.slack.api", artifactId = "slack-app-backend" } ]

Or, add this to slow down future updates of this dependency:
dependencyOverrides = [{
  pullRequests = { frequency = "30 days" },
  dependency = { groupId = "com.slack.api", artifactId = "slack-app-backend" }
}]

labels: library-update, early-semver-minor, semver-spec-minor, commit-count:1

Superseded by #143.


text:
Catch native dialog accept and dismiss operations

there are 4 types of native dialog: alert, prompt, before unload, confirm.
dialogs will interrupt execution, should be caught.

refer to #19

repo: last-hit-aab/last-hit


text:
FromRow derivation docs

As requested in https://github.com/launchbadge/sqlx/pull/495
~I set the rust code examples without ignore, which is present in the first code example - I'm not sure why it's necessary.~ nvm, figured it out :zany_face:
I didn't see any standard for docs, so I just rolled with something that looked nice

Thanks for the great start here. :)

authors: OriolMunoz mehcode

repo: launchbadge/sqlx


text:
Sequence diagram mentioned in README is missing

The README mentions a sequence diagram that should depict the scenarios that can happen between the three participants of this system, but it is not there.

This sequence diagram should, ideally, be derived from the implementation!


text:
Support OAuth2 Account Integration

This PR implements support for linking accounts via OAuth2.
By acting as a TV client, we can request users input a code into the official device linking webpage which grants us an access token and a refresh token, which with the former, can be dispatched with requests effectively serving as a replacement to the original source manager's account authentication system. The entire process is done without any external hosted services so security is vastly improved, and this relies on the OAuth flow provided by YT/Google.
The downside to this system is it requires users to keep track of refresh tokens, or authorize youtube-source on every launch.
There are facilities provided to fetch and set refresh tokens to allow for some form of persistence.
This PR requires a few finer details to be worked out, notably:

what happens if an invalid refresh token is provided? This should be handled gracefully, and begin the OAuth process anew.
REST endpoints require testing.
REST endpoints require some form of locking to avoid users making POST requests to update refresh tokens whilst an OAuth initialisation/refresh process is occurring.
Documenting the new endpoints and config properties.

The basic functionality of this PR has been tested, and account authentication does work, with authorization headers being appended onto relevant requests. Testing has not been done to ensure the success of token refreshing as of yet. I also cannot confirm whether providing authentication alleviates any current issues such as "Sign in to confirm you're not a bot" or accessing age restricted videos that the embedded TV client does not provide access to.
A big, or rather, VERY BIG disclaimer to this PR is to use with caution. DO NOT use your main account(s).

Hello,
I wanted to write an issue but maybe this pull request will resolve the problem.
I'm just wondering if this PR is related to the " {'message': 'This video requires login.', 'severity': 'common', 'cause': 'com.sedmelluq.discord.lavaplayer.tools.FriendlyException: This video requires login.'} " error.
Thanks for your answer.

It should, as well as Sign in to confirm you're not a bot. But I should ask — are you trying to play an age restricted video? If so, do you have the TV client enabled?

I get this error with every video I try to play, restricted or not. Everything was working fine like 3 days ago I think, but I yesterday noticed that it does not work anymore.
To be sure I don't tell wrong stuff, I'm going to provide my configuration :
server:
  port: 2333
  address: 127.0.0.1
lavalink:
  plugins:
    - dependency: "dev.lavalink.youtube:youtube-plugin:1.4.0"
      snapshot: false
  server:
    password: "youshallnotpass"
    sources:
      youtube: false
      bandcamp: true
      soundcloud: true
      twitch: true
      vimeo: true
      http: false
      local: false
plugins:
  youtube:
    enabled: true # Whether this source can be used.
    allowSearch: true # Whether "ytsearch:" and "ytmsearch:" can be used.
    allowDirectVideoIds: true # Whether just video IDs can match. If false, only complete URLs will be loaded.
    allowDirectPlaylistIds: true # Whether just playlist IDs can match. If false, only complete URLs will be loaded.
    # The clients to use for track loading. See below for a list of valid clients.
    # Clients are queried in the order they are given (so the first client is queried first and so on...)
    clients:
      - MUSIC
      - ANDROID
      - WEB
    # You can configure individual clients with the following.
    # Any options or clients left unspecified will use their default values,
    # which enables everything for all clients.
    WEB: # names are specified as they are written below under "Available Clients".
      # This will disable using the WEB client for video playback.
      playback: false
    TVHTML5EMBEDDED:
      # The below config disables everything except playback for this client.
      playlistLoading: false # Disables loading of playlists and mixes for this client.
      videoLoading: false # Disables loading of videos for this client (playback is still allowed).
      searching: false # Disables the ability to search for videos for this client.

Why are you using ANDROID?
Why did you disable WEB?

Again, are you using the TV client?

Sorry, I forgot to mention that I also enabled the TV client.

Join the discord server for further support then. This PR is the wrong place for this

Just tested this PR, seems to fix "sign in to confirm you are not a robot" on a Hetzner node and the 403 errors I was getting on my locally hosted node. Thank you for this, you are genuinely a lifesaver. I was having so much trouble with the 403 errors.

I'm having the same problem, Sign in to confirm you're not a bot.
This pull request doesn't fix it
2024-08-05T08:57:29.840Z  INFO 1 --- [Lavalink] [main] lavalink.server.Launcher                 : Starting Launcher v4.0.7 using Java 21.0.3 with PID 1 (/home/container/Lavalink.jar started by ? in /home/container)
2024-08-05T08:57:29.844Z  INFO 1 --- [Lavalink] [main] lavalink.server.Launcher                 : No active profile set, falling back to 1 default profile: "default"
2024-08-05T08:57:30.616Z  INFO 1 --- [Lavalink] [main] l.server.bootstrap.PluginManager         : Found plugin 'DuncteBot-plugin' version 1.7.0
2024-08-05T08:57:30.617Z  INFO 1 --- [Lavalink] [main] l.server.bootstrap.PluginManager         : Found plugin 'youtube-plugin' version 9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5
2024-08-05T08:57:30.617Z  INFO 1 --- [Lavalink] [main] l.server.bootstrap.PluginManager         : Found plugin 'lavasrc-plugin' version 4.2.0
2024-08-05T08:57:30.625Z  INFO 1 --- [Lavalink] [main] l.server.bootstrap.PluginManager         : Loaded skybot-lavalink-plugin-1.7.0.jar (4 classes)
2024-08-05T08:57:30.639Z  INFO 1 --- [Lavalink] [main] l.server.bootstrap.PluginManager         : Loaded youtube-plugin-9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5.jar (12 classes)
2024-08-05T08:57:30.704Z  INFO 1 --- [Lavalink] [main] l.server.bootstrap.PluginManager         : Loaded lavasrc-plugin-4.2.0.jar (131 classes)
2024-08-05T08:57:30.818Z  INFO 1 --- [Lavalink] [main] lavalink.server.Launcher                 : Started Launcher in 1.38 seconds (process running for 1.78)
2024-08-05T08:57:30.871Z  INFO 1 --- [Lavalink] [main] lavalink.server.Launcher                 :

       .   _                  _ _       _    __ _ _
      /\\ | | __ ___   ____ _| (_)_ __ | | __\ \ \ \
     ( ( )| |/ _` \ \ / / _` | | | '_ \| |/ / \ \ \ \
      \\/ | | (_| |\ V / (_| | | | | | |   <   ) ) ) )
       '  |_|\__,_| \_/ \__,_|_|_|_| |_|_|\_\ / / / /
    =========================================/_/_/_/

	Version:        4.0.7
	Build time:     08.07.2024 22:14:17 UTC
	Branch          HEAD
	Commit:         93102f8
	Commit time:    08.07.2024 21:49:02 UTC
	JVM:            21.0.3
	Lavaplayer      2.2.1

2024-08-05T08:57:30.877Z  INFO 1 --- [Lavalink] [main] lavalink.server.Launcher                 : No active profile set, falling back to 1 default profile: "default"
2024-08-05T08:57:31.416Z  WARN 1 --- [Lavalink] [main] io.undertow.websockets.jsr               : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
2024-08-05T08:57:31.431Z  INFO 1 --- [Lavalink] [main] io.undertow.servlet                      : Initializing Spring embedded WebApplicationContext
2024-08-05T08:57:31.432Z  INFO 1 --- [Lavalink] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 550 ms
2024-08-05T08:57:31.512Z  INFO 1 --- [Lavalink] [main] c.g.t.lavasrc.plugin.LavaSrcPlugin       : Loading LavaSrc plugin...
2024-08-05T08:57:31.639Z  INFO 1 --- [Lavalink] [main] c.s.d.l.tools.GarbageCollectionMonitor   : GC monitoring enabled, reporting results every 2 minutes.
2024-08-05T08:57:31.956Z  INFO 1 --- [Lavalink] [main] c.d.lavalinkplugin.DuncteBotInjector     : Registering getyarn audio source manager
2024-08-05T08:57:31.960Z  INFO 1 --- [Lavalink] [main] c.d.lavalinkplugin.DuncteBotInjector     : Registering clypit audio source manager
2024-08-05T08:57:31.961Z  INFO 1 --- [Lavalink] [main] c.d.lavalinkplugin.DuncteBotInjector     : Registering OC Remix audio source manager
2024-08-05T08:57:31.965Z  INFO 1 --- [Lavalink] [main] c.d.lavalinkplugin.DuncteBotInjector     : Registering TikTok audio source manager
2024-08-05T08:57:31.968Z  INFO 1 --- [Lavalink] [main] c.d.lavalinkplugin.DuncteBotInjector     : Registering Mixcloud audio source manager
2024-08-05T08:57:31.969Z  INFO 1 --- [Lavalink] [main] c.d.lavalinkplugin.DuncteBotInjector     : Registering Soundgasm audio source manager
2024-08-05T08:57:32.002Z  INFO 1 --- [Lavalink] [main] d.l.youtube.plugin.YoutubePluginLoader   : YouTube source initialised with clients: WEB, ANDROID_TESTSUITE, TVHTML5_SIMPLY_EMBEDDED_PLAYER
2024-08-05T08:57:32.002Z  INFO 1 --- [Lavalink] [main] c.g.t.lavasrc.plugin.LavaSrcPlugin       : Registering Spotify audio source manager...
2024-08-05T08:57:32.002Z  INFO 1 --- [Lavalink] [main] c.g.t.lavasrc.plugin.LavaSrcPlugin       : Registering Apple Music audio source manager...
2024-08-05T08:57:32.002Z  INFO 1 --- [Lavalink] [main] c.g.t.lavasrc.plugin.LavaSrcPlugin       : Registering Deezer audio source manager...
2024-08-05T08:57:32.002Z  INFO 1 --- [Lavalink] [main] c.g.t.lavasrc.plugin.LavaSrcPlugin       : Registering Yandex Music audio source manager...
2024-08-05T08:57:32.115Z  INFO 1 --- [Lavalink] [main] l.server.config.KoeConfiguration         : OS: LINUX, Arch: X86_64
2024-08-05T08:57:32.115Z  INFO 1 --- [Lavalink] [main] l.server.config.KoeConfiguration         : Enabling JDA-NAS
2024-08-05T08:57:32.117Z  INFO 1 --- [Lavalink] [main] c.s.l.c.natives.NativeLibraryLoader      : Native library udpqueue: loading with filter null
2024-08-05T08:57:32.121Z  INFO 1 --- [Lavalink] [main] c.s.l.c.natives.NativeLibraryLoader      : Native library udpqueue: successfully loaded.
2024-08-05T08:57:32.166Z  WARN 1 --- [Lavalink] [main] l.server.config.SentryConfiguration      : Turning off sentry
2024-08-05T08:57:32.398Z  INFO 1 --- [Lavalink] [main] io.undertow                              : starting server: Undertow - 2.3.13.Final
2024-08-05T08:57:32.406Z  INFO 1 --- [Lavalink] [main] org.xnio                                 : XNIO version 3.8.8.Final
2024-08-05T08:57:32.414Z  INFO 1 --- [Lavalink] [main] org.xnio.nio                             : XNIO NIO Implementation Version 3.8.8.Final
2024-08-05T08:57:32.508Z  INFO 1 --- [Lavalink] [main] org.jboss.threads                        : JBoss Threads version 3.5.0.Final
2024-08-05T08:57:32.560Z  INFO 1 --- [Lavalink] [main] o.s.b.w.e.undertow.UndertowWebServer     : Undertow started on port 28637 (http) with context path '/'
2024-08-05T08:57:32.564Z  INFO 1 --- [Lavalink] [main] lavalink.server.Launcher                 : Started Launcher in 1.74 seconds (process running for 3.526)
2024-08-05T08:57:32.565Z  INFO 1 --- [Lavalink] [main] lavalink.server.Launcher                 : Lavalink is ready to accept connections.
2024-08-05T08:57:46.761Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] io.undertow.servlet                      : Initializing Spring DispatcherServlet 'dispatcherServlet'
2024-08-05T08:57:46.761Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2024-08-05T08:57:46.763Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
2024-08-05T08:57:46.794Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] l.server.io.HandshakeInterceptorImpl     : Incoming connection from /91.211.133.108:17575
2024-08-05T08:57:46.811Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] l.server.io.RequestLoggingFilter         : GET /v4/websocket, client=91.211.133.108
2024-08-05T08:57:46.845Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] lavalink.server.io.SocketServer          : Connection successfully established from shoukakubot/4.0.1 (https://github.com/shipgirlproject/Shoukaku.git)
2024-08-05T08:57:53.656Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] l.server.io.RequestLoggingFilter         : PATCH /v4/sessions/15e03zio0l5yde0o/players/785107327413911592?noReplace=false, client=91.211.133.108, payload={"voice":{"token":"61e991006a1a7efa","endpoint":"russia5995.discord.media:443","sessionId":"ca9a04c884d1a8d95add5be46568c8c5"}}
2024-08-05T08:57:53.711Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] l.server.io.RequestLoggingFilter         : PATCH /v4/sessions/15e03zio0l5yde0o/players/785107327413911592?noReplace=false, client=91.211.133.108, payload={"volume":4}
2024-08-05T08:57:53.715Z  INFO 1 --- [Lavalink] [XNIO-1 task-3] l.server.io.RequestLoggingFilter         : GET /v4/sessions/15e03zio0l5yde0o/players, client=91.211.133.108
2024-08-05T08:57:53.748Z  INFO 1 --- [Lavalink] [XNIO-1 task-3] l.server.player.AudioLoaderRestHandler   : Got request to load for identifier "https://youtu.be/ckIndfjP1vw"
2024-08-05T08:57:54.353Z ERROR 1 --- [Lavalink] [XNIO-1 task-3] lavalink.server.player.AudioLoader       : Load failed

com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Sign in to confirm you’re not a bot
	at dev.lavalink.youtube.clients.skeleton.Client.getPlayabilityStatus(Client.java:74) ~[youtube-plugin-9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5.jar!/:na]
	at dev.lavalink.youtube.clients.skeleton.NonMusicClient.loadTrackInfoFromInnertube(NonMusicClient.java:98) ~[youtube-plugin-9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5.jar!/:na]
	at dev.lavalink.youtube.clients.skeleton.NonMusicClient.loadVideo(NonMusicClient.java:318) ~[youtube-plugin-9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5.jar!/:na]
	at dev.lavalink.youtube.YoutubeAudioSourceManager.lambda$routeFromVideoId$6(YoutubeAudioSourceManager.java:331) ~[youtube-plugin-9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5.jar!/:na]
	at dev.lavalink.youtube.YoutubeAudioSourceManager.loadItemOnce(YoutubeAudioSourceManager.java:207) ~[youtube-plugin-9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5.jar!/:na]
	at dev.lavalink.youtube.YoutubeAudioSourceManager.loadItem(YoutubeAudioSourceManager.java:173) ~[youtube-plugin-9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.checkSourcesForItemOnce(DefaultAudioPlayerManager.java:442) ~[lavaplayer-2.2.1.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.checkSourcesForItem(DefaultAudioPlayerManager.java:423) ~[lavaplayer-2.2.1.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.loadItemSync(DefaultAudioPlayerManager.java:154) ~[lavaplayer-2.2.1.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.loadItemSync(DefaultAudioPlayerManager.java:167) ~[lavaplayer-2.2.1.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager.loadItemSync(AudioPlayerManager.java:103) ~[lavaplayer-2.2.1.jar!/:na]
	at lavalink.server.player.AudioLoader.load(AudioLoader.kt:56) ~[classes!/:4.0.7]
	at lavalink.server.player.AudioLoaderRestHandler.loadTracks(AudioLoaderRestHandler.kt:56) ~[classes!/:4.0.7]
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
	at kotlin.reflect.jvm.internal.calls.CallerImpl$Method.callMethod(CallerImpl.kt:97) ~[kotlin-reflect-2.0.0.jar!/:2.0.0-release-341]
	at kotlin.reflect.jvm.internal.calls.CallerImpl$Method$Instance.call(CallerImpl.kt:113) ~[kotlin-reflect-2.0.0.jar!/:2.0.0-release-341]
	at kotlin.reflect.jvm.internal.KCallableImpl.callDefaultMethod$kotlin_reflection(KCallableImpl.kt:207) ~[kotlin-reflect-2.0.0.jar!/:2.0.0-release-341]
	at kotlin.reflect.jvm.internal.KCallableImpl.callBy(KCallableImpl.kt:112) ~[kotlin-reflect-2.0.0.jar!/:2.0.0-release-341]
	at org.springframework.web.method.support.InvocableHandlerMethod$KotlinDelegate.invokeFunction(InvocableHandlerMethod.java:334) ~[spring-web-6.1.9.jar!/:6.1.9]
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:252) ~[spring-web-6.1.9.jar!/:6.1.9]
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:188) ~[spring-web-6.1.9.jar!/:6.1.9]
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:926) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:831) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:903) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:527) ~[jakarta.servlet-api-6.0.0.jar!/:6.0.0]
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614) ~[jakarta.servlet-api-6.0.0.jar!/:6.0.0]
	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at org.springframework.web.filter.AbstractRequestLoggingFilter.doFilterInternal(AbstractRequestLoggingFilter.java:289) ~[spring-web-6.1.9.jar!/:6.1.9]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.1.9.jar!/:6.1.9]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at lavalink.server.io.ResponseHeaderFilter.doFilterInternal(ResponseHeaderFilter.kt:17) ~[classes!/:4.0.7]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.1.9.jar!/:6.1.9]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.1.9.jar!/:6.1.9]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.1.9.jar!/:6.1.9]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:276) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:132) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:256) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:101) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) ~[jboss-threads-3.5.0.Final.jar!/:3.5.0.Final]
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513) ~[jboss-threads-3.5.0.Final.jar!/:3.5.0.Final]
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538) ~[jboss-threads-3.5.0.Final.jar!/:3.5.0.Final]
	at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282) ~[xnio-api-3.8.8.Final.jar!/:3.8.8.Final]
	at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]

2024-08-05T08:57:54.375Z  INFO 1 --- [Lavalink] [XNIO-1 task-3] l.server.io.RequestLoggingFilter         : GET /v4/loadtracks?identifier=https%3A%2F%2Fyoutu.be%2FckIndfjP1vw, client=91.211.133.108

I'm not seeing any authorisation logs at all. Seems like a misconfiguration issue.

what do I need to add to the configuration to make it work?

what do I need to add to the configuration to make it work?

Change your dependency to look like this:
lavalink:
  plugins:
    - dependency: "dev.lavalink.youtube:youtube-plugin:9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5" # This is the sha of the latest commit in this pr
      snapshot: true # due to it being a commit, enable snapshot (i think)

Add this line to your youtube config:
plugins:
  youtube:
    oauthConfig:
      enabled: true # Default disabled

Launch Lavalink like normal and look at it's logs. Further instruction will be there.
For now, this works very well and solved all the problems I had with authorization errors. However, it is a very bare bones addition.

I don't understand why this pr is not supported, if it solved my problems on one of the hosts on which Lavalink didn't work

It's supported I'm just restricting the level of assistance I'm providing at this stage because I don't have the time to fix issues that pop up. Additionally, as I've only tested the bare minimum so far, I really do not want users reporting obvious bugs that stem from lack of extended testing. This puts pressure on me to push a fix when I'm not able to allocate time to do so. There's also the fact that people will quite happily use this PR without realising it's an in-dev thing. They should be aware of the risks of using an unfinished feature.

Thanks for the clarification. I realize that in its current state PR is experimental and requires further testing. I am grateful for the progress that has been made and the resolution of my concerns. Your hard work is truly valuable and I respect your decision to limit support at this stage to avoid unnecessary pressure and misunderstandings.

authors: Alex-MHR MrScarySpaceCat devoxin makarasty

repo: lavalink-devs/youtube-source


text:
Add an example for wpcli:run command

Just added an example for wpcli:run command.
It is not easy to find the correct format if we are not friendly with Capistrano environment.
Thanks.

ping @lavmeiker

Good observation. I'm merging this.
Thanks.

authors: Soullivaneuh lavmeiker

repo: lavmeiker/capistrano-wpcli


text:
Helm Chart

Created a helm chart to enable easier install into a cluster

@lawrencegripper all updated


text:
OCPP 2.0.1 support

I made this a while ago so there are lots of merge conflicts now, but I'd like to get feedback before updating anything.
This adds OCPP 2.0.1 support (you choose protocol version when creating the integration). It involves major refactoring so I'm not sure if I broke OCPP 1.6, don't really know how to test. Only tested with an OCPP 2.0.1 charger.

Including OCPP 2.0.1 will be a great addition! If you resolve the merge conflicts the tests will run and confirm whether anything in the OCPP 1.6 implementation has been broken.
Then the next step would be to include similar tests for OCPP 2.0.1

I'll start updating it then. I think it requires feature freeze, though, because of extensive refactoring (commits like this one https://github.com/lbbrhzn/ocpp/pull/1381/commits/c65141295cba7b96cb50a1f84c3b9dfcd8ae99ff)

I'll start updating it then. I think it requires feature freeze, though, because of extensive refactoring (commits like this one c651412)

There doesn't appear to be anyone working on getting the multiple connector code ready to integrate so the only reason I can think of for the integration to be updated would be if HA or a dependency introduces a breaking issue. But this would apply to your fork also.

I'll start updating it then. I think it requires feature freeze, though, because of extensive refactoring (commits like this one c651412)

There doesn't appear to be anyone working on getting the multiple connector code ready to integrate so the only reason I can think of for the integration to be updated would be if HA or a dependency introduces a breaking issue. But this would apply to your fork also.

Hey! I just forked the PR for multiple chargers support yesterday. Hoping to contribute. However, my pace will be quite slow. Not sure if this changes anything, but ought you should know.

I'll start updating it then. I think it requires feature freeze, though, because of extensive refactoring (commits like this one c651412)

There doesn't appear to be anyone working on getting the multiple connector code ready to integrate so the only reason I can think of for the integration to be updated would be if HA or a dependency introduces a breaking issue. But this would apply to your fork also.

Hey! I just forked the PR for multiple chargers support yesterday. Hoping to contribute. However, my pace will be quite slow. Not sure if this changes anything, but I thought you should know.

@lightheaded I suggest holding off as the 2.0.1 changes will create significant rework for you otherwise.

Makes sense, thanks for the heads up. Any ETA for this upgrade?

I've rebased onto latest main and will now start working on test coverage.
How long this will take depends on who's slower, me to make further changes or project maintainer to review. I am, however, getting paid to do this by DEFA (a manufacturer of, among other things, an OCPP 2.0.1 charger which is also marketed for private use) so I will do my part in timely manner.

thanks @ars3niy! I get paid to do other things than this project, so my track record on reviewing is not that good. But i'll try to keep up with you!

Oh, the CI checks don't run automatically. I'll try to figure out how to run the locally then.

Using the vscode devcontainer is the best way to go.

This new revision is supposed to pass all checks. Test coverage for OCPP 2.0.1 has not yet been added.

This new revision is supposed to pass all checks. Test coverage for OCPP 2.0.1 has not yet been added.

Nice work, looks like the 1.6 implementation is still functional and passing the tests. I'll have a closer look at the changes over the weekend.

Hey! Great work on this! Do you have a guesstimate on when this might be merged?

@drc38 any progress on review?
I could do a merge and do a prerelease. The test coverage is not great though...

Hi @lbbrhzn, see above for my review. @ars3niy is yet to respond. Tests for 2.0.1 are missing which is the main barrier to it being merged.

@drc38 any progress on review?
I could do a merge and do a prerelease. The test coverage is not great though...

Hi @lbbrhzn, see above for my review. @ars3niy is yet to respond. Tests for 2.0.1 are missing which is the main barrier to it being merged in my view.

@drc38 Maybe I could do a pre-release on this branch? It would allow some people to test OCPP 2.0.1 in the field...

@drc38 any progress on review?
I could do a merge and do a prerelease. The test coverage is not great though...

Hi @lbbrhzn, see above for my review. @ars3niy is yet to respond. Tests for 2.0.1 are missing which is the main barrier to it being merged in my view.

@drc38 Maybe I could do a pre-release on this branch? It would allow some people to test OCPP 2.0.1 in the field...

Up to you, it would then be easier to continue with changes to the main branch. If you do also update manifest so that websockets <14 do to a breaking change in latest release.

Changes in new revision:

Do not offer to choose OCPP version when creating integration. Instead, tell the charger both 1.6 and 2.0.1 is supported unless specified otherwise by setting CONF_SUBPROTOCOL in some config file.
Do not change how charger availability is interpreted.
Do not add new error messages for setting charging profile, and implement custom charging profiles by passing the verbatim to OCPP call just like OCPP 1.6 implementation does.

I will now start adding test coverage for the new code.

I am unable to write tests for OCPP 2.0.1 because of a web socket glitch I do not understand. It may be the same thing I see with a real charger: shortly after the charger connects to HA, web socket drops, then the charger reconnects and works normally from there.
Any clues as to why my test fails?

I am unable to write tests for OCPP 2.0.1 because of a web socket glitch I do not understand. It may be the same thing I see with a real charger: shortly after the charger connects to HA, web socket drops, then the charger reconnects and works normally from there.
Any clues as to why my test fails?

Have you pinned the websockets version to <14? Code changes are required to get 14.1 to work.

I am unable to write tests for OCPP 2.0.1 because of a web socket glitch I do not understand. It may be the same thing I see with a real charger: shortly after the charger connects to HA, web socket drops, then the charger reconnects and works normally from there.
Any clues as to why my test fails?

A couple of things you can try are enabling debug for websockets to see if there's anymore detail on why/when the websockets close is occurring. Reduce the number of OCPP messages being sent until you can isolate the one causing the issue. The issue appears to be in the post_connect phase.

Have you pinned the websockets version to <14?

I did not do anything but I happen to have version 12.0

you can try are enabling debug for websockets

how does one do that?

https://docs.pytest.org/en/stable/how-to/logging.html

Are you running tests in parallel on the same websocket?  If so then they can interfere with each eg close the socket.

Are you running tests in parallel on the same websocket? If so then they can interfere with each eg close the socket.

Don't think so, I'm only running the 2.0.1 test case when I'm testing locally:
pytest --log-level=DEBUG --cov=./ --cov-report=term-missing --timeout=30 --durations=10 -n auto -p no:sugar -rA tests/test_charge_point_v201.py::test_cms_responses_v201

Can't spot anything obvious, suggest using breakpoints to try and narrow the issue down further. Also as v1.6 does not have the same problem look for any differences in approach to the tests.

I was able to get complete call trace. It happens when post_connect calls async_update_entry here https://github.com/ars3niy/ha-ocpp/blob/ocpp20/custom_components/ocpp/chargepoint.py#L320 (exact same logic is present on the current main branch).
It is possible this also happens with OCPP 1.6, only existing tests do not see it because they do not wait for post_connect to complete. I, however, do not want to not wait for post_connect to complete in my tests.

I was able to get complete call trace. It happens when post_connect calls async_update_entry here https://github.com/ars3niy/ha-ocpp/blob/ocpp20/custom_components/ocpp/chargepoint.py#L320 (exact same logic is present on the current main branch).
It is possible this also happens with OCPP 1.6, only existing tests do not see it because they do not wait for post_connect to complete. I, however, do not want to not wait for post_connect to complete in my tests.

So do the tests pass if you comment out that line?

So do the tests pass if you comment out that line?

Yes, including when running all the tests and not just the now v2.0.1 one.

I am able to avoid this in the test case if I set CONF_MONITORED_VARIABLES in the initial MockConfigEntry to exactly the list of measurands returned by the charger. This is not a realistic situation but it gets the job done for the time being.

One more change addressing the last major review comment. Now meter values from both OCPP versions are processed using one and the same function.
In doing so I have sacrificed rounding logic so meter values may look ugly (0.30000000000004 etc.). I'll check that later but other than this, quality should be good.

I am able to avoid this in the test case if I set CONF_MONITORED_VARIABLES in the initial MockConfigEntry to exactly the list of measurands returned by the charger. This is not a realistic situation but it gets the job done for the time being.

Based on your observations I'd also shift the entry update lines of code to after self.post_connect_success = True which avoids a bit of repetition after the reload.

Please do :-)

@ars3niy great work! Can you fix the couple of test deprecation warnings please.

I am able to avoid this in the test case if I set CONF_MONITORED_VARIABLES in the initial MockConfigEntry to exactly the list of measurands returned by the charger. This is not a realistic situation but it gets the job done for the time being.

Another approach is to catch the websockets.exceptions.ConnectionClosedOK the update entry raises and pass or supress it.

@ars3niy is there anything else or ok to merge?

I just need to test with a real charger to make sure all decimal values are OK.

There, now fully tested by me. Rounding was needed in one place, I added it. Also changed datetime.now() call, renamed charge points in tests and refactored the new tests a little.
Test coverage check fails, however, because the commits refactor most of existing code that did not quite have full coverage to start with.

repo: lbbrhzn/ocpp