text:
Fixed source key name for docugami loader

The Docugami loader was not returning the source metadata key. This was triggering this exception when used with retrievers, per https://github.com/langchain-ai/langchain/blob/master/libs/langchain/langchain/schema/prompt_template.py#L193C1-L195C41
The fix is simple and just updates the metadata key name for the document each chunk is sourced from, from "name" to "source" as expected.
I tested by running the python notebook that has an end to end scenario in it.
Tagging DataLoader maintainers @rlancemartin @eyurtsev

@rlancemartin @eyurtsev gentle ping on this please... thank you

Hi @rlancemartin @eyurtsev this should hopefully be a quick one to review and merge... thank you!

Feedback addressed, thank you @baskaryan @hinthornw

thanks @tjaffri!

authors: baskaryan tjaffri


text:
How to get autogpt logs in callback function?

After I run AutoGPT.fromLLMAndTools(...) autogpt.run, this data will be automatically printed out on my terminal.
{     "thoughts": {         "text": "...",         "reasoning": "...",         "plan": "...",         "criticism": "...",         "speak": "..."     },     "command": {         "name": "...",         "args": {             "input": "..."         }     } }
How do I get this data in the callback function?

Here are the steps of the integration for custom callbacks:

Extend the node_modules/langchain/dist/experimental/autogpt/agent.d.ts file with a RunCallbacks interface and update the run function inside the AutoGPT class as follows:

interface RunCallbacks {
    /**
     * Callback for intermediate steps of the run process.
     * @param step The current step or intermediate result.
     */
    onStep?: (step: any) => void; // Adjust the 'any' type based on the actual step structure

    /**
     * Callback for handling errors that occur during the run.
     * @param error The error encountered during the run.
     */
    onError?: (error: Error) => void;

    /**
     * Callback for when the run process completes.
     * @param result The final result of the run, or undefined if the maximum number of iterations was reached without a result.
     */
    onComplete?: (result: string | undefined) => void;
}

/** ... */

export declare class AutoGPT {

/** ... */

/**
     * Runs the AI with a given set of goals.
     * @param goals An array of strings representing the goals.
     * @param callbacks An optional object containing callback functions for different stages of the run process.
     * @returns A string representing the result of the run or undefined if the maximum number of iterations is reached without a result.
     */
    run(goals: string[], callbacks?: RunCallbacks): Promise<string | undefined>;
}

Update the run function and implement your customization in the node_modules/langchain/dist/experimental/autogpt/agent.js and/or agent.cjs files like the following example:

/**
 * Runs the AI with a given set of goals.
 * @param {Array<string>} goals An array of strings representing the goals.
 * @param {Function} onStep Callback for each intermediate step or reply.
 * @param {Function} onError Callback for handling errors.
 * @param {Function} onComplete Callback when execution completes successfully.
 * @returns {Promise<string|undefined>} A string representing the result of the run or undefined if the maximum number of iterations is reached without a result.
 */
async run(goals, callbacks = {}) {
    const user_input = "Determine which next command to use, and respond using the format specified above:";
    let loopCount = 0;
    while (loopCount < this.maxIterations) {
        loopCount += 1;
        let assistantReply;
        try {
            const response = await this.chain.call({
                goals,
                user_input,
                memory: this.memory,
                messages: this.fullMessageHistory,
            });
            assistantReply = response.text;
            // Invoke onStep callback with the assistant reply
            if (callbacks.onStep) callbacks.onStep(assistantReply);
        } catch (error) {
            console.error("Error calling chain:", error);
            if (callbacks.onError) callbacks.onError(error);
            return; // Exit the function on error
        }
        console.log(assistantReply);
        this.fullMessageHistory.push({type: 'Human', content: user_input});
        this.fullMessageHistory.push({type: 'AI', content: assistantReply});
        const action = await this.outputParser.parse(assistantReply);
        const tools = this.tools.reduce((acc, tool) => ({ ...acc, [tool.name]: tool }), {});
        let result;
        try {
            if (action.name === "FINISH_NAME") {
                if (callbacks.onComplete) callbacks.onComplete(action.args.response);
                return action.args.response;
            }
            if (action.name in tools) {
                const tool = tools[action.name];
                const observation = await tool.call(action.args);
                result = `Command ${tool.name} returned: ${observation}`;
            } else if (action.name === "ERROR") {
                result = `Error: ${action.args}. `;
            } else {
                result = `Unknown command '${action.name}'. Please refer to the 'COMMANDS' list for available commands and only respond in the specified JSON format.`;
            }
        } catch (e) {
            console.error("Error executing action:", e);
            if (callbacks.onError) callbacks.onError(e);
            return; // Exit the function on error
        }
        let memoryToAdd = `Assistant Reply: ${assistantReply}\nResult: ${result} `;
        if (this.feedbackTool) {
            try {
                const feedback = await this.feedbackTool.call("Input: ");
                if (feedback === "q" || feedback === "stop") {
                    console.log("EXITING");
                    if (callbacks.onComplete) callbacks.onComplete("EXITING");
                    return "EXITING";
                }
                memoryToAdd += feedback;
            } catch (e) {
                console.error("Error getting feedback:", e);
                if (callbacks.onError) callbacks.onError(e);
                return; // Exit the function on error
            }
        }
        const documents = await this.textSplitter.createDocuments([memoryToAdd]);
        await this.memory.addDocuments(documents);
        this.fullMessageHistory.push({type: 'System', content: result});
    }
    if (onComplete) onComplete(undefined);
    return undefined;
}

Clear your application's cache, ensure that to load the updated files and then run the application. After these changes you'll be able to pass callbacks like in the following example below.

Example usage
// Prepare a promise to handle the AutoGPT run process
        const promise = new Promise((resolve, reject) => {
            this.autogpt.run([input], {
                onStep: (step) => {
                    console.log(`Intermediate Step: ${JSON.stringify(step)}`);
                },
                onComplete: (result) => {
                    console.log('AutoGPT run completed successfully.');
                    resolve(result); // Resolve the promise with the final result
                },
                onError: (error) => {
                    console.error('An error occurred during the AutoGPT run:', error);
                    reject(error); // Reject the promise on error
                }
            });
        });

Note
This approach is for demonstration purpose. Customized output parsers needs to be created for different use-cases.

source: gharchive/issue

repo: langchain-ai/langchainjs

license: MIT

license_type: permissive

license_source: github-api


text:
Failed to invoke a chain twice based on XataChatMessageHistory in the same session.

Checked other resources

[X] I added a very descriptive title to this issue.
[X] I searched the LangChain.js documentation with the integrated search.
[X] I used the GitHub search to find a similar question and didn't find it.
[X] I am sure that this is a bug in LangChain.js rather than my code.
[X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code
/// <reference types="https://esm.sh/v135/@supabase/functions-js@2.4.1/src/edge-runtime.d.ts" />
import { BufferMemory } from "https://esm.sh/langchain@0.2.4/memory";
import { ChatOpenAI } from "https://esm.sh/@langchain/openai@0.1.0";
import { ConversationChain } from "https://esm.sh/langchain@0.2.4/chains";
import { XataChatMessageHistory } from "https://esm.sh/@langchain/community@0.2.5/stores/message/xata";
import { BaseClient } from "https://esm.sh/@xata.io/client@0.28.4";

const getXataClient = () => {
    const xata = new BaseClient({
      databaseURL: xata_db_url,
      apiKey: xata_apiKey,
      branch: xata_branch,
    });
    return xata;
  };

const memory = new BufferMemory({
  chatHistory: new XataChatMessageHistory({
    table: xata_table_name,
    sessionId: new Date().toISOString(), // Or some other unique identifier for the conversation
    client: getXataClient(),
    createTable: false, // Explicitly set to false if the table is already created
  }),
});

const model = new ChatOpenAI({apiKey: openai_apiKey, model: openai_model, temperature: 0});
const chain = new ConversationChain({ llm: model, memory });

const res1 = await chain.invoke({ input: "Hi, I'm Jim" });
console.log({ res1 });
const res2 = await chain.invoke({ input: "Who am I?"});
console.log({ res2 });

Error Message and Stack Trace (if applicable)
[Info] {
  res1: {
    response: "Hello Jim! It's nice to meet you. How can I assist you today?"
  }
}
[Error] SyntaxError: "[object Object]" is not valid JSON
    at JSON.parse (<anonymous>)
    at https://esm.sh/v135/@langchain/community@0.2.5/esnext/stores/message/xata.js:2:2067
    at Array.map (<anonymous>)
    at r.map (https://esm.sh/v135/@xata.io/client@0.29.5/esnext/client.mjs:4:46285)
    at o.getMessages (https://esm.sh/v135/@langchain/community@0.2.5/esnext/stores/message/xata.js:2:2011)
    at eventLoopTick (ext:core/01_core.js:64:7)
    at async x.loadMemoryVariables (https://esm.sh/v135/langchain@0.2.4/esnext/memory.js:2:2174)
    at async T._formatValues (https://esm.sh/v135/langchain@0.2.4/esnext/chains.js:2:2329)
    at async T.invoke (https://esm.sh/v135/langchain@0.2.4/esnext/chains.js:2:821)
    at async Object.handler (file:///home/deno/functions/chain/index.ts:56:16)

Description
I just duplicated the code in the official document of Xata Chat Memory:
https://js.langchain.com/v0.1/docs/integrations/chat_memory/xata/ and tried to run it locally.
I can successfully invoke the chain when creating a new session, and can find records of human and AI messages in my xata database.
However, when I tried to invoke it in the same session, I failed and got [Error] SyntaxError: "[object Object]" is not valid JSON .
It seems like a Javascript object was wrongly passed to the JSON.parsefunction. However, the code is too complicated to understand. Please tell me how to debug and solve it.
System Info
Deno1.44.0

I've checked in xata database that all of the ```additionalKwargs`` are empty JSON objects. The problem must exist in the process of   retrieving and parsing. How could I verify whether the data being passed is correctly formatted?

I think I found the problem.
The previous xata table I linked to was originally created by xata pakages of python version.
So when I set createTable to true to create a new table using xata packages of js version, it works.
The true reason involve too many codes in too many packages, which is too complicated, and I don't want to investigate further. Howerver, I would be appreciated if someone can tell me. Thank you!


text:
Guardrails support

Is your feature request related to a problem? Please describe.
It would be great if langchain4j supported some kind of guardrails functionality. See Guardrails AI for example (https://shreyar.github.io/guardrails/).

Hi @radosdesign, could you please provide more details? Guardrails has a lot of features, which one(s) are you interested in? Thanks

@radosdesign closing this issue because no response. Feel free to reopen.


text:
Merge remote-tracking branch 'refs/remotes/origin/master' into nkas

Исправлены build.gradle

Список файлов почему-то пуст, нужен ли нам такой коммит??
не билдится на сервере, нужно исправить.

@adavydenko не билдится, потому что что-то на CI-сервере сломалось. Скоро займусь этим.

source: gharchive/pull-request

authors: NIKKAS29 adavydenko broadwaylamb

repo: lanit-tercom-school/grouplock

license_source: bigquery


text:
vercel部署onemanager后，文件上传不上去的问题

这个插件是必须要用本地挂载的方式上传么，我用的vervel，上传图片报错了

vervel的链接格式好像不一样哎，我有机会再搞，这段时间没啥空

这个插件是必须要用本地挂载的方式上传么，我用的vervel，上传图片报错了

我也是

我应该早点来看看issue的 原来是因为不支持vercel部署 请问还会更新吗 辛苦啦

我会看看的，不过你要等一段时间了
------------------ 原始邮件 ------------------
发件人: @.>;
发送时间: 2023年5月17日(星期三) 凌晨1:36
收件人: @.>;
抄送: @.>; @.>;
主题: Re: [laoxinH/picgo-plugin-onemanager] vercel部署onemanager后，文件上传不上去的问题 (Issue #1)
我应该早点来看看issue的 原来是因为不支持vercel部署 请问还会更新吗 辛苦啦
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: @.***>

我会看看的，不过你要等一段时间了
...
------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年5月17日(星期三) 凌晨1:36 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [laoxinH/picgo-plugin-onemanager] vercel部署onemanager后，文件上传不上去的问题 (Issue #1) 我应该早点来看看issue的 原来是因为不支持vercel部署 请问还会更新吗 辛苦啦 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

作者可以看看这个https://github.com/Orainge/picgo-plugin-onemanager/commit/97093e364aa0de2906366c2cd52fd6bcb573d23e

白忙活0-0 也是搞完vercel看到这个issue

authors: 683280yj ARRrui FASUZO RrowR laoxinH

repo: laoxinH/picgo-plugin-onemanager


text:
Stack Overflow when using floem and libloading

Running this code results in a stack overflow. The code uses libloading to load a shared library libplugin.so
use floem::view::View;

fn main() {
    floem::launch(move || unsafe {
        let lib = libloading::Library::new("./target/debug/libplugin.so").unwrap();
        let func = lib
            .get::<unsafe fn() -> Box<dyn View>>(b"plugin_main")
            .unwrap();

        func()
    });
}

this the libplugin.so code
use floem::view::View;
use floem::views::{label, stack, text};

#[no_mangle]
pub fn plugin_main() -> Box<dyn View> {
    let view = stack((
        label(move || format!("Value: {}", 0)),
        stack((
            text("Increment"),
            text("Decrement"),
        )),
    ));

    Box::new(view)
}

this is the cargo runoutput
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
fish: Job 1, 'cargo run' terminated by signal SIGABRT (Abort)

this is a backtrace if anyone is interested
https://gist.github.com/OueslatiGhaith/1355c9f7f1714224fa76fcc2e839454c
the stack overflow happens because taffy::node::Taffy::mark_dirty_internal::mark_dirty_recursive is getting called in an infinite loop

the stack overflow happens because taffy::node::Taffy::mark_dirty_internal::mark_dirty_recursive is getting called in an infinite loop

This is likely because there is a bug causing a cycle to be introduced into the node tree (making it not a tree anymore!). Taffy's mark_dirty method recurses up the tree until it finds a node with no parent. But if it never finds such a node because there is a cycle then it will enter an infinite loop.

authors: OueslatiGhaith nicoburns

repo: lapce/floem


text:
Copy/Paste doesn't work when caps lock is enabled

Most applications afaik can still use Ctrl+c, Ctrl+v, and most other shortcuts regardless of whether the caps lock is enabled.  In lapce, however, enabling caps lock basically adds a <shift> keypress to each shortcut you attempt to use.

I think it is related to #898

repo: lapce/lapce


text:
Fix php worker 8.x amqp

Description
As @fredsal figured out in my previous PR https://github.com/laradock/laradock/pull/3142 fixing php-worker building for php 8.1. I decided to fix also AMQP, as its installation fails the CI for php-worker 8.0 and 8.1.
Motivation and Context
If my previous PR https://github.com/laradock/laradock/pull/3142 is merged, this is the next step to make this Dockerfile to build.
Also, I like when CI works and this PR can improve other projects.
Types of Changes

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

Definition of Done Checklist:

[x] I've read the Contribution Guide.
[ ] I've updated the documentation. (refer to this for how to do so).
[x] I enjoyed my time contributing and making developer's life easier :)

@tancou I am still getting this error on php 8.1
executor failed running [/bin/sh -c if [ ${INSTALL_AMQP} = true ]; then   docker-php-ext-install sockets;   apk --update add -q rabbitmq-c rabbitmq-c-dev &&   if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then     printf "\n" | pecl install amqp-1.11.0;   else     printf "\n" | pecl install amqp-1.11.0;   fi &&     docker-php-ext-enable amqp &&     apk del -q rabbitmq-c-dev;     php -m | grep -oiE '^amqp$'   ;fi]: exit code: 1
ERROR: Service 'php-worker' failed to build : Build failed

authors: Silassiai tancou

repo: laradock/laradock


text:
Issues 563

/home/laradock/aliases.sh: line 2: $'\r': command not found

FIX:
sed -i 's/\r//' /home/laradock/aliases.sh

function mkd() {
    mkdir -p "$@" && cd "$@"
}

sh not work with func!

@bagart Awesome thanks!

authors: bagart philtrep


text:
Fixed typo in "started".

Just saw the typo as I was going through the docs and thought I'd fix it.

Thanks. Merged and published.

authors: jasonmccreary jdubwelch

repo: laravel-shift/blueprint-docs


text:
Convert to app router

This updates the laravel/breeze-next starter to using the new App Router routing syntax. I am not a nextjs expert so it is very possible that I'm missing better ways to do this.
This also bumps the nextjs version to nextjs 14
Benefits to changing- App Router is the "new" way of doing routing in nextjs applications so this modernizes this starter kit.
Technically, the pages style routing is still valid so we could offer both types in separate branches or just convert to the new direction.

Seems to work pretty well. A couple of questions:

The Nunito font doesn't seem to be rendering.
Can you link me to some docs explaining what the "@" sign does when naming directories, for example in "@header".

Please mark as ready for review when answered.

So here are the docs on the "@" sign- They are called parallel routes and I'm not actually sure if this is the best spot for them. - https://nextjs.org/docs/app/building-your-application/routing/parallel-routes
When I imagine the 'dashboard' route I think of the user doing something like having a structure similar to this where posts would be nested in the dashboard route. Something like /dashboard/posts
dashboard
  @header
    page.js
  page.js
  layout.js
  posts
    layout.js
    page.js

In this case that @header would apply to all nested routes so it would be impossible to override the "Dashboard" in the posts route. Instead you could do something like this-
dashboard
  (main)
    @header
      page.js
    page.js
    layout.js
  posts
    @header
      page.js
    layout.js
    page.js

that would allow you to update the header section on each nested route like dashboard/posts in this instance. The other option is to just ditch the parallel routes and colocate a Dashboard component in the dashboard directory similar to the way I added the logo in the auth routes. Which would you prefer? (PS, I'm dropping the layout in the @header and just inlining that code in the @header > page.js regardless since it seems unnecessary now that I'm looking at it again

If I was building an app that had "posts", I'm not sure I would nest it under dashboard. I would imagine having /posts.

In that case it might be fine the way it is

@allenjd3 it seems strange to me that @header would be tied to the dashboard directory though? You would likely want to use that basic header on lots of pages?

Yeah what's odd about parallel routes is that they don't support nesting- Here is a discussion that talks about this limitation: https://github.com/vercel/next.js/discussions/48927 - In this case it would be nice to have the slot in the layout one level above the dashboard and then ideally you could override it in nested routes. But it currently requires the @header to be in the same directory and it would be inherited by all children. So in the case we were discussing earlier if you had-
(app)
  page.js
  layout.js
  @header
    page.js
  dashboard
    etc...
  posts
    etc...

Then /dashboard and /posts would both have the exact same @header-
Perhaps in this case a wrapping component still makes more sense?

I went ahead and simplified it by recreating the DashboardLayout component. Feel free to walk that commit back if you want to keep the other way of doing it!

Alright I finally figured out how to do the @header the proper way... Sorry for all the back and forth 😅
Looks like you can do this-
(app)
  @header
    dashboard
      page.js
  dashboard
    page.js
    layout.js
  layout.js

where the root route has the reference to the header and the header names routes that are "parallel" to the ones that you create using the normal routing. Makes sense now that I get it.

@allenjd3  Nice work. There is one thing we need to look into. How to prevent a flash on login page when say someone is visiting it from an authenticated area? Not sure how you would approach this with Next 14 and this Breeze starter kit. Any tips?

I put in a possible solution to the flicker- I'm researching how to do this using the new Suspense api. I'll update this if I can figure it out!

I think middlewares might be one way
Ali Gajani
Founder at Mr. Geek
www.mrgeek.me
www.aligajani.com
On Sat, Dec 23, 2023 at 3:28 PM James Allen @.***>
wrote:

I put in a possible solution to the flicker- I'm researching how to do
this using the new Suspense api. I'll update this if I can figure it out!
—
Reply to this email directly, view it on GitHub
https://github.com/laravel/breeze-next/pull/39#issuecomment-1868315746,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AANGRWXXI6AWP6ZJRKREIG3YK32DHAVCNFSM6AAAAABAP5EWMGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYGMYTKNZUGY
.
You are receiving this because you commented.Message ID:
@.***>

I got  Error: Hydration failed because the initial UI does not match what was rendered on the server. on login page.

If you have something like lastpass enabled on the page it will inject divs that don't play well with nextjs in dev mode

authors: aligajani allenjd3 bjaspire taylorotwell

repo: laravel/breeze-next


text:
Unable to resume() multi-plan subscription.

Cashier Version: 11.2.1
Laravel Version: 6.18.10
PHP Version: 7.2

Description:
Resuming the subscription works fine if there is single subscription. If I have multplan subscription and try to resume the canceled subscription it throws stripe error

Stripe \ Exception \ InvalidRequestException

Whenever I try to resume a plan that has subscription Item [on Multiplan] I get this error

You passed an empty string for 'plan'. We assume empty values are an attempt to unset a parameter; however 'plan' cannot be unset. You should remove 'plan' from your request or supply a non-empty value.

Steps To Reproduce:
Remove
$subscription->plan = $this->stripe_plan;
from resume function. This will not work with multiplan. I dont think there is a need to put this line of code even thought it is a single plan subscription. Just updating the cancel_at_period_end should be fine from the stripe point of view

I actually removed it at first and re-added it because I wasn't sure if removing it was a right idea. I'll fix this and add a dedicated test case for resuming multiplan subscriptions. Thanks for reporting.

PR: https://github.com/laravel/cashier/pull/925

repo: laravel/cashier

license: mit


text:
Logout route is a post method in 5.3

`/**
* Register the typical authentication routes for an application.
*
* @return void
*/
public function auth()
{
// Authentication Routes...
$this->get('login', 'Auth\LoginController@showLoginForm')->name('login');
$this->post('login', 'Auth\LoginController@login');
$this->post('logout', 'Auth\LoginController@logout');
    // Registration Routes...
    $this->get('register', 'Auth\RegisterController@showRegistrationForm');
    $this->post('register', 'Auth\RegisterController@register');

    // Password Reset Routes...
    $this->get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm');
    $this->post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
    $this->get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm');
    $this->post('password/reset', 'Auth\ResetPasswordController@reset');
}`

Yes, we made it POST to be properly HTTP compliant. You must not perform non-readonly actions on GET or HEAD requests.

Any idea how to make this work because I'm getting MethodNotAllowedHttpException.

You need to POST to that now.

ahh ok thanks

Alternately, you could just setup a GET route that does the same thing, albeit to @GrahamCampbell's point it's not HTTP compliant:

Route::get('logout', 'Auth\LoginController@logout');

@jhoff Adding a GET route is breaking the HTTP spec. It should only be POST.

Well, technically, it just must not be "safe", so technically you could use any verb you want so long as it's not GET or HEAD.

authors: GrahamCampbell darwinluague jhoff

repo: laravel/framework


text:
[5.4] Attribute set to Collection is not converted to array

Laravel Version: 5.4.19
PHP Version: 5.6.4
Database Driver & Version: Mysql 5.6.17

Description:
Attributes that are collections are not converted to arrays when toArray() method is called on the model.
I discovered this when using collection cast, but it actually applies to all collection attributes.
Steps To Reproduce:
use Illuminate\Database\Eloquent\Model;

class Dummy extends Model {}

$dummy = new Dummy;

$dummy->foo = collect([1, 2, 3]);

dump($dummy->toArray());

Expected results:
array:1 [
  "foo" => array:3 []
]

Actual results:
array:1 [
  "foo" => Collection {#602}
]

Fix:
Adding code below to attributesToArray() method will give expected results.
foreach ($attributes as $key => $value) {
    $attributes[$key] = $value instanceof Arrayable ? $value->toArray() : $value;
}

Conclusion:
I think attributesToArray() method of the model should check if attribute implements Arrayable interface and then convert it to array with toArray() method.
Please correct me if I am wrong and there is actually a reason for current behavior.

Have you tried casting it to array?

toArray() is recursive for all attributes and relations, so, one way would be to add 'foo' as an attribute.
class Dummy extends Model
{
    protected $appends = ['foo'];

    public function setFooAttribute($value)
    {
        $this->foo = $value;
    }

    public function getFooAttribute()
    {
        return $this->foo;
    }
}

then toArray() will convert 'foo' to an array as well.
Otherwise, you could:
var_dump(json_decode(json_encode($dummy), true));

Thanks for replies!
@Dylan-DPC I want to cast this attribute to collection so casting it to array is kinda counter-productive.
@devcircus I think your code will recurse infinitely - it should be $this->attributes['foo'] instead of $this->foo in both places. Said that it probably solves the issue, however it is almost 10 lines of extra code, with use of functionality that wasn't made for the purpose.
Don't get me wrong, but I didn't add the issue to solve my particular problem, it couldn't be easier after you recognize the cause. I wanted to point out to a behaviour that is probably unexpected by 90% of people especially considering how collections in Laravel do it.

Feel free to open a PR. Closing since it's not actually a bug

authors: Dylan-DPC devcircus imbrish themsaid


text:
Session expiry prevents logout if remember cookie exists

Laravel Version: 5.5
PHP Version: 7.2.0
Database Driver & Version: mysql Ver 15.1 Distrib 10.1.29-MariaDB

Description:
If a session expires (can test with session lifetime of 1), then the user clicks log out, the remember cookie seems to log the user back in and the session is regenerated. So, on an expired session, if there is a remember cookie present, logging out does not remove the remember cookie.
Is this working as intended?
It doesn't seem right that a user could click 'logout' after the session expires and the result is that the user's session is refreshed and the remember cookie is not removed.
Steps To Reproduce:

Enable remember me on login
Login, wait for session to expire (set session lifetime to 1)
Logout - you'll get a session expired page. Navigate to the homepage and you'll have a fresh, logged in session and remember cookie will still exist.

Tracked down why I encountered this issue to begin with. I was handling the expired session exception from https://laracasts.com/discuss/channels/general-discussion/crsf-checked-before-auth?page=2 like this:
    public function render($request, Exception $exception)
    {
        if ($exception instanceof \Illuminate\Session\TokenMismatchException) {
            session()->flash('expiredSession', 'null');
            return redirect()
                    ->back()
                    ->withInput($request->except('_token'));
        }

        return parent::render($request, $exception);
    }

This caused the page to simply reload when clicking logout after session expiration. Normally, the exception is thrown so a user understands they need to refresh in order to logout.


text:
Request payload breaks when passing an integer with a leading zero

Laravel Version: 5.5.40
PHP Version: 7.1.0
Database Driver & Version: MySql

Description:
I have an endpoint who needs a payload data for a PUT method. One of the fields must be integer type.
My client sometimes pass a integer value starting with 0. When this happens, all the payload breaks. I can't even handle the value because it gets in controller already NULL.
One example of breaking payload:
{"status: "waiting", "code": 09324}
To make a diagnosis of the problem I followed the request trace and stopped in Symfony Request file (Symfony\Component\HttpFoundation\Request.php). On function "get" the $key passes by all verifications and return the default value (which is null for me)
public function get($key, $default = null)
    {
        if ($this !== $result = $this->attributes->get($key, $this)) {
            return $result;
        }

        if ($this !== $result = $this->query->get($key, $this)) {
            return $result;
        }

        if ($this !== $result = $this->request->get($key, $this)) {
            return $result;
        }

        return $default;
    }

Maybe the library is trying to understand an octal value instead of integer? I can't change my business rule (for example change from integer to a string on payload). What's the best way to fix this situation?
Steps To Reproduce:
Make a request for a PUT endpoint with a integer field in body.
Pass a value starting with 0 (example: 0255)
Try to receive this value on controller with the Request library (vendor/symfony/http-foundation/Request.php)

Octal values in JSON are invalid: https://stackoverflow.com/questions/27361565/why-is-json-invalid-if-an-integer-begins-with-0
In any case you can use the json method or input method to retrieve JSON values. See "Retrieving JSON Input Values" here: https://laravel.com/docs/5.7/requests#retrieving-input

authors: AndreLazari driesvints


text:
Container.php -> findInContextualBindings() unexpected external slash

Laravel Version: 6
PHP Version: 7.3
Database Driver & Version: MySQL8

Description:
Application provides unresolvable primitive even if primitives is passed in service provider using "when" syntax
Steps To Reproduce:
class My {
  public function __construct(string $locale) {}
}

$this->app->when(My::class)->needs('$locale')->give(function () {
  return app()->getLocale();
});

$this->app->make(My::class);

Reason:
    protected function findInContextualBindings($abstract)
    {
        return $this->contextual[end($this->buildStack)][$abstract] ?? null;
    }

// dump($this->buildStack); // [ 0 => \My::class; ]
// dump($this->contextual); // My::class => [ '$locale' => Closure ];

two dumps differs with forward backslash

Hey there,
Can you first please try one of the support channels below? If you can actually identify this as a bug, feel free to report back and I'll gladly help you out and re-open this issue.

Laracasts Forums
Laravel.io Forums
StackOverflow
Discord
Larachat
IRC

Thanks!


text:
[7.x] HTTP client overrides multiple occurrences of same query parameter

Laravel Version: 7.1.0
PHP Version: 7.4.3
Database Driver & Version: irrelevant

Description:
I have a use case where I need to query an endpoint with multiple occurrences of the same query parameter. Guzzle supports this just fine if the query parameters are passed in the URL. Laravel's HTTP client, however, always extracts the query parameters from the URL and then passes them to Guzzle as an array. This results in the last occurrence overwriting all prior occurrences.
The endpoint in question is a Lucene/Solr instance that allows the fq query parameter to be specified multiple times. As far as I'm aware there's no standard regarding these query parameters so this should be a valid use case.
Unfortunately there's no way around this problem. Even with the bracket syntax (to indicate a query parameter with multiple values) Guzzle then turns it into a URL that is not supported by Solr.
Steps To Reproduce:
Make a request to an endpoint with multiple occurrences of the same query parameter and you'll see the last occurrence overwrites all previous ones:
Http::get('https://example.com/?fq=hello&fq=world');
// actual request goes to https://example.com/?fq=world

The only sensible way to support duplicate parameters – at least that I can think of – is to only merge the query parameters using PendingRequest::parseQueryParams() if $options['query'] is set. I'd be happy to submit a PR if that's a feasible option.

I dont really know how you will deal with array keys not overriding each other, but for this problem you could try using fq=+hello +world.

I dont really know how you will deal with array keys not overriding each other, but for this problem you could try using fq=+hello +world.

I simplified the example in my first post. My actual use case is a bit more complicated and your suggestion – unfortunately – won't work for me.

This was fixed I think in the latest release: https://github.com/laravel/framework/pull/31858
Can you try with the very latest patch version?

Thanks for responding @driesvints. Unfortunately, that fix is unrelated. I've been able to create a fix, but I haven't yet succeeded in adding a proper test. I'll PR my fix to get some feedback and hopefully someone can assist in writing a test.

Thanks for responding @driesvints, but unfortunately that fix is unrelated. My use case is impossible with the current implementation, because PendingRequest calls parseQueryParams(). It then sets the 'query' option on the Guzzle request, which results in Guzzle ignoring any query parameters in the URL.
A fix would be to remove the call to parseQueryParams() entirely, but I'm not sure how breaking that would be.

Would appreciate a Pr if you could send one in. Thanks!

Fixed and will be in today's release.

authors: devfrey donnysim driesvints


text:
Issue with using "sticky" option with Postgresql driver and read/write connections.

Laravel Version: 7.4.3
PHP Version: 7.12.0
Database Driver & Version: PostgreSQL 12

Description:
I have 2 connection with db (read/write). Also i set "sticky" option as true. After creating new row all request to DB use "read" connection. After updating some row, there are not any problem. This problem is happened when table has auto increment.
Steps To Reproduce:
//create some row.
$quest = factory(Quest::class)->create();
// update this row. if i remove comment for next lines, everything work alright. Because update was made. But when we make only create, selection works via "read" connection.
//$quest->limit_winners = random_int(1, 200);
//$quest->update();
// find this row. (use read connection), but if i understood right have to use write connection, because new row was created.
$quest = Quest::query()->where('id', $quest->id)->first();
print_r($quest);

Don't see any issue in the code. Feel free to make a PR to address any bug you find.

@taylorotwell
I found a problem here:
/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php
When called "processInsertGetId" function we only create new row via selectFromWriteConnection. But function "recordsHaveBeenModified" is not called (this need because all next requests have to use "write connection").
This is my pr https://github.com/laravel/framework/pull/32973

authors: nesh-ua taylorotwell


text:
validation rule "in" accepting value with plus sign in front

Laravel Version
10.10
PHP Version
8.2.12
Database Driver & Version
No response
Description
One of the endpoints in my API is storing a phone number with country code and i´m validating the country code against an array of numbers (none with +)
example:
'country_code' => ['required', Rule::in([47,48,49])],

this rule will accept the values: "+47", "+48" and "+49" and also without the plus sign but will fail for all other numbers both with and without plus sign.
to me this seems like a bug - or am i using the rule wrong?
Steps To Reproduce
create a endpoint that accepts a json payload with a property that takes a number. validate that number against a fixed list of number none of which contains a leading plus sign, and post with postman to that route one of the valid numbers with a leading plus sign.

I just ran some experiments against a series of different inputs, and I think this is a bug
Basic validator make command and output of result
$v = Validator::make($data, $rules); dd($v->passes());
Rule combinations tested
['x' => 47], ['x' => Rule::in([47,48,49])]; // passes
['x' => 46], ['x' => Rule::in([47,48,49])]; // fails
['x' => '47'], ['x' => Rule::in([47,48,49])]; // passes
['x' => '47'], ['x' => Rule::in(['47','48','49'])]; // passes
['x' => 47], ['x' => Rule::in(['47','48','49'])]; // passes
['x' => +47], ['x' => Rule::in([47,48,49])]; // passes
['x' => '+47'], ['x' => Rule::in([47,48,49])]; // passes (I think it should fail)
['x' => '++47'], ['x' => Rule::in([47,48,49])]; // fails
['x' => '+47'], ['x' => Rule::in(['47','48','49'])]; // passes (I think it should fail)
['x' => +47], ['x' => Rule::in(['47','48','49'])]; // passes
+47 is simply "positive 47" (as opposed to -47 being "negative 47"). So matching this when passed in as a integer kind of makes sense. However '+47' is technically a string, and when doing the string comparison it should fail.
I guess this comes down to how strings and numeric strings are treated in both the rules and the incoming request. Unfortunately, I can't see a way where the framework can understand the context of "positive 47" vs "+47" as a string.

Hi there. +47 is a number in PHP and it loosely matches 47 with the "in" rule. We consider this expected behaviour. If anything is unclear we'd appreciate a PR to the docs, thanks.

authors: driesvints martinhschei sonja-turo


text:
Laravel 5.0 - Asyncronous AJAX Requests cause Session Variable Changes to be Overwritten

If a number of AJAX requests are fired which get processed simultaneously by the webserver, the session files do not lock causing session variables to be overwritten.
On rare occasions, the session file can become corrupted if one copy reads in a half written out file.  This condition, however, is difficult to reproduces.
Practically, you probably shouldn't be firing a number of AJAX requests simultaneously, but it is always possible that a user quickly clicks on several buttons that result in requests and the server happens to process those requests simultaneously which would be a reasonable design and result in session problems.
I've put together I very simple demo of this using 26 variables (a-z) which are each incremented by a separate AJAX request.  The final result isn't that all 26 variables have the value of 1 (which it should be).
https://github.com/wiseloren/laravel-race
I think this is referenced in #4441 #4576 #4400  I think in these issues the problem is in file corruption due to reads and writes happening at the same time to the session file, which as I mentioned above, I can't reliably reproduce (though I do think it happened at least once during my testing because half my variables disappeared).
Though it is outdated now #6848 seems to have been intended to fix this.  If someone can verify this, I'm willing to work on updating the pull request and try to get the style in line which seems to have been the only previous complaint.  I'm not sure how one would write a unit test for this since unit tests are executed synchronously and this only happens in async execution.

This is known limitation of the file based session driver.

Does it not apply to any of the drivers?  IE: Is there a driver I can use that won't have this problem.

@GrahamCampbell do you have a fix for this?

I have long POST request and ServerSentEvents request immediately after POST. When i used "file" session driver i got worked out SSE request after POST. When i used "redis" session driver i got SSE request worked out before long POST request.

I'm getting this problem with all tested drivers (native, file, memcached and redis) in Laravel 4.2.
Imagine a browser making multiple (ajax) requests with the same session id:
Request 1: Enters, loads session, does some heavy database processing.
Request 2: Enters, loads session, changes a session var, stores the session, returns a result.
Request 1: Finishes processing, stores previously loaded session, returns result.
Session changes in request 2 are effectively overwritten by request 1.

一个ajax分页，快速地请求各个页面，一会儿，出现401，  session 失效

i am having this issue with laravel 5.1 and redis. any solution?

ping @GrahamCampbell

ping @taylorotwell

Can't we use the native php session as 'file'? That implements locking, right?
Symfony does that already, so can't we use that? https://github.com/symfony/http-foundation/blob/3.0/Session/Storage/Handler/NativeFileSessionHandler.php
Maybe any having these troubles can try with the Symfony drivers? https://github.com/laravel/framework/blob/5.2/src/Illuminate/Session/SessionManager.php
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler;
protected function createNativeDriver()
{
    $path = $this->app['config']['session.files'];
    return $this->buildSession(new NativeFileSessionHandler($path));
}

I am not sure if my problem is related to this issue. I have searched everywhere and seems like there is no solution for an issue I have been experiencing.
When executing multiple ajax requests , Laravel will sporadically respond with 401 which causes the session to end .

https://laracasts.com/discuss/channels/laravel/many-time-401-unauthorized-on-ajax-requests
http://stackoverflow.com/questions/33392268/laravel-and-ajax-sporadic-401-errors-in-a-poller
http://stackoverflow.com/questions/32433062/many-time-401-unauthorized-on-ajax-requests
http://www.tech.theplayhub.com/laravel_-_logging_out_randomly/
http://laravel.io/forum/03-31-2015-after-many-get-requests-via-ajax-i-get-401-unauthorized

same here

same here ...

having the same issue here

When making simultaneous XHR requests, session data may be lost due to concurrent requests updating the session at the same time. This is a known issue. One solution may be reducing the number of requests, or use **session locking **. This allows to lock the session file when used, hence forcing all requests to be executed one after the other. This may slow down your app, but eliminate the potential errors.
Laravel does not include session locking by default. Someone made a Laravel package to add the feature. https://github.com/rairlie/laravel-locking-session
It seems to have worked for me.

Your solution worked for me @cumuluswebdesign, merci beaucoup!!!

@cumuluswebdesign that library worked here too, thank you so much!

Does anyone know of a quick way to replicate this issue on a local environment?

My original issue included a laravel project which shows the issue:
https://github.com/loren138/laravel-race

@loren138 thanks for that, but I need to replicate the issue in our code so I can prove that there is an issue as mentioned by a client and that we managed to resolve it.

Ah, basically you just need to make a bunch of nearly simultaneous AJAX requests.  Alternatively, if you add a sleep(1) or sleep(2) in your problematic functions, then you should be able to click the buttons on the browser side fast enough to create the bug.

Is this a problem for memcache or redis drivers? I believe they don't have the ability to fail like the file driver?

@loren138 I've just tried wrapping my AJAX calls in a foreach loop but I still cannot replicate the issue. I have even tried putting in sleep(1) on the page that the AJAX is calling. Any ideas?

@rreynier The problem probably does exist for memcache and redis, just not to the full extent of file because they probably cannot be corrupted. The problem still exists that without locking a later session can overwrite the earlier or just be wrong.
Consider 3 incoming requests 1 second apart which each take 1.1 seconds to run and increment a session varaible.
Request A reads a value of 0 at time 0 and saves the value 1 at time 1.1
Request B reads a value of 0 at time 1 and saves the value 1 at time 2.1
Request C reads a value of 1 at time 2 and saves the value 2 at time 3.1
As you can see your incremented variable is all messed up and isn't really counting because it has out of order read/write.
@OAFCROB You might want to try a random sleep (ie sleep(rand(1,3));) to try to make sure the requests overlap.  You could also look at your network panel (in developer tools of Chrome or Firefox) and make sure the requests are overlapping as that is what causes this bug.

Without entirely blocking the session this “problem” will always exist for Memcached / Redis. If you are having the issue perhaps consider incrementing the value in a more atomic fashion like using a Redis variable instead of placing the variable in the session. It sounds like the session is being mis-used in this case for something that is best suited for another tool.

We use the session to store a last active timestamp, which is then checked against a before filter. However, on one clients server this session is being wiped for some reason they believe it's related to this but we believe it's their server setup as we don't get on our servers for other clients.
Also we are currently still on Laraval 4.1.

@OAFCROB are you using the file driver or one of the others?  With the file driver, it at least previously did not lock the file for reads/writes so a simultaneous read/write could occur and corrupt the session file thus killing the session.  That bug only existed in the file driver though so we switched to using the DB driver for our apps.  (I haven't checked to see if that is fixed in 5.1 or not.)
@taylorotwell The actual use case that I had a problem with was session variables.  We store variables in the session for search/sort order of our reports.  These variables are only stored per session (rather than in persistent storage) and are set with separate AJAX calls.  The issues cropped up when we created a button that would restore certain saved searches (ie sort by price and search for "widgets") because sometimes only one of the two would get saved in the session.  These was caused by the bug mentioned above.  Presumably we could have combined those two calls into one request to prevent the bug, but theoretically if the server was having a slow moment, a person could have typed a search and immediately clicked out of that box (causing a save) onto a sort (causing another save) and created the same bug so we implemented a bunch of javascript locking on those saves client side to make sure it sent all the variable saves syncronously rather than asyncronously.

@loren138 we're using file, but I'm convinced the issue is to do with the fact the servers are being load balanced compared to our servers where we don't. It appears that the user is being logged out at some point meaning some information is lost resulting in a redirect to the login page.
If I can replicate this session issue I could implement https://github.com/rairlie/laravel-locking-session but at the moment I would be implementing it with no real idea if that's going to resolve the issue.

@OAFCROB Are you sharing the session files between the load balanced servers on some central file share or are your load balanced sessions "sticky" (ie a person always goes to server 2 where their session file is)?  For the session file to corrupt, you have to have requests hit at the exact right moment such that a request opens the session file while another request is saving it (very hard to reproduce, but perhaps more likely in a file share senario since it would take longer to read/save the file?).   I think that package would fix your problem (while also potentially slowing down requests).  If you can, I think using one of the other session drivers would also solve your problem.

@loren138 yes we're aware of that, but the client are hosting the app themselves and will not give us anymore information other than there is load balancing. I guess we could try the package or changing to the database method and if the issue continues then it will be down to their server setup and not the code.

@loren138 I am only concerned around corruption. Not having session locks means you have to build your app in such a way that session holds as little state as possible. I actually just removed session locking all together from an old CodeIgniter project and it seems to behave just fine. I don't store anything time sensitive in my session (in fact my goal is to only store user authentication state in session).
As long as I am not getting failure/corruption when I retrieve session data, I am happy (I use memcached or Redis).
To @taylorotwell point, I agree that if you are concerned with race conditions, you may want to look at other solutions since sessions may not be the right fit.

@OAFCROB We've been experiencing the issues on Laravel 5.2 when using http://flowjs.github.io/ng-flow/. Uploads (concurrent xhr requests) more or less always resulted in session overwrites. We've been testing this with file and sql sessions and could replicate for both.
@taylorotwell for sure, it's already on the agenda ....

If it's usefull...
I was experiencing these issues when a I was using php server to serve laravel for others computers on my network for testing porpouses. (php artisan serve --host=x.x.x.x --port=80)
So, I started a apache server and everything worked fine.

I found this, laravel-locking-session.
I tested it and it's working.

Try out https://github.com/AltThree/Locker - Has solved this issue for me.

Having the same issue using database driver, while testing the app on my local machine.

I recently had this issue and the problem may have been a double-bind of the web middleware on a route. You guys should check that. I failed to notice that web was already applied in RouteServiceProvider. After removing 'middleware' => 'web' on my problem routes, this issue went away completely.

@defaye Your solution will surely work but with out authentication.
I also have similar problem with concurrent api calls using laravel authentication. I had to try rairlie/laravel-locking-session and hope this will work.
I hope this would be fixed in the future.. more power to artisans cheers !!
#ilovelaravel

@micoboyet what do you mean without authentication?

Doubling the web middleware causes tons of problems with this on nearly every request (and has nothing to do with authentication since you are still using it once).  This thread, however, is an issue with race conditions which occur on only occasional requests particularly if a several requests are sent in a short timeframe.

@loren138 if I understand you correctly, you're partly answering @micoboyet for me - yes - I implied that after removing the accidental double-bind, my session becomes reliable again and authentication can work. If however you are then going on to dismiss what I've contributed then I am thoroughly confused, as there will be plenty of others who will come here having unwittingly done the same thing as me. And that can happen when you have a mammoth routes file with various groups and child routes set up.

@defaye it's fair that others may have made that mistake. (I've done it.) However, it sounded to me like your answer was saying all or most of us had made the same mistake as you (user error) so I was making it clear that there is a Laravel issue (documented as the first post here) that can cause this as well as a user error.
In summary, I know of two potential solutions to this problem. One the user has accidentally called the session middleware twice (either by calling the web group twice or calling it once and session once or some other way). If not that, then it is likely from Laravel not locking sessions in any way for which Laravel-locking-sessions is a work around. Alternatively, you can store your session data somewhere else or slow down your web calls so they don't overlap.

I'm still facing this same issue with laravel 5.6. None of the solutions here solved it for me. I don't know if i'm the one not implementing them right.
I use laravel for my back-end, but i do not embedded by web files into laravel. It's an external API and so i use the api.php and not web.php to communicate with my laravel.
When i try to perform a multiple file upload of 6 images with filePond JS plugin, which i set to instantly upload, it only inserts 2 or 3 images into my database, but all images uploaded get into my folder directory.
When i tried setting instantUpload to false and tried sending them one at a time with my plugin,  they all get inserted into my database and into my folder directory as well.
IT was until i came across this page before i decoded the problem.
Any solution? I don't seem to know how to implement any of the solutions above and their documentations are not very elaborate too  me.
<input type="file" class="filepond" id="file" name="filepond" multiple data-max-file-size="3MB" data-max-files="6" required>
const inputElement = document.querySelector('#file');

const pond = FilePond.create( inputElement, {
		maxFiles: 6
});
 FilePond.setOptions({
		instantUpload: true,
		allowFileTypeValidation: true,
		acceptedFileTypes: ['image/*'],
		server: {
		url: 'http://localhost/laravel/public/api',
		process: 'url'
			}
});

Same here in Laravel 5.7

When making simultaneous XHR requests, session data may be lost due to concurrent requests updating the session at the same time. This is a known issue. One solution may be reducing the number of requests, or use *session locking *. This allows to lock the session file when used, hence forcing all requests to be executed one after the other. This may slow down your app, but eliminate the potential errors.
Laravel does not include session locking by default. Someone made a Laravel package to add the feature. https://github.com/rairlie/laravel-locking-session
It seems to have worked for me.

Thanks. Works for me.

I think this problem can be reduced if one would not write to the session storage that often.
I am using the database driver, and every request updates the database. Although the session did not change.
For example, if I have an ajax request that takes 1 minute. And I login while the request is running. When the ajax is finished, it will save the session I had before the login.

For anyone following this issue, I've summarize what I believe is the reason session overwrites happen somewhat frequently, and offered some possible solutions: https://github.com/laravel/framework/issues/30996

authors: Ekhvalov GrahamCampbell HansSchouten OAFCROB SidharthRaveendran barryvdh cumuluswebdesign defaye eduardo76 exodusanto geocine harikt ikay007 jienco k1ng440 loren138 matthewlilley micoboyet modestguy msonowal rolandstarke rose1988c rreynier taisph taylorotwell trevorgehman wiseloren zWaR


text:
[5.2] Fix confusion between ArrayAccess and iterability in data_get()

WIP, still have to refine the tests.
A different attempt at #12629.
Much simpler, only fixes data_get(), still fully supporting Collection. And most important, doesn't break the "Arr takes arrays" rule.
Do I have green light for this one?

@mark86092 I'm removing part of the tests you added in #12611, my apologizes :)

As you have noted, the first one was wrong, precisely due to the issue I'm fixing here.
These tests were for the outermost set, which isn't very useful.

What should be tested are the inner sets, especially with the "double asterisk" cases.
To summarize the possible sets with data_get() :

Iterable sets can be: arrays, Collections.
Key-value sets can be: arrays, Collections, ArrayAccess, objects.

$data = collect([
    'users' => collect([
        new ArrayAccess(['first' => 'taylor', 'last' => 'otwell']),
        new ArrayAccess(['first' => 'abigail', 'last' => 'otwell']),
    ]),
    'posts' => collect([
        (object) ['id' => 1, 'title' => 'hello', 'comments' => collect(['foo', 'bar'])]),
        (object) ['id' => 2, 'title' => 'world'],
    ]),
]);

I don't plan to write new tests as I'm too afraid to add clutter.
Still, the PR in its current state fixes erroneous things, and should be good to pick. And if someone is willing to improve the tests, this would be very, very appreciated :)

It's ok. I intentionally put the test. If someone remove the ArrayAccess or enhance the data_get, the test should fail, reminding the fixer.

+1 I like both of the two fix. I'm not sure whether these change will break the API, someone may use ArrayAccess as input?

To what function? Can you please post an example to make sure I understand correctly?

ArrayAccess is still usable everywhere it makes sense.
The only limitation I can think of is that data_get(), when using the new "wildcards" mode, can't crawl in custom classes implementing Traversable. Probably better not going into the rabbit hole.

Can you someone explain what is not possible or broken before and what this fixes?

This part of the code tests if $target can be iterated, in order to satisfy the "*" key. If not, this means there is no match and data_get returns the default value.
Current code says "ok this can be iterated" if $target is an array or an object implementing ArrayAccess. Problem is, ArrayAccess is not at all about object iterability, and testing against it just makes no sense.
The correct interface to test against should have been Traversable. But I'm not sure we should support it, maybe it's better to keep it simple, at least for now, and say "data_get supports wildcards in arrays and collections".

Case in point, if you look at Arr::collapse, it supports:

array of arrays
array of Collections
but it doesn't support array of Traversables

Which coincides with the supported use cases in this PR for data_get.

@vlakoff , IMO, I mean removing the support of ArrayAccess may break the api (although i think it is necessary), someone may use ArrayAccess

I understand your point: an iterable class which extends both ArrayAccess (so it passes the wrong test) and Traversable (so it actually works). But I think the probability of such use cases is very, very low. As more, the "*" feature in data_get is quite recent.
Nonetheless, considering we would support * keys only for arrays and Collections, this is not an issue.

Summarizing from vlakoff answer and this PR

Function
Fix
Reason

Arr::pluck
remove the support of ArrayAccess
Since foreach on $array require the $array to be traversible, ArrayAccess is not generally traversible

data_get
remove the direct support to Arr::accessible objects
When segment is *, we will call Arr::pluck($target), expecting the $target traversible

IMO, this PR fix some of the strange behavior when "*" and ArrayAccess meet together

Basically that's it, just one comment on your "Fix" column: I'm not "removing support", I'm filtering out cases which currently would erroneously be accepted, then lead to breakage ;)

I still have no idea what the purpose of this is... can someone else maybe explain it plainly?

$data = new ArrayAccess([
    'player_1' => ['first' => 'taylor', 'last' => 'otwell'],
    'player_2' => ['first' => 'abigail', 'last' => 'otwell'],
]);
data_get($data, 'player_1.name'); // works
data_get($data, '*.name'); // can't work because $data is not iterable

On a related note, just to point out these detailed explanations about foreach by Nikita Popov on stackoverflow.

authors: mark86092 taylorotwell vlakoff


text:
Missing Terminate method in  Illuminate\Contracts\Foundation\Application

As we noticed with @joanlopez
In the __constructor method of the class Illuminate\Foundation\Console\Kernel we inject an \Illuminate\Contracts\Foundation\Application.
Then in the line 149, we call the $this->app->terminate() but this is not defined in the interface. So, if someone need to change this implementation and forget to implement the terminate() method, this would crash.
Thanks ;)

Thanks for the heads up. Please feel free to send a PR to master, and Taylor will review it. :)


text:
[5.6] Fix Filesystem download non-ASCII fielname (#2703) (#2305)

Fixed #2703 #2305
// Will be throw InvalidArgumentException: The filename fallback must only contain ASCII characters.
Storage::disk('public')->download('file.txt', 'non-ascii_中文.txt');

This PR also fixed 5.5, 5.7 branch.

I prefer the user to have control of this before they pass it.

The problem with the current download method is that there is no way to download a file with a name containing any UTF-8 characters.
Ideally we would be able to pass a name with UTF-8 characters for browsers with support and an ASCII fallback for browsers without.
Though this pull request does implement the same solution as ResponseFactory, where UTF-8 filenames work: https://github.com/laravel/framework/blob/5.7/src/Illuminate/Routing/ResponseFactory.php#L159

authors: consatan rogeriodomingos taylorotwell


text:
[7.x] Corrected the session store's pull function docblock

The docblock for the pull function in the Session\Store class is currently incorrect, and is causing psalm static analysis to throw an error.
The type for $default should be mixed, as it is on the get method.
This has also been reported here, along with the steps needed to reproduce: #33626

Thanks. :)

authors: GrahamCampbell ellgreen


text:
[8.x] Add loadAggregate() and load[min(), max(), sum() & avg()] methods to …

This PR adds the following methods to the Eloquent/{Collection, Model} which were missing in PR #34965:
    //Eloquent/Collection

    public function loadAggregate($relations, $column, $function = null) {...}
    public function loadCount($relations) {...} //Just modified.
    public function loadMax($relations, $column)  {...}
    public function loadMin($relations, $column)  {...}
    public function loadSum($relations, $column)  {...}
    public function loadAvg($relations, $column)  {...}

And
    //Eloquent/Model

    public function loadAggregate($relations, $column, $function = null) {...}
    public function loadCount($relations) {...} //Just modified.
    public function loadMax($relations, $column) {...}
    public function loadMin($relations, $column) {...}
    public function loadSum($relations, $column) {...}
    public function loadAvg($relations, $column) {...}

    public function loadMorphAggregate($relation, $relations, $column, $function = null) {...}
    public function loadMorphCount($relation, $relations) {...} //Just modified.
    public function loadMorphMax($relation, $relations, $column) {...}
    public function loadMorphMin($relation, $relations, $column) {...}
    public function loadMorphSum($relation, $relations, $column) {...}
    public function loadMorphAvg($relation, $relations, $column) {...}

Will it be possible to load multiple relations at once? Maybe even with constraints? Such as:
$orders->loadSum([
   'orderItems.price as original_total_cost',
   'orderItems.weight as shipping_weight',
   'orderItems.price as total_refunded' => function($query) {
      $query->where('is_refunded', true);
   },
])

@dbakan Yes, it is possible. Just you forgot to specify the second argument (the $column).

@khalilst I specified different columns intentionally as part of the array keys: orderItems.price vs orderItems.weight.

@taylorotwell  @dbakan  I found the problem raised from line 385 at QueriesRelationships.php.
It was not in this PR, I think it was from code modifications/optimizations have done after merging by @sebastiaanluca.
I corrected this line and commit to open related PR #35029.

@dbakan  It needs to change the source withAggregate() method in QueriesRelationships and I think it is a good idea to apply those changes in another PR after confirmation by @taylorotwell .

@khalilst I'd be happy to help with those changes.

@khalilst This is an approach I've been working on lately: https://github.com/dbakan/aggregate
It supports the dot syntax, mixed constraints and some more. It's still work in progress and it might have conflicts with the latest 8.x... but personally, I prefer:
Order::withSum('products.price as total');
// over
Order::withSum('products as total', 'price');

And I think this would be more flexible, e.g. mix aggregates:
Order::withAggregate([
    'products as products_count' => 'count',
    'products.deleted_at AS deleted_count' => 'count',
    'products.quantity as total_items' => 'sum', // using sum() here now!
    'products.price as special_aggregate' => function($query) {
        // write more complex aggregates:
        $query->select(\DB::raw('SUM(product_orders.quantity*product_orders.price)'));
    },
    'products.discount' => 'MAX',
    'products.quantity as quantity_list' => 'group_concat', // (I am working on JSON_ARRAY_AGGR too)
]);

What do you think @khalilst  @taylorotwell ?

@dbakan I disagree with all respect.
IMO, it pushes towards Raw SQL, instead of PHP.
If I was there to make withCount(), I prefer to use this:
Model::withCount($relations, $alias)

instead of
Medel::withCount('relation as alias');

But if others and @taylorotwell have your idea I will make another PR for these changes with your help.

IMO, it pushes towards Raw SQL, instead of PHP.

@khalilst  Yes, this may be true.
I just liked the idea of supporting multiple aggregates over different columns like:
Model::loadSum(
   'relation.price AS total_cost',
   'relation.weight AS total_weight',
   ...
);

And doing it in a single query just like withCount. But maybe it's just me.

authors: dbakan khalilst


text:
Disable indexing for paste detail page

Pastes shouldn't be indexed in Google.
See https://laravel.io/forum/pastebin-and-google

@driesvints the link is not working..

Hmm seems like the thread was removed. Problem atm is that the pastes get indexed by google so we should update the robots.txt file to don't crawl the pastes, only the main landing page.

authors: bvipul driesvints

repo: laravelio/pastebin


text:
How to disambiguate between keywords and tokens

Given the following grammar:
start: "foo"     -> foo
     | CNAME     -> var
%import common.CNAME
%ignore " "

I would expect Lark(grammar).parse('foo') to return Tree(foo, []) and not Tree(cname, [Token(CNAME, 'foo')]) but I get one or the other in a seemingly random way.
I wasn't sure if this is a bug or the expected behavior, since both are correct, but while googling the issue, I found this SO question where the answer seems to indicate that lark should always return what I expect.
I'm on python 3.6 and I have tried this with lark-parser master and 0.5.6.

As you said, they're both legal interpretations of your grammar.
Ideally, you should always get one over the other. The inconsistency is a known bug, which we're actively working to fix.
Right now, I can suggest 3 possible solutions:

Use rule weights to ensure one if chosen over the other (syntax rule.weight: ...)
Use the ambiguity="explicit" switch to see all possible derivations, and choose the correct one automatically.
Switch to LALR(1), which will always match "foo" over CNAME by default.

If you can get away with 3, that's probably your best pick. But 1 & 2 are imho the easiest if you're new to writing grammars.
Hopefully we'll get the fix up and running in the next few weeks (it's a complete re-write of the algorithm).

authors: erezsh gdetrez

repo: lark-parser/lark


text:
feat(gui):  show default value from code and documentation in selection view

Closes #902
Summary of Changes
See Issue.
Screenshots (if necessary)
JSON File of API - data:

Result in API-Eidtor:

Testing Instructions

Load your api-data in the api-editor
Look after the default values

Changes were applied.

repo: lars-reimann/api-editor


text:
WDYA - SICF adminstration service

Automatically create SICF service when deserializing?
https://github.com/techaware/wdalv_config
can be used for testing

nevermind, these should be added separately

repo: larshp/abapGit


text:
show warning at database change when doing pull

when columns are removed
when column data type is changed

in both cases it is possible to loose data from the table

One of the few occasions when a resumeable exception could really make sense

Pull request #458

authors: EduardoCopat larshp mrsimpson


text:
same 100 labeled samples

Hi I want to make sure I understand your description of the dataset. The words you used "We used a batch size of 200 with half of the batch always being the 100 labeled samples". I take it to mean there are a total of 100 labeled samples in all batches. So the same labeled samples are used repeated in each batch.
Alternatively, do you mean in each batch of 200, 100 of them are labeled, and are different from the labeled samples from every other batch?
Its a critical difference whether you truly got these results with a total of 100 labeled samples spread throughout 10 classes. That would be just 10 samples per class.

Hi @bhomass. Thank you for the interest in the repo. There is only 100 labeled samples, representing 10 samples from each class. These 100 samples are used repeatedly in each batch to ensure that every update contains all of the labeled information available.

authors: bhomass larsmaaloee


text:
Pipe method signature prevents changing the Stream effect type

Hello! I have a requirement to use fs2-aws-s3 within a tracing context. We are using trace4cats and thus our effect type is Kleisli[F, Span[F], *. For most of our use cases, changing to this effect type has been either built in or easy to add. For fs2, we have the option of using the translate method. However, because the public API for fs2-aws-s3 has a method signature of Pipe[F, Byte, ETag] for the methods of uploadFile and uploadFileMultipart, we cannot apply the translate method and thus cannot easily change the effect type.
A few options would be:

add similar methods that return a Stream
add a new s3 object called s3Streams (or similar) with these methods using shared logic
Add an effect translation method, (i.e. mapK)

With any of these options a new effect type can easily be applied for all methods.
Happy to make a PR with whichever option is decided by the maintainers. Thanks for your time.

Hey, sorry for late response.
What option are you personally inclined to? i like option 3

I agree with #3, and made a PR: #737..

@jarrodcodes thanks again for the contribution, should we close the issue now?

Yes, thank you!

authors: jarrodcodes semenodm


text:
Fails to build with clang on Windows

My command:
conan install .. -s compiler=clang -s compiler.version=3.8 -s compiler.libcxx=libstdc++ --build=missing
The error:
Building C object CMakeFiles/cmTC_8f4f4.dir/testCCompiler.c.obj

  C:\PROGRA~1\LLVM\bin\clang.exe /nologo /DWIN32 /D_WINDOWS /W3 /D_DEBUG /MDd
  /Zi /Ob0 /Od /RTC1 /FoCMakeFiles\cmTC_8f4f4.dir\testCCompiler.c.obj
  /FdCMakeFiles\cmTC_8f4f4.dir/ -c
  C:\Users\Max\.conan\data\zlib\1.2.8\lasote\stable\build\4d7ea4364a9f5fb56befdb75ec3251fb7ecb3260\_build\CMakeFiles\CMakeTmp\testCCompiler.c

  clang.exe: error: no such file or directory: '/nologo'

  clang.exe: error: no such file or directory: '/DWIN32'

  clang.exe: error: no such file or directory: '/D_WINDOWS'

  clang.exe: error: no such file or directory: '/W3'

  clang.exe: error: no such file or directory: '/D_DEBUG'

  clang.exe: error: no such file or directory: '/MDd'

  clang.exe: error: no such file or directory: '/Zi'

  clang.exe: error: no such file or directory: '/Ob0'

  clang.exe: error: no such file or directory: '/Od'

  clang.exe: error: no such file or directory: '/RTC1'

  clang.exe: error: no such file or directory:
  '/FoCMakeFiles\cmTC_8f4f4.dir\testCCompiler.c.obj'

  clang.exe: error: no such file or directory:
  '/FdCMakeFiles\cmTC_8f4f4.dir/'

  CMakeFiles\cmTC_8f4f4.dir\build.make:64: recipe for target
  'CMakeFiles/cmTC_8f4f4.dir/testCCompiler.c.obj' failed

It looks like the script uses Visual Studio options in Windows regardless of the specified compiler, but I'm not sure how I can fix it.

I don't know the procedure to compile it with Clang in windows. If you can write me here the commands to execute I can incorporate them in the recipe.

The problem is that CMake on Windows expect clang-cl to be a compiler, but it is initialized with clang and clang++, which require different syntax.
The following commands do work, for a 64 bit install (for a 32 bit version, a few settings have to be changed):
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" x64

set CC=clang-cl
set CXX=clang-cl
set CFLAGS=-m64 -fmsc-version=1910
set CXXFLAGS=-m64 -fmsc-version=1910
set CONAN_CMAKE_GENERATOR=Ninja

and now execute conan install

This issue was moved to conan-community/community#63

authors: M-Pixel SSE4 dutow lasote

repo: lasote/conan-zlib


text:
wechat support

share: open a page directly
choose image: upload
geo: alert and input

@last-hit-aab, maybe we should support fb first?

@last-hit-b , wechat first, according to the market.

@last-hit-aab , got it. will put into task pool.

@last-hit-aab, done. geo is pending since no way to input latitude and longitude

authors: last-hit-aab last-hit-b

repo: last-hit-aab/last-hit


text:
Consider using https://github.com/cfware/babel-plugin-bare-import-rewrite

Instead of using my own bare import rewriter, consider this one: https://github.com/cfware/babel-plugin-bare-import-rewrite
One issue is that I won't easily be able to add the module versions of the special dependencies that I've created module versions of

I considered it, I believe I even tried it, and it wasn't a good experience. Sticking with my own implementation until it melts away in lieue of import maps

repo: lastmjs/zwitterion


text:
Timestamp calculations break when you trim the start of a clip

Apple Feedback Assistant ID: FB12043900
THE PROBLEM:
Currently there’s no way in FxPlug4 to determine the timecode or frame number of a source clip. For example, if you’re making an Effect/FxFilter, there’s no way to get the timecode or frame number of the media asset that the Effect/FxFilter has been applied to.
WHY THIS MATTERS:
Gyroflow Toolbox is a Mac Store Application that allows you to apply gyroscope-based stabilisation to video footage that contains gyroscope metadata. Currently you should only ever apply the Gyroflow Toolbox effect to an entire clip - the clip cannot be trimmed. Due to limitations in Final Cut Pro's FxPlug4 API - we currently can't determine the source start timecode of a clip. Because of this, the Gyroflow Toolbox effect should only be applied to a clip where the start of the clip hasn't been trimmed in the timeline (i.e. the clip you have in the timeline should show the first frame of the source clip). If you need to trim the start of this clip, you can use the full clip within a Compound Clip, then trim the Compound Clip as required.
WHAT NEEDS TO CHANGE:
Ideally, there should be some new methods added to FxTimingAPI_v4 so that we can access the current timecode of the source clip, but also a frame number for connivence. For example, if we have a ProRes File that starts at 01:00:00:00, if we apply our Effect/FxFilter to that ProRes File within Final Cut Pro, for the first frame of the video, we should be able to use FxPlug4 to return the CMTime equivalent of 01:00:00:00, but also frame 0. This would allow Gyroflow Toolbox to be applied like a normal effect, rather than having to contain it within a container clip, like a Compound Clip.

ORIGINAL POST:
The timestamp calculations are incorrect. Doh!
Currently it's determining that the first frame of the clip in the timeline is frame 0 - wrongly assuming that the first frame of the clip in the timeline, is actually the first frame of the source clip (i.e. it doesn't take into account the clip may have a trimmed start in the timeline).
We can get the current source timecode in CMTime from the renderTime. For example, I can get the source timecode value:

...however, I'm not really sure how I can convert this back into a frame count for Gyroflow.
My only thought is maybe we just pass the source timecode across to Gyroflow, and do the timestamp maths in Rust-land, as Gyroflow should know the start timecode?
As far as I can tell, there's no way in FxPlug4 to get anything other than:

...which I don't think is helpful.
I got excited about startTimeOfInputToFilter - but that only returns the timecode of the start of the clip as it appears in the timeline, and we really need the start timecode of the source clip itself.
Understanding Time in FxPlug
https://developer.apple.com/documentation/professional_video_applications/fxplug/understanding_time_in_fxplug?language=objc

@AdrianEddy writes on Discord:

FWIW Gyroflow doesn't know anything about timecode, it just uses microseconds from the video start

My reply:

Ah, right. I’m not sure of the fix then off the top of my head. I can only really get the source start timecode of where the clip starts in the timeline, duration of the clip as it appears in the timeline, the source timecode of current frame that’s being rendered of the clip, and all the timeline timecode. I can’t think of a way to use this information to determine microseconds from the video start. Annoyingly, FxPlug4 doesn’t provide any other information about the source clip AFAIK.
Unless I’m missing something obvious, I think I might have to just leave this as a documented limitation - where users will need to apply Gyroflow Toolbox to the entire clip, and create a compound clip if they want to use a section of that clip, or add something to gyroflow_core or my own Rust code to determine the clips start timecode value.

Apple says:

Regarding the timing question, there is no mechanism for a 3rd party FxPlug to retrieve the actual source TC of an FCP clip. If that could be of use to you, and there is no way around your issue using Workflow Extensions, then it probably also deserves an enhancement request.

That sounds like deserving an enhancement request haha!

FWIW - One potential idea is to just add an "start offset" slider to the Final Cut Pro Inspector, so that you can offset the start by a certain number of frames - but I think this would be more annoying for the end user than just compound clipping the clip first.

What about selecting clip in browser, go to “clip” menu -> “open clip” and applying the ?
Idon’t know much about dev, but I know in FCP, every clip is already a compound 🧐

That's definitely possible in some cases, yes. You just have to remember that each "clip" is it's own instance, so for example, if you apply the Gyroflow Toolbox effect to a clip in the Browser, then you import that clip into your Timeline, if you adjust the Gyroflow Toolbox settings of the clip in the timeline, they won't affect the Gyroflow Toolbox settings in the Browser. So generally speaking... compound clips are easier.

Following

repo: latenitefilms/GyroflowToolbox


text:
\normalcolor is made fragile again

As a result it breaks in places such as
\DeclareEmphSequence{\itshape,\emforce\color{blue},\bfseries,\color{black}\scshape}

Not unlikely that some other document commands would also need to be \protected

I have uploaded a new version which makes all commands that are \protected in color.sty also \protected in xcolor.

authors: FrankMittelbach u-fischer


text:
change listen example to be a chat app

Closes #161
The Postgres listen example is now a simple chat app.

This is great! Can you rename the directory to chat and rebase on top of 0.7-dev?

repo: launchbadge/sqlx


text:
Added support fetching (pg) enums that are not in the public schema

Does your PR solve an issue?
This PR allow fetching postgres enums which are not in a public schema.
This has already been fixed in both these places https://github.com/launchbadge/sqlx/pull/2638 and https://github.com/launchbadge/sqlx/pull/2791, but this PR extracts the schema-type qualification patch.

@joseph-isaacs this PR is still a draft after 2 weeks. Do you intend to finish it?

authors: abonander joseph-isaacs


text:
Process - Title, Line and Body Copy Spacing

Check spacing between the title, line and body copy so that its even in the timeline.

Updated...

authors: aldidas dickyabd

repo: laurengerardi/LiveResin


text:
Use Map to navigate

Hi, when i have an Timeline-Map (like in: https://laurens94.github.io/vue-timeline-chart/examples/synced-timelines.html)
How can I make it so that a user can grab the map group to navigate in the timeline?

Hi!
It's now possible (since v2.2.0) by using the pointermove event.
I modified the example at https://laurens94.github.io/vue-timeline-chart/examples/synced-timelines.html so you can see how it's done.
Please let me know if this works for you! 😄

Thank you very much!


text:
Error when running google colab

Describe the bug
When simply running all fields one for one in the google colab I get the following:
NoSuchDriverException                     Traceback (most recent call last)
 in <cell line: 40>()
38
39 # Choose Chrome Browser
---> 40 driver = webdriver.Chrome(service=webdriver_service, options=chrome_options)
41
42 # action_engine = ActionEngine(llm, embedder)
2 frames
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/common/driver_finder.py in get_path(service, options)
42
43         if path is None or not Path(path).is_file():
---> 44             raise NoSuchDriverException(f"Unable to locate or obtain driver for {options.capabilities['browserName']}")
45
46         return path
NoSuchDriverException: Message: Unable to locate or obtain driver for chrome; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location
I was able to fix it by removing the service from the initialization so instead of # Choose Chrome Browser
driver = webdriver.Chrome(service=webdriver_service, options=chrome_options) I did driver = webdriver.Chrome( options=chrome_options)

import os.path
homedir = os.path.expanduser("~")
chrome_options.binary_location = f"/content/chrome-linux64/chrome"
webdriver_service = Service(f"/content/chromedriver-linux64/chromedriver")
print('hii',webdriver_service)
print('hello',chrome_options.binary_location)
use this path

Sorry guys my bad for that. It should be fixed with the recent commit.

repo: lavague-ai/LaVague


text:
Build in Unity 5.3.0 to Windows

Confirm minimum version

Implent Test Runner #21

repo: lavaleak/diplomata-unity


text:
feat: kyve spec, mainnet and testnet

Description
Added Spec for Kyve, mainnet and testnet

Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...

[x] read the contribution guide

[x] included the correct type prefix in the PR title, you can find examples of the prefixes below:

[ ] confirmed ! in the type prefix if API or client breaking change

[x] targeted the main branch

[ ] provided a link to the relevant issue or specification

[x] reviewed "Files changed" and left comments if necessary

[ ] included the necessary unit and integration tests

[x] updated the relevant documentation or specification, including comments for documenting Go code

[x] confirmed all CI checks have passed

Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...

[ ] confirmed the correct type prefix in the PR title
[ ] confirmed all author checklist items have been addressed
[ ] reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

New Features

Added new specifications for Kyve Mainnet, including block time, stake requirements, API endpoints, and verification details.
Added new specifications for Kyve Testnet, detailing provider types, block configurations, API collections, and verification parameters.

@RuslanGlaznyov we moved all the specs to the lava-config repo
can you open it there under testnet-1?
thanks

authors: RuslanGlaznyov Yaroms

repo: lavanet/lava


text:
CNS-467 panic - prune or document

Review all panic() in x/* and either -

replace with critical error utils.LavaFormatError("critical: ...", ...)
approve, by adding // panic:ok: ... comment
remove, if irrelevant

(recommended to review commit-by-commit)

thanks for the hard work :)
can you fix the conflicts, ill merge after that

authors: Yaroms orenl-lava


text:
lavas.config配置路由项，有模式匹配交叉覆盖时，合并内容不对

设置所有页lazyloading, 设置所有user/info页keepalive
现象：keepalive未生效 ，设置如下

   {
                pattern: /.*/,
                lazyLoading: true,
            }, {
                pattern: /\/user\/info/,
                meta: {
                    keepAlive: true
                },
            },

如果将keepAlive设置放在匹配*的lazyload之前设置就ok

目的：设置所有页lazyloading, 设置所有user子页keepalive ，
现象：所有子页keepalive未生效，设置如下

{
                pattern: /\/user\/.*/,
                meta: {
                    keepAlive: true
                },
            },{
                pattern: /.*/,
                lazyLoading: true,
            },

这个BUG是因为目前 lavas 在合并 router 配置的时候，使用了数组的 find 函数，因此只会找到第一条符合 pattern 的配置进行合并。所以导致了上述两个问题（均是前一条配置生效）
把 find 改成 filter，并进行一些对应的修改就可以解决问题。目前已经发布了 1.1.13 版本修复了这个问题。

authors: aojianwu easonyq

repo: lavas-project/lavas


text:
Client app

UI improvements for demo

merged

authors: ColeDnought TigerCWShaw


text:
Virtualized lists

Created TOCList, which is a consolidated component of rulesTOC.tsx and constitutionTOC.tsx. Used TOCList in pages components: RulesTOC.tsx and ConstitutionTOC.tsx
In TOCList implement virtualised list logic to optimize performance with package Virtuoso
Made IonLists naturally use remaining vertical space with flex
Implement logic to only apply virtualized list on a mobile screen width. Desktop browsers with pretty sound
Delete RuleTOC.tsx and ConstitutionTOC.tsx and refactor other usages to use TOCList instead
apply placeholder ux for large scrolling

Comparison videos:
Demo video with this PR Logic:
switching between tabs is faster
https://user-images.githubusercontent.com/15995210/148218719-c4513ef7-deb0-4586-84e5-af3d6ad6bd02.mp4
Demo of current constitution app on mobile browser without PR logic
I tried to switch between tabs at a semi rapid rate. the my browser crashed
https://user-images.githubusercontent.com/15995210/148218916-8b1c6ad6-0ebc-4117-bc2e-bb2f15c6f61b.mp4

@longhotsummer I'm marking this pr as ready. Its worth chatting through it though. Lmk when you're available to chat

repo: laws-africa/constitution-app-react


text:
Add models and interfaces for meshsync

Created and implemented interfaces and models for meshsync to be used across meshes
Signed-off-by: Nitish Malhotra nitish.malhotra@gmail.com

Tried to abstract a few things:

A meshsync specific MeshInfo object that serves as a common abstraction across all meshes, by which I mean that every mesh should finally be adapted to his meshery-operator native object and it's fields.
An Info() interface which must be implemented by every mesh.

@leecalcote @AdheipSingh @vinayakshnd @kushthedude

A couple conflicts in go.mod and go.sum to have a peek at.

I get the following error when building the project:
✗ make clean
rm -rf bin
go mod tidy
go: meshery-operator/pkg/meshsync/istio imports
        istio.io/istio/pkg/kube imports
        k8s.io/kubectl/pkg/cmd/apply imports
        k8s.io/kubectl/pkg/cmd/util/editor imports
        k8s.io/kubectl/pkg/util/term imports
        github.com/docker/docker/pkg/term imports
        github.com/docker/docker/pkg/term/windows imports
        github.com/Sirupsen/logrus: github.com/Sirupsen/logrus@v1.6.0: parsing go.mod:
        module declares its path as: github.com/sirupsen/logrus
                but was required as: github.com/Sirupsen/logrus
make: *** [clean] Error 1

I get the following error when building the project:
✗ make clean
rm -rf bin
go mod tidy
go: meshery-operator/pkg/meshsync/istio imports
        istio.io/istio/pkg/kube imports
        k8s.io/kubectl/pkg/cmd/apply imports
        k8s.io/kubectl/pkg/cmd/util/editor imports
        k8s.io/kubectl/pkg/util/term imports
        github.com/docker/docker/pkg/term imports
        github.com/docker/docker/pkg/term/windows imports
        github.com/Sirupsen/logrus: github.com/Sirupsen/logrus@v1.6.0: parsing go.mod:
        module declares its path as: github.com/sirupsen/logrus
                but was required as: github.com/Sirupsen/logrus
make: *** [clean] Error 1

Can you delete go.mod and go.sum and retry? I didnt use the Makefile so I mightve missed something. Will give it try later today.

You got it. I deleted go.mod and go.sum. Rerunning make produces the same error. However, running go build cmd/meshsync/main.go successfully builds.

authors: leecalcote nitishm


text:
[UI] Enable sub-links for settings sub-tabs

Description

Right now the URL of the subtabs in settings are distinguished by /settings#name_of_tab which is cause of many bugs right now.
Expected Behavior

Have a anchor sub-URL for each tab like settings/name_of_tab.

Oooh, @Nikhil-Ladha... Calling @Nikhil-Ladha... 😄

Here I am @leecalcote 👀.

Will look into it, over the weekend 😉.

Please @Nikhil-Ladha !

Do we anticipate this issue to be address simultaneously or is its root cause distinct? https://github.com/layer5io/meshery/issues/273

Related to #967

Do we anticipate this issue to be address simultaneously or is its root cause distinct? #273

Not sure, will have to check.

If I may ask @kushthedude , what is the issue with the current anchor? Because the '#name_of_tab' makes sense here, considering these are subparts within a page if we use '/name_of_tab' that indicates a new page adding in the route.

If I am correct, the issue that you are saying are two of them:

On submitting the preferences in the performance tab the page reloads back to the environment tab rather than staying on the same one.

On initial rendering of the settings page, the path is just settings, rather it should be having the '#environment' sub link added to it.

Are these the issues you are talking about?

authors: Nikhil-Ladha kushthedude leecalcote


text:
[mesheryctl] Make 'system reset' context aware

Signed-off-by: navendu-pottekkat navendupottekkat@gmail.com
Description
This PR fixes #2248
Notes for Reviewers
This is a draft PR and is not ready for review.
Signed commits

[x] Yes, I signed my commits.

This is still a WIP do ping me when you're partially or completely done. Or if you need my help. As far as I can see the changes are yet to be implemented

This is still a WIP do ping me when you're partially or completely done. Or if you need my help. As far as I can see the changes are yet to be implemented

@anirudhjain75 @leecalcote Yes, this is a WIP. I still have to implement the fetch from GitHub using the API part. I will try to get it done today.

@anirudhjain75 @leecalcote Yes, this is a WIP. I still have to implement the fetch from GitHub using the API part. I will try to get it done today.

@leecalcote @anirudhjain75 I have made a basic fix for this issue that seem to be working while I tested locally. I still need to setup some error handling for all possible scenarios. But this works and please check it and let me know for any changes.

@leecalcote @anirudhjain75 I have made a basic fix for this issue that seem to be working while I tested locally. I still need to setup some error handling for all possible scenarios. But this works and please check it and let me know for any changes.

@navendu-pottekkat, I don't believe that this was part of the original ask, but will you consider support of the -c flag for temporarily overriding the current context? Support for this at the system level is coming. @anirudhjain75 does any consideration need to be made here in order to support -c as written here - https://github.com/layer5io/meshery/pull/2256/files#diff-3ec6eb99922674fe5326ef77839a41f6e5356441ffebb8501c2196ace27a93aaR71?
I assume not given that the system level support should provide this to all system level commands.

@navendu-pottekkat, I don't believe that this was part of the original ask, but will you consider support of the -c flag for temporarily overriding the current context? Support for this at the system level is coming. @anirudhjain75 does any consideration need to be made here in order to support -c as written here - https://github.com/layer5io/meshery/pull/2256/files#diff-3ec6eb99922674fe5326ef77839a41f6e5356441ffebb8501c2196ace27a93aaR71?
I assume not given that the system level support should provide this to all system level commands.

@navendu-pottekkat, I don't believe that this was part of the original ask, but will you consider support of the -c flag for temporarily overriding the current context? Support for this at the system level is coming. @anirudhjain75 does any consideration need to be made here in order to support -c as written here - https://github.com/layer5io/meshery/pull/2256/files#diff-3ec6eb99922674fe5326ef77839a41f6e5356441ffebb8501c2196ace27a93aaR71?
I assume not given that the system level support should provide this to all system level commands.

I think it is better to raise this as a separate issue and make a new PR

@navendu-pottekkat, I don't believe that this was part of the original ask, but will you consider support of the -c flag for temporarily overriding the current context? Support for this at the system level is coming. @anirudhjain75 does any consideration need to be made here in order to support -c as written here - https://github.com/layer5io/meshery/pull/2256/files#diff-3ec6eb99922674fe5326ef77839a41f6e5356441ffebb8501c2196ace27a93aaR71?
I assume not given that the system level support should provide this to all system level commands.

I think it is better to raise this as a separate issue and make a new PR

@anirudhjain75 @leecalcote I have made the changes to the logs. It looks like this now-
navendu@navendu:~/Code/meshery-dev/meshery/mesheryctl$ ./mesheryctl system reset
Meshery resetting...

Current Context: local
Channel: stable
Version: v0.4.20

Fetching default docker-compose file at version: v0.4.20...

...Meshery config (/home/navendu/.meshery/meshery.yaml) now reset to default settings.

Overriding the context using the -c flag can be made into another issue and a separate PR can be made.
@anirudhjain75 Please review and merge this PR.

@anirudhjain75 @leecalcote I have made the changes to the logs. It looks like this now-
navendu@navendu:~/Code/meshery-dev/meshery/mesheryctl$ ./mesheryctl system reset
Meshery resetting...

Current Context: local
Channel: stable
Version: v0.4.20

Fetching default docker-compose file at version: v0.4.20...

...Meshery config (/home/navendu/.meshery/meshery.yaml) now reset to default settings.

Overriding the context using the -c flag can be made into another issue and a separate PR can be made.
@anirudhjain75 Please review and merge this PR.

instead of default settings - can we print currVersion ? or default settings of currVersion?

We are actually printing the version. Here v0.4.20 is the version.
Fetching default docker-compose file at version: v0.4.20...

...Meshery config (/home/navendu/.meshery/meshery.yaml) now reset to default settings.

instead of default settings - can we print currVersion ? or default settings of currVersion?

We are actually printing the version. Here v0.4.20 is the version.
Fetching default docker-compose file at version: v0.4.20...

...Meshery config (/home/navendu/.meshery/meshery.yaml) now reset to default settings.

@navendu-pottekkat, I don't believe that this was part of the original ask, but will you consider support of the -c flag for temporarily overriding the current context? Support for this at the system level is coming. @anirudhjain75 does any consideration need to be made here in order to support -c as written here - https://github.com/layer5io/meshery/pull/2256/files#diff-3ec6eb99922674fe5326ef77839a41f6e5356441ffebb8501c2196ace27a93aaR71?
I assume not given that the system level support should provide this to all system level commands.

I think it is better to raise this as a separate issue and make a new PR

Sounds real good. Let's do a new issue/PR.

@navendu-pottekkat, I don't believe that this was part of the original ask, but will you consider support of the -c flag for temporarily overriding the current context? Support for this at the system level is coming. @anirudhjain75 does any consideration need to be made here in order to support -c as written here - https://github.com/layer5io/meshery/pull/2256/files#diff-3ec6eb99922674fe5326ef77839a41f6e5356441ffebb8501c2196ace27a93aaR71?
I assume not given that the system level support should provide this to all system level commands.

I think it is better to raise this as a separate issue and make a new PR

Sounds real good. Let's do a new issue/PR.


text:
How can I use simulation options?

I need to use newly downloaded mp3 file filename as argument in my project. For example how can I print out output filename or/and title?
With youtube-dl I can do something like this:
filename =  `youtube-dl --get-filename -o  '#{folder}%(title)s.mp3' -s -x --audio-format 'mp3'   #{url}`

Not nicest thing to do but it works. :)
How can I do it youtube-dl.rb?

Initialize your own YoutubeDL::Runner.
require 'youtube-dl.rb'

runner = YoutubeDL::Runner.new(url)
runner.options.configure do |c|
  c.get_filename = true
  c.output = "#{folder}%(title)s.mp3"
  c.simulate = true
  c.extract_audio = true
  c.audio_format = 'mp3'
end

filename = runner.run.chomp

authors: SvHu sapslaj