feat(meta): structure and content of execution-level differences

⚠ This issue is a WIP, and the proposed section layout is not yet complete
This is a tracking issue, and will link out to specific issues below
Overview
For the MVP, the only two sections added were:

Metadata: Includes basic chain info like Chain ID, name, RPC URLs, and block explorers
Precompiles and Predeploys: All precompiles and predeploys on that chain (predeploys are smart contracts placed at an address)

There is a lot more info that needs to be added, and it needs some thought around the best way to structure it.
The scope of the diff should be "things a smart contract developer or app developer needs to care about". For the most part, this means the diff is primarily an execution layer diff, as contract/app devs don't usually need to worry about consensus layer details. There are exceptions here, e.g. it's easier to manipulate TWAPs in PoS compared to PoW because an attacker knows when they'll be the block proposer for consecutive blocks. Things like this should be included.
Additionally, data should be for the current hard fork for a given chain. For simplicity, changes between hard forks or upcoming changes expected in future hard forks are not considered. It would be great to show these in the future, but for now the plan it to keep it simple and do one thing—diff current EVM specs—really well.
Proposed Sections
A first pass at section definitions is below. Each section concludes with a summary bullet with a status level and open questions.
In terms of implementation, always start by implementing Ethereum mainnet's spec first, and other chains' specs can import/modify that.
All sections should include references. Lean towards including too many vs. too few, so things are easy to validate.

Opcodes: This is ready to be implemented and is tracked in https://github.com/mds1/evm-diff/issues/6
Precompiles and Predeploys: This is partially implemented and needs to be finished. It's being tracked in https://github.com/mds1/evm-diff/issues/3
Transaction Types

The EVM has types 0 (original), 1 (access lists), and 2 (EIP-1559)
L2s have some special transaction types
Chains that don't support 1559 don't have type 2 (and presumably don't have type 1 either).
Summary: This is a small section, seems like a nicely scoped small one, but maybe worth combining with another?

Account Types

Ethereum has two types of accounts: EOAs with no code, and contract accounts with code.
Some chains like zkSync have native account abstraction
Summary: for the initial set of chains here (arbitrum and optimism) both match mainnet, so this should be easy to implement. It's worth considering zkSync while implementing to ensure we have a good data structure in place

Hashes, Address Computation, and Proofs

Some chains like zkSync and other zkEVMs compute addresses differently and/or use hash functions that are not keccak256. As a result, CREATE and/or CREATE2 addresses can differ between chains
Different block structures or state representations can result in different merkle proofs for the same data
Summary: This feels like there's some broader category it fits it but I'm not sure what. Maybe it should be merged with "Account Types" into a "Miscellaneous" category?

Gas

Opcode gas costs are in the opcode section, but differences should be listed here (e.g. can import the opcode definitions then reshape them, so opcodes implementation is a prerequisite for this section)
Other differences to consider are things like memory expansion cost, SSTORE rules, access lists, refunds. This and this are good references for mainnet gas costs.
Additionally, L2s post calldata on L1 which should be accounted for
Comparison of EIP-1559 parameters, since they can be adjusted
Maybe can show estimated transaction costs using something like https://l2fees.info/
Summary: I think the above list covers everything

JSON-RPC

List of all standard execution-related methods and their interfaces, along with chain-specific methods.
Differences in trace formats between nodes with e.g. debug_traceTransaction, structLog and callTracer, etc.
Summary: This one should be straightforward, but maybe the info is hard to find? Maybe should included consensus RPCs here too

Mempools

Private mempool URLs e.g. flashbots
Summary: Seems like a small, well scoped section that can be started

Nodes

Just a list of all node implementations with links to their github repos and docs
Summary: Seems like a small, well scoped section that can be started

Block production

Consensus mechanism
Block time
Gas limit
Finality definitions / reorg risks
Censorship / trust assumptions on e.g. sequencers. Maybe can outsource / link to L2Beat here since I think they have a lot of data around this
Summary: Seems like a small, well scoped section that can be started

EIPs

Sometimes EIPs are not the most dev-friendly, and EIP categories cover a wide range, so we don't want to rely on this section exclusively, but it should exist to serve as a catch-all and therefore it may duplicate some information.
This can basically just be a list of EIP numbers (or e.g. BEP or whatever the chain calls them) along with a boolean of whether or not it's finalized and another boolean for whether or not it's active, along with a link to that EIP, and the hardfork at which the EIP became active.

The "finalized" booleans will all be true for now, but is mainly just to future proof the interface a bit for if/when "upcoming, CFI'd EIPs" shown. Similarly the "active" booleans will all be true for now, but they may become false in the future.
Some EIPs are finalized and were active, but are now irrelevant as other EIPs have replaced them. These can be ignored as they don't provide useful information for devs.
Other EIPs may be final and not yet active, since they'll be in a future hard fork. These can also be ignored for now.
I don't know of an existing list that contains this information, but for mainnet EIPs, the Core and Interface EIPs in the "Final" state should serve as an upper bound on the number of EIPs. Trail of Bits' Building Secure Smart Contracts has a Forks <> EIPs section which should be helpful. (They have this for Celo, Tron, and BSC also)

Summary: This is straightforward, seems ready to move forward on implementation with. The hardest part will be coming up with the list. One challenge is that some chains will implement the same EIPs but with different parameters, e.g. Optimism implements EIP-1559 with different parameters than mainnet. These differences should be noted

References

https://community.optimism.io/docs/developers/bedrock/how-is-bedrock-different/
https://developer.arbitrum.io/arbitrum-ethereum-differences
Others linked above

Some further thoughts:

I love the playground feature from https://www.evm.codes/playground: it would be a nice feature to be able to simulate the differences at opcode or Solidity level, for example.  Let me make a simple example: you have a contract compiled with solc version 0.8.20 and default EVM version shanghai. You copy-paste the contract into the playground, select "Optimism<>Ethereum diff" and press run. It will deploy on Ethereum but not on Optimism yet due to PUSH0. Diffs are very powerful on a documentation level, but many times you also want to understand the engineering implications. Thus, we should also think about how to integrate this best into the UI.
Another important diff to understand is account types (e.g. EOA vs native account abstraction (such as zkSync has)).
Also, I feel like there must be a section on the trust assumptions and differences across the different implementations. E.g. Optimism or Arbitrum are running centralised sequencers while on Ethereum anyone can participate in block producing as long as you stake 32 eth.

Looking forward to evmdiff, this is a great start for some em-standardization! Even if only research, but maybe also like https://caniuse.com/ that lists all browser differences.
And +1 on showing transaction types and precompiles. It always surprises me how many extra tx types and precompiles some EVM chains, even L2s have.
And fwiw: Optimism has no custom precompiles, and only 1 extra tx type that is equivalent to EIP-1559 but without signature, for deposits from L1. And happy to answer any questions about the Optimism diff / link any useful specs.

Thanks @protolambda, appreciate all that! 🙌
And good call on the similarities with caniuse, haven't used it in a while so will check it out for any good ideas

Some small requests:

Separate predeploys and precompiles. The nice thing about predeploys is that external EVM tools can easily import the bytecode and support them, whereas precompiles require deeper modifications.
Show full predeploy/precompile address on hover, or expand it on clicking, it would be handy to copy.
compute the similarity between the two sides of text. If the text is > 80% the same, maybe highlight the differences. It's hard to find subtle changes currently.


CL: frontend swap estimates support

Background
The issue track the support for the FE to integrate swap estimates into CL. Made for tracking purposes
Acceptance Criteria

Swap estimates work on frontend

Opened more specific issues around this


Update CHANGELOG.md

This changelog update is for the PR "Update utils.py #1399" which closes the issue #1384

Checklist

[ ] No CHANGELOG update needed

[x] No new tests needed

[ ] No documentation update needed

please add the changelog updates to #1399 instead of opening a separate PR.


Consider react-devtools plain shell?

Given that there are issues with the chrome devtools extension and electron (https://github.com/atom/electron/issues/915), perhaps it's worth considering the plain version? https://github.com/facebook/react-devtools/tree/master/shells/plain

Quite Interesting. Would you want to give it a try?

Had a quick play around with this. It's not so easy because of the fact it uses an iFrame so it can't be easily integrated like the redux devtool component. You could do it with a react-devtool-container-app.html file which has an iframe pointing at hot-dev-app.html.
I'm not very fond of this approach though because my app is multi-window and it starts to get unwieldy very quickly if you want to have the devtools available on multiple windows.
Might give this another try in the future but I'm going to leave it for now.

I looked through the source for this, and I don't think it would be too hard to modify what's there to create a new "shell/electron" based on what the shells/plain does.  Instead of postmessage api usage, you could use the ipc module, and instead of an iframe, you could use a  tag.
I might give this a shot.

https://github.com/electron/electron/releases/tag/v1.2.1 fixed support for DevTools Extensions, so we can close this now.


Make maker/taker HTTP api contract symbol aware

Note: this is a breaking change of the HTTP Api. We will need to update auto-taker to be able to deal with this.
Resolves #2460
Resolves #2461
Resolves #2462

@luckysori : I rebased and force pushed. Sorry that you have to go through this again.

dprint is having a laugh: https://github.com/itchysats/itchysats/runs/7684277964?check_suite_focus=true#step:3:27.

bors r+


[Feature]: Swagger API docs

What happened?
Use PHP Swagger API docs generator with https://github.com/DarkaOnLine/L5-Swagger and https://github.com/zircote/swagger-php to add these codeblocks to the stubs.
use OpenApi\Attributes as OA;

#[OA\Info(
    title:"API Documentation",
    version: "0.1",
    contact: new OA\Contact(name: "", email: "")
)]
#[OA\Server(
    description: "API Server",
    url: "http://localhost:8000/api/"
)]

#[OA\SecurityScheme(
    name: "bearerAuth",
    securityScheme: "bearerAuth",
    type: "http",
    scheme: "bearer",
    description: "Enter JWT Token",
    in: "header"
)]

#[OA\PathParameter(
    name: 'tenant',
    parameter: 'tenant',
    description: 'ID of the tenant',
    schema: new OA\Schema(type: 'integer'),
    required: TENANT_AWARENESS,
    in: "path",
)]

Most of the parameters can be set as custom CONSTANTS when the plugin is configured via config variables in l5-swagger.php
define('TENANT_AWARENESS', config('api-service.tenancy.awareness');
or so...
check if tenancy for resource is enabled set constant per resource in for example the BrandApiService.php

#[OA\Tag(
    name: "Brands",
    description: "API Endpoints of Brands",
)]

class BrandApiService extends ApiService
{

public static function handlers(): array
    {
        if (
            ApiService::isTenancyEnabled() &&
            ApiService::tenancyAwareness() &&
            static::getResource()::isScopedToTenant()
        ) {
            define('TENANT_AWARENESS_BRANDS', true);
        } else {
            define('TENANT_AWARENESS_BRANDS', false);
        }

        $handlers =  [
            Handlers\CreateHandler::class,
            Handlers\UpdateHandler::class,
            Handlers\DeleteHandler::class,
            Handlers\PaginationHandler::class,
            Handlers\DetailHandler::class
        ];

        foreach($handlers as $handler) {
            if(app($handler)->isPublic()) {
                define('RESOURCE_PUBLIC_BRANDS_' . Str::upper(app($handler)->getKebabClassName()), true);
            } else {
                define('RESOURCE_PUBLIC_BRANDS_' . Str::upper(app($handler)->getKebabClassName()), false);
            }
        }

        return $handlers;
    }
}

as an example for the different resource API Handlers.php (CreateHandler.php, UpdateHandler.php etc...) :

use OpenApi\Attributes as OA;

#[OA\Post(
    path: "/admin/" . ((TENANT_AWARENESS_BRANDS) ? "{tenant}/" : "") . "brands",
    operationId: "storeBrand",
    tags: ["Brands"],
    summary: "Store new Brand",
    description: "Returns inserted brand data",
    security: (!RESOURCE_PUBLIC_BRANDS_CREATE) ?  [["bearerAuth" => []]]: null,
    parameters: [
        (TENANT_AWARENESS_BRANDS) ? new OA\Parameter(ref: "#/components/parameters/tenant") : null,
    ],
    requestBody: new OA\RequestBody(
        required: true,
        content: new OA\JsonContent(ref: "#/components/schemas/BrandTransformer/properties/data/items")
    ),
    responses: [
        new OA\Response(response: 200, description: 'Operation succesful', content: new OA\JsonContent(type: "object", properties: [
            new OA\Property(property: "message", type: "string", example: "Successfully Inserted Resource"),
            new OA\Property(property: "data", type: "object", ref: "#/components/schemas/BrandTransformer/properties/data/items")
        ])),
        new OA\Response(response: 400, description: 'Bad Request'),
        new OA\Response(response: 401, description: 'Unauthenticated'),
        new OA\Response(response: 403, description: 'Forbidden'),
        new OA\Response(response: 404, description: 'Resource not Found'),
    ]
)]

and
#[OA\Get(
    path: "/admin/" . ((TENANT_AWARENESS_BRANDS) ? "{tenant}/" : "") . "brands/{id}",
    operationId: "getBrandDetail",
    tags: ["Brands"],
    summary: "Get detail of Brand",
    description: "Returns detail of Brand",
    security: (!RESOURCE_PUBLIC_BRANDS_DETAIL) ?  [["bearerAuth" => []]]: null,
    parameters: [
        (TENANT_AWARENESS_BRANDS) ? new OA\Parameter(ref: "#/components/parameters/tenant") : null,
        new OA\Parameter(
            name: "id",
            description: "Brand ID",
            required: true,
            in: "path",
            schema: new OA\Schema(type: "integer"),
            example: "", // OA\Examples(example="int", value="0", summary="An int value."),
        ),
        new OA\Parameter(
            name: "page[offset]",
            description: "Pagination offset option",
            required: false,
            in: "query",
            schema: new OA\Schema(type: "integer"),
            example: "", // OA\Examples(example="int", value="0", summary="An int value."),
        ),
        new OA\Parameter(
            name: "page[limit]",
            description: "Pagination limit option",
            required: false,
            in: "query",
            schema: new OA\Schema(type: "integer"),
            example: "", // OA\Examples(example="int", value="0", summary="An int value."),
        ),
        new OA\Parameter(
            name: "sort",
            description: "Sorting",
            required: false,
            in: "query",
            schema: new OA\Schema(type: "string"),
            example: "", // @OA\Examples(example="string", value="-created,name", summary="A comma separated value"),
        ),
        new OA\Parameter(
            name: "include",
            description: "Include Relationships",
            required: false,
            in: "query",
            schema: new OA\Schema(type: "string"),
            example: "", // @OA\Examples(example="string", value="order,user", summary="A comma separated value of relationships"),
        ),
    ],
    responses: [
        new OA\Response(response: 200, description: 'Operation succesful', content:  new OA\JsonContent( type: "object", ref: "#/components/schemas/BrandTransformer/properties/data/items")),
        new OA\Response(response: 400, description: 'Bad Request'),
        new OA\Response(response: 401, description: 'Unauthenticated'),
        new OA\Response(response: 403, description: 'Forbidden'),
        new OA\Response(response: 404, description: 'Resource not Found'),
    ]
)]

and BrandTransformer.php
#[OA\Schema(
    title: "BrandTransformer",
    description: "Brands API Transformer",
    xml: new OA\XML(name: "BrandTransformer"),
)]

and the transformer schema
 #[OA\Property(
        property: "data",
        type: "array",
        items: new OA\Items(
            properties: [
                new OA\Property(property: "id", type: "integer", title: "ID", description: "id of the brand", example: ""),
               // add your own...
                new OA\Property(property: "created_at", type: "string", title: "Created at", description: "Created at Datetime of Product", example: ""),
                new OA\Property(property: "updated_at", type: "string", title: "Updated at", description: "Updated at Datetime of Product", example: ""),
            ]
        ),
    )]
    #[OA\Property(
        property: "meta",
        type: "object",
        properties: [
            new OA\Property(property: "current_page", type: "integer", title: "Current Page", description: "current page of brand", example: ""),
            new OA\Property(property: "from", type: "integer", title: "", description: "", example: ""),
            new OA\Property(property: "last_page", type: "integer", title: "", description: "", example: ""),
            new OA\Property(property: "path", type: "string", title: "", description: "", example: ""),
            new OA\Property(property: "per_page", type: "integer", title: "", description: "", example: ""),
            new OA\Property(property: "to", type: "integer", title: "", description: "", example: ""),
            new OA\Property(property: "total", type: "integer", title: "", description: "", example: ""),
            new OA\Property(property: "", type: "integer", title: "", description: "", example: ""),
            new OA\Property(
                property: "links",
                type: "array",
                items: new OA\Items(properties: [
                    new OA\Property(property: "url", type: "string", description: "URL of Pagination"),
                    new OA\Property(property: "label", type: "string", description: "Label of Pagination"),
                    new OA\Property(property: "active", type: "bool", description: "Pagination is Active"),
                ])
            )
        ]
    )]
    #[OA\Property(
        property: "links",
        type: "object",
        properties: [
            new OA\Property(property: "first", type: "string", description: "first page link URL of brand", example: ""),
            new OA\Property(property: "last", type: "string", description: "last page link URL of brand", example: ""),
            new OA\Property(property: "prev", type: "string", description: "prev page link URL of brand", example: ""),
            new OA\Property(property: "next", type: "string", description: "next page link URL of brand", example: ""),
        ])
    ]

How to reproduce the bug
Implement OpenApi\Attributes;
Package Version
3.2
PHP Version
8.3
Laravel Version
10.0
Which operating systems does with happen with?
No response
Notes
This is just a start and code is not always cleaned up and i'm not quite sure everything is covered like response codes, panel prefix as CONST so it can be added in path: etc.... I could make time to add these features and do a PR if you prefer.

yeah its a good idea too, but i think this must be optional. The documentation will generated if developer parse argument, like --swagger maybe. so the artisan command look like php artisan make:filament-api-service BlogResource --swagger.
and i don't like this part define('TENANT_AWARENESS_BRANDS', true);. The BRANDS is make confused. if you want to do this,
we can use resource property on every handler. maybe adding this method to Handlers class :
public static function isTenantAwarenessEnabled() : bool
{
   return static::getResource()::isScopedToTenant();
}

so you can call it while registering the routes.

I was thinking of putting it in a /Virtual/ with some empty classes, that way it is separted from actual code. This also means that you can regenerate API docs of one or more resources based on those api docs stubs again and again.
You are absolutely correct that the BRANDS is not okay. it was just an example and can be dynamically fetched from classname of resource.
And yes, an extra static function on the handler class isTenantAwerenessEnabled() is a good idea.
I just posted a rough WiP.. but i will add your considerations :)

first work on swagger generation. I created it as a separate command instead of --swagger option in the filament-api-service for now.
rough work is in this feature branch as pull request https://github.com/rupadana/filament-api-service/pull/51

thank you for the tools. eelco2k fix it critical errors
        $baseResourceSourcePath =  (string) str($resourceClass)->prepend('/')->prepend(base_path($resourcePath))
            ->replace('\\', '/')->replace('//', '/')
            ->replace('App', 'app'); // default

and
<?php

namespace {{ namespace }}\{{ resourceClass }}\Transformers;

use OpenApi\Attributes as OAT;

#[OAT\Schema(
    schema: "{{ transformerName }}",
    title: "{{ transformerName }}",
    description: "{{ modelClass }} API Transformer",
    xml: new OAT\Xml(name: "{{ transformerName }}"),
)]

->replace('App', 'app')
Xml
It would be nice to add an example of use

php artisan make:filament-resource User
php artisan make:filament-api-service UserResource
php artisan make:filament-api-transformer UserResource
add in UserResource
```php
    /**
     * @return string|null
     */
    public static function getApiTransformer(): ?string
    {
        return UserTransformer::class;
    }

php artisan make:filament-api-docs UserResource
php artisan l5-swagger:generate

I used the package until the patch was accepted
composer require cweagans/composer-patches

and composer,json
    "extra": {
        "laravel": {
            "dont-discover": []
        },
        "patches": {
            "rupadana/filament-api-service": {
                "add command filament-api-docs (for generate swagger)": "patches/rupadana/filament-api-service/filament-api-docs.txt"
            }
        },
        "enable-patching": true
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "source",
        "sort-packages": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true,
            "php-http/discovery": true,
            "cweagans/composer-patches": true
        }
    },

filament-api-docs.txt
Thanks for the work. Good luck in your development!

@POMXARK I've added your patches. hopefully everything works now.


allowedDomains and deniedDomains  parameters are not work

What is the current behavior?
I set like this:
crawler.queue({
    url: 'https://a.example.com',
    obeyRobotsTxt: false,
    maxDepth: 2,
    depthPriority: true,
    allowedDomains: [/example\.com$/],
  });

but the argument options of function _checkAllowedDomains in the lib/hccrawler.js, the options does not include  the allowedDomains setting.
If the current behavior is a bug, please provide the steps to reproduce
It is a bug, please check.  The package version is 1.8.0

The code looks good so I think it should work like that.
The _checkAllowedDomains function passes the array to the checkDomainMatch function that makes a regular JS regex test against the requested url.
If you found out what's wrong please post it here.

@liufuhu are you still experiencing this issue? I wasn't able to reproduce the issue based on your example.
Let me know if so, I'll reopen it.


Proof-of-Stake

Describe the solution you'd like

Reserve SmartContract as part of the Genesis block (it can be empty at this stage)
Implement built-in emission
Find link between EVM and transaction fees. Rewire this logic to channel transaction fees towards block rewards
Distribute rewards to validators and reserve SmartContract. Keep it extensible because we will introduce weights later
Further specify and document the PoS logic
Write a set of SmartContracts to control the list of validators and their ‘bonded stakes’ (bonding, unbonding, slashing)
Link between this SmartContract logic and consensus participant set
Update Block rewards to distribute rewards proportionately to stake
Add support for dynamic validator set

outdated


Handle u2028 in filename

Fixes https://github.com/node-formidable/formidable/issues/664

@ tuomassalo

replaceAll is not defined in Node 10

maybe fix the Regex instead

I am going to merge just the failing unit test. So if someone knows how to fix the regex,or has a better solution, please make another PR

I am going to merge just the failing unit test. So if someone knows how to fix the regex,or has a better solution, please make another PR

Hi,
Instead of replaceAll, can't we use replace with a g modifier regex?
Another thing: I believe \u2029 might also be problematic, so how about:
const m = headerValue.replaceAll(/[\u2028\u2029]/g, "").match // ...

Hi,
Instead of replaceAll, can't we use replace with a g modifier regex?
Another thing: I believe \u2029 might also be problematic, so how about:
const m = headerValue.replaceAll(/[\u2028\u2029]/g, "").match // ...

Or maybe use a better regex ? I am not sure.

Or maybe use a better regex ? I am not sure.


Pass template context into the construct_wagtail_userbar hook

In some cases it could be useful to have template context in the construct_wagtail_userbar hooks to add custom menu items depending on current page (as Wagtail does with "Edit this page", "Add a child page" and other menu items).
For example, when we have a ShopPage that can contain ShopsNewsIndex , ShopsTutorialIndex pages and some other page types as child pages. The ShopsNewsIndex, ShopsTutorialIndexpages are most popular options so we want to create a shortcut links for these pages (see the screenshot in the end of the ticket).
To achieve this we need to write the following hook:
from django.template.loader import render_to_string
from wagtail.wagtailadmin.userbar import BaseItem as BaseUserbarItem, AddPageItem
from wagtail.wagtailcore import hooks

from shops.models import ShopPage, ShopsNewsIndex, ShopsTutorialIndex

# Additional wagtail userbar menu items
class ShopExtraUserbarItems(BaseUserbarItem):
    template = 'wagtailadmin/userbar/item_page_shop_extra_links.html'

    def __init__(self, page):
        self.page = page

    def render(self, request):
        # Don't render if the page doesn't have an id
        if not self.page.id:
            return ''

        # Don't render if it's not a ShopPage page instance
        if not isinstance(self.page.specific, ShopPage):
            return ''

        news_index = ShopsNewsIndex.objects.child_of(self.page).first()
        tutorials_index = ShopsTutorialIndex.objects.child_of(self.page).first()

        index_pages = [
            (news_index, 'Add news'),
            (tutorials_index, 'Add tutorials'),
        ]
        available_index_pages = []

        # Don't render items if user doesn't have ability to add children
        for page, link_text in index_pages:
            permission_checker = page.permissions_for_user(request.user)
            if permission_checker.can_add_subpage():
                available_index_pages.append(
                    (page, link_text)
                )

        if not available_index_pages:
            return ''

        context = {
            'self': self,
            'request': request,
            'available_index_pages': available_index_pages,
        }

        return render_to_string(self.template, context, request=request)

@hooks.register('construct_wagtail_userbar')
def shop_extra_userbar_items(request, items):  # noqa
    # We have to get a page instance from another menu item (defined by Wagtail),
    # because Wagtail doesn't pass context into construct_wagtail_userbar hook functions,
    # so we can't construct menu.
    page = None
    for item in items:
        if isinstance(item, AddPageItem):
            page = item.page
            break

    # If can'te find a page instance,
    # don't add ShopExtraUserbarItems into the items list
    if not page:
        return

    # Update the items list
    items.append(ShopExtraUserbarItems(page))

Wagtail uses context, but doesn't pass it into hooks: https://github.com/wagtail/wagtail/blob/921cee4707ea21363d27838370b8f38d8065a3a1/wagtail/wagtailadmin/templatetags/wagtailuserbar.py#L54-L83
Also, I think, construct_wagtail_userbar hooks should not modify items: they should return a new array of items.

Agreed, I have had to get the request with a work around when we have wanted to do some request specific userbar changes.

I suggest that the page property is also passed.
Also, why is Page.objects.get() called individually for each item, even though the page variable from the context is already the page we neewd.

Proposed solution for this is to pass page as a third arg to the hook, as we are already pulling request from context we do not really want to pass contextas the third arg. Nor do we want to make a huge breaking change where everyone needs to update the first arg to becontext.
There is a function, that lets us wrap a function for backwards compatibility accepts_kwarg with a warning about what kwargs to use, so maybe we go with page=page. Otherwise this could be a breaking change or we may need another way to ensure we can support existing usage.
Notes
https://github.com/wagtail/wagtail/blob/e674b44acb5cea698111925f65ba0fd128d48fc7/wagtail/admin/templatetags/wagtailuserbar.py#L87-L88

Update fn(request, items, page)

In each usage of https://github.com/wagtail/wagtail/blob/main/wagtail/admin/views/userbar.py we also update the hook call with the page as the last param.
docs/reference/hooks.md

Update docs

Add or remove items from the wagtail userbar. Add, edit, and moderation tools are provided by default.
The callable passed into the hook must take the request object a list of menu objects (items) and the page instance. The menu item objects must have a render method which can take a request object and return the HTML string representing the menu item. See the userbar templates and menu item classes for more information.

Update example

def add_puppy_link_item(request, items, page):
    return items.append(UserbarPuppyLinkItem())

Interested in this, will work on it if I have time, three remarks:

I suggest we change the issue title to Pass page context into the construct_wagtail_userbar hook
why not use django.inspect.get_func_args to allow both positional and keyword arguments?
should we fire a future breaking change warning so that page arg will become mandatory in the future?


FixedLocator locations issue

Hi, I keep getting the following error while comparing forged data by CTGAN and the real one.
Here is the error message I got:
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-5-8b4ec6283de6> in <cell line: 13>()
     11 table_evaluator =  TableEvaluator(real, fake, cat_cols= categorical_features)
     12
---> 13 table_evaluator.visual_evaluation()

5 frames
/usr/local/lib/python3.10/dist-packages/table_evaluator/table_evaluator.py in visual_evaluation(self, save_dir, **kwargs)
    373         if save_dir is None:
    374             self.plot_mean_std()
--> 375             self.plot_cumsums()
    376             self.plot_distributions()
    377             self.plot_correlation_difference(**kwargs)

/usr/local/lib/python3.10/dist-packages/table_evaluator/table_evaluator.py in plot_cumsums(self, nr_cols, fname)
    122             r = self.real[col]
    123             f = self.fake.iloc[:, self.real.columns.tolist().index(col)]
--> 124             cdf(r, f, col, 'Cumsum', ax=axes[i])
    125         plt.tight_layout(rect=[0, 0.02, 1, 0.98])
    126

/usr/local/lib/python3.10/dist-packages/table_evaluator/viz.py in cdf(data_r, data_f, xlabel, ylabel, ax)
    170         ticks_loc = ax.get_xticks()
    171         ax.xaxis.set_major_locator(mticker.FixedLocator(ticks_loc))
--> 172         ax.set_xticklabels(data_r.sort_values().unique(), rotation='vertical')
    173
    174     if ax is None:

/usr/local/lib/python3.10/dist-packages/matplotlib/axes/_base.py in wrapper(self, *args, **kwargs)
     73
     74         def wrapper(self, *args, **kwargs):
---> 75             return get_method(self)(*args, **kwargs)
     76
     77         wrapper.__module__ = owner.__module__

/usr/local/lib/python3.10/dist-packages/matplotlib/axis.py in _set_ticklabels(self, labels, fontdict, minor, **kwargs)
   1796         if fontdict is not None:
   1797             kwargs.update(fontdict)
-> 1798         return self.set_ticklabels(labels, minor=minor, **kwargs)
   1799
   1800     def _set_tick_locations(self, ticks, *, minor=False):

/usr/local/lib/python3.10/dist-packages/matplotlib/axis.py in set_ticklabels(self, ticklabels, minor, **kwargs)
   1718             # remove all tick labels, so only error for > 0 ticklabels
   1719             if len(locator.locs) != len(ticklabels) and len(ticklabels) != 0:
-> 1720                 raise ValueError(
   1721                     "The number of FixedLocator locations"
   1722                     f" ({len(locator.locs)}), usually from a call to"

ValueError: The number of FixedLocator locations (290), usually from a call to set_ticks, does not match the number of ticklabels (275).

I tried to downgrade table-evaluator, and this message keeps popping out until ver 1.2.2.post1. However, TypeError: Image data of dtype object cannot be converted to float showed up.
I also tested downgrade matplotlib, and this way isn't working either.
Here is my code and csv files on google colab

@hawkiyc I'll have a look as soon as I have time. Apologies for the delayed response.

@hawkiyc Fix is ready for merge in #34. Will soon merge and deploy.

@hawkiyc Please update and check. Issue should be resolved! :)
Also thanks for using the package and reporting the issue!

@Baukebrenninkmeijer It's working now, thank you very much.
Yet there is a slight issue; the previous version can draw the kde curve on the histogram as the following chart.

Chart from this tutorial: Tabular Synthetic Data Generation using CTGAN
And there is no kde curve in this version.

For now, I solved this issue by adding kde=True at line 164 in table_evaluator.py on my device. However, users running table_evalutor on cloud env, such as Google colab, can't have the kde curve by modifying the source code.
For those running code on cloud env, having the KDE curve on the histogram will be great. Hence, I'd like to request a favor in modifying your library again for a better user experience.

@hawkiyc  I see, seems to have been removed as default by seaborn at some time. Enabled now again. Let me publish and check it out.

@hawkiyc Should be fixed. Let me know! They changed the shading but the lines are there, so it should be fine.

@Baukebrenninkmeijer It works perfectly. Thank you very much for your time.


Complex pipeline tutorial error - export to tensorrt

I've tried to execute example from Part 6 but I've encounter error in model conversion.
 Enabling it can significantly reduce device memory usage. See `CUDA_MODULE_LOADING` in https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#env-vars
[04/18/2023-06:17:16] [I] Start parsing network model
[04/18/2023-06:17:16] [I] [TRT] ----------------------------------------------------------------
[04/18/2023-06:17:16] [I] [TRT] Input filename:   vae.onnx
[04/18/2023-06:17:16] [I] [TRT] ONNX IR version:  0.0.7
[04/18/2023-06:17:16] [I] [TRT] Opset version:    14
[04/18/2023-06:17:16] [I] [TRT] Producer name:    pytorch
[04/18/2023-06:17:16] [I] [TRT] Producer version: 2.0.0
[04/18/2023-06:17:16] [I] [TRT] Domain:
[04/18/2023-06:17:16] [I] [TRT] Model version:    0
[04/18/2023-06:17:16] [I] [TRT] Doc string:
[04/18/2023-06:17:16] [I] [TRT] ----------------------------------------------------------------
[04/18/2023-06:17:16] [W] [TRT] onnx2trt_utils.cpp:377: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
[04/18/2023-06:17:16] [I] Finish parsing network model
[04/18/2023-06:17:17] [I] [TRT] [MemUsageChange] Init cuBLAS/cuBLASLt: CPU +852, GPU +360, now: CPU 1881, GPU 2101 (MiB)
[04/18/2023-06:17:17] [E] Error[1]: [executionResources.cpp::setTacticSources::179] Error Code 1: Cudnn (Could not initialize cudnn, please check cudnn installation.)
[04/18/2023-06:17:17] [E] Error[2]: [builder.cpp::buildSerializedNetwork::751] Error Code 2: Internal Error (Assertion engine != nullptr failed. )
[04/18/2023-06:17:17] [E] Engine could not be created from network
[04/18/2023-06:17:17] [E] Building engine failed
[04/18/2023-06:17:17] [E] Failed to create engine from model or file.
[04/18/2023-06:17:17] [E] Engine set up failed

When I've used ONNX models and I've changed configurations' backends the rest of the tutorial worked just fine.

[04/18/2023-06:17:17] [E] Error[1]: [executionResources.cpp::setTacticSources::179] Error Code 1: Cudnn (Could not initialize cudnn, please check cudnn installation.)
[04/18/2023-06:17:17] [E] Error[2]: [builder.cpp::buildSerializedNetwork::751] Error Code 2: Internal Error (Assertion engine != nullptr failed. )

It seems like the environment is missing cuDNN. Ran through the tutorial and couldn't replicate it. I recommend using the docker containers if you are having trouble setting up the environment.

I'm running this command as described in README - in a docker container. README content:
docker run -it --gpus all -p 8888:8888 -v ${PWD}:/mount nvcr.io/nvidia/pytorch:yy.mm-py3

pip install transformers ftfy scipy
pip install transformers[onnxruntime]
pip install diffusers==0.9.0
huggingface-cli login
cd /mount
python export.py

# Accelerating VAE with TensorRT
trtexec --onnx=vae.onnx --saveEngine=vae.plan --minShapes=latent_sample:1x4x64x64 --optShapes=latent_sample:4x4x64x64 --maxShapes=latent_sample:8x4x64x64 --fp16

@adamwawrzynski apologies for the late response! My messages are getting mixed up.
docker run -it --gpus all -p 8888:8888 -v ${PWD}:/mount nvcr.io/nvidia/pytorch:yy.mm-py3
What are you replacing yy.mm with? (which version of the image are you using?)
The errors that are getting logged are because of bad environment setup

I've used version 22.04. I've tried a few other versions and it worked on 22.12 so the problem was an invalid environment setup in the container.


[hotfix] Improve execution.checkpointing.unaligned.interruptible-timers.enabled documentation

Simple documentation improvement.
Verifying this change
N/A
Does this pull request potentially affect one of the following parts:
N/A
Documentation

Does this pull request introduce a new feature? (yes / N/A)
If yes, how is the feature documented? (not applicable / N/A / JavaDocs / not documented)

LGTM
(please regenerate the documentation as CI suggests)


Add files for UPN - Private University of North

@pierosanchezdev I am sorry, the domain upn.pe is removed from our trusted domains list because it was abused in the past. If you are the student of this school, please enroll to GitHub Student Developer Program. Then apply for JetBrains educational subscription with your GitHub account (GitHub tab at https://www.jetbrains.com/shop/eform/students).


Just balance the parentheses around the links.

No real changes, just get rid of annoyingly unbalanced parentheses in a couple of links.

Oops, I didn't notice the existing #363 which does the same thing (the only difference is that this one removes the IMO accidental pair of parentheses after the first link). Sorry for the duplicate, please feel free to close it and apply #363 instead if you prefer to keep these parentheses.

Thanks for that. I Couldn't merge it directly as half of it was already done - so I just redid the other half.


2.4.6版本通过CND引入经常有以下警告

[Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952

有解决办法吗

I am also seeing this and its rather frustrating. Any way we can get this fixed?


Only add the web socket configuration if the request came from localhost or <IP_ADDRESS>

I think we can do this automatically on the server, and make sure that building for production takes this into account

Actually, the watch files option I think makes this obsolete


[HOLD for payment 2022-12-27] [$1000] Chat - Edited message hides at the bottom after saving it

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Action Performed:

Open the test app and login with any account
Send any message in a chat that has at least a full page of messages.
Edit the message
Save the message
Observe the edited message

Expected Result:
Edited message is displayed properly after saving changes.
Actual Result:
Edited message hides at the bottom after saving it. Need to scroll to view it.
Workaround:
unknown
Platform:

Where is this issue occurring?

iOS

Version Number: 1.2.19-2
Reproducible in staging?: y
Reproducible in production?: y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
https://user-images.githubusercontent.com/43996225/198351707-92f8e255-8c34-42b7-978b-b06a4af40ef3.mp4
Upwork job URL: https://www.upwork.com/jobs/~01b9d92e7c3fc4c620
Issue reported by: Applause internal team
Slack conversation:
View all open jobs on GitHub

Slight edit to the Actions Performed - I only was able to reproduce this if the chat was longer than a single screen in my app (that is, if it was only a couple messages, it worked fine).
However this definitely is happening. Going to push external, weekly.

Posting to Upwork.

Job link - https://www.upwork.com/jobs/~01b9d92e7c3fc4c620

Not overdue, waiting for proposals

Not sure what the new guidance is on Daily vs. Weekly for these - I think @michaelhaxhiu will know more than me - so for now just commenting to pre-empt the bot. Still waiting for proposals.

Doubling job!

I've requested it before process changes @michaelhaxhiu

👍 sorry we didn't announce it more clearly sooner! All good now :)

Will review shortly - thanks @mollfpr! All yours @Santhosh-Sellavel if you can get to it first.

I'm confused about the logic here and need more clarity on why & how this fixes the issue! @mollfpr
cc: @dangrous

Agreed, this does seem to work but I have no idea why haha. We should definitely figure out what's going on to make sure we understand it!

Can we post this in Slack and get visibility on it? Maybe in #contributor-plus or #expensify-bugs?

Ya please go ahead if you haven't @michaelhaxhiu!

Ah let me clarify.... @mollfpr are you able to explain a little more on why the proposed solution of changing the padding-top works? If not, you post this solution in #expensify-bugs and get more eyes? If we can justify it, you'll be eligible to get the job and the bounty :)

@dangrous To help us clear out the large backlog of /App bugs, we're putting the spotlight every bug in the repo already than 4 weeks old. To help unblock the roadmap and get our bug pipeline back in equilibrium, can you:

Decide whether any proposals currently meet our guidelines and can be approved as-is
For any that can't, please take this issue internal and treat it as one of your highest priorities
If you have any questions, don't hesitate to start a discussion in #bug-zero

Re: ^ @mollfpr's proposal is currently being reviewed! Should hopefully be able to accept and get this moving shortly!

Sorry guys, need more times to debug this again.

Re-assigning myself as I'm going OOO.

Not reproducible from my end.

@kavimuru Can you check whether this is reproducible, unable to reproduce from my end too!

@Santhosh-Sellavel checking with the tester and will update here shortly.

Was able to reproduce this locally as well! @mollfpr do you possibly have an update on your debugging efforts and explanation on your proposed solution? 🙏

@mollfpr bump do you have an update yet :)

Sorry, I miss this issue. I'll make a summary within an hour.

The issue is only reproduced if the chat shows the recipient's local time and we will set contentContainerStyle with padding-top=0. Also, it not only reproduces when saving the message but also canceling the edited message.
The issue is from the maintainVisibleContentPosition.autoscrollToTopThreshold of the FlatList component. While maintainVisibleContentPosition is used to fix https://github.com/Expensify/App/issues/7145 so we can't remove that.
https://github.com/Expensify/App/blob/d3acbab01146fcca6965ac86821879188cd6bac0/src/components/InvertedFlatList/BaseInvertedFlatList.js#L147
I don't have any explanation for why setting the padding-top to 0 is causing the problem and setting the padding-top to more than 0 will fix the issue.

Got it, thanks for the summary! I think it's probably a quirk with how the visibility is calculated with the component and having a padding-top > 0 makes all the difference 🤷
Given the current state of things, I'd say we can move forward with this hack for now 👍 but let's make sure it doesn't have any discernible visual effects on the other platforms: desktop/web/android, etc. and if we can have a small comment there with additional context on why we have the padding-top > 0, that would be great!

We can move the padding-top=5 from styles.chatItemComposeSecondaryRow on ParticipantLocalTime style to the contentContainerStyle flat list. In this way don't need any extra padding to fix the issue and keep the style the same as before.
diff --git a/src/pages/home/report/ParticipantLocalTime.js b/src/pages/home/report/ParticipantLocalTime.js
index a93d2e57a..74f581c96 100644
--- a/src/pages/home/report/ParticipantLocalTime.js
+++ b/src/pages/home/report/ParticipantLocalTime.js
@@ -60,7 +60,7 @@ class ParticipantLocalTime extends PureComponent {
                 : this.props.participant.displayName);

         return (
-            <View style={[styles.chatItemComposeSecondaryRow]}>
+            <View style={[styles.chatItemComposeSecondaryRow, styles.pt0]}>
                 <Text
                     style={[
                         styles.chatItemComposeSecondaryRowSubText,
diff --git a/src/pages/home/report/ReportActionsList.js b/src/pages/home/report/ReportActionsList.js
index d62d4e247..98e068a72 100644
--- a/src/pages/home/report/ReportActionsList.js
+++ b/src/pages/home/report/ReportActionsList.js
@@ -159,7 +159,7 @@ class ReportActionsList extends React.Component {
                     renderItem={this.renderItem}
                     contentContainerStyle={[
                         styles.chatContentScrollView,
-                        shouldShowReportRecipientLocalTime && styles.pt0,
+                        shouldShowReportRecipientLocalTime && styles.chatContentRecipientLocalTime,
                     ]}
                     keyExtractor={this.keyExtractor}
                     initialRowHeight={32}
diff --git a/src/styles/styles.js b/src/styles/styles.js
index b6b617b30..977b27588 100644
--- a/src/styles/styles.js
+++ b/src/styles/styles.js
@@ -1275,6 +1275,10 @@ const styles = {
         paddingVertical: 16,
     },

+    chatContentRecipientLocalTime: {
+        paddingTop: 5,
+    },
+
     // Chat Item
     chatItem: {
         display: 'flex',

https://user-images.githubusercontent.com/25520267/204429359-0537fb94-d806-4e65-bad8-d1e8b489c6b0.mov

@mollfpr Great find! That sounds like an even better approach 👍

Are we hiring @mollfpr? If so, let's please get him assigned to the issue.

This looks great, @mollfpr! Assigning you now.

@Santhosh-Sellavel @mollfpr both hired in Upwork ✔

Thank you! Will raise the PR in a couple of hours.

Sorry about this proposal not working well. The style of styles.chatItemComposeSecondaryRow uses using margin (I don't know why I see it as padding), so moving the margin style to the list container will remove the spacing between the recipient's local time text.
I ended up just adding padding-top=1 to the list container instead. Are we okay with this?
cc @robertjchen @dangrous

@mollfpr I think that would probably be fine. However, I was just looking at your PR and I tried testing on main first just to make sure I knew the bad behavior and... I'm not actually seeing it anymore. I'm wondering if something with the new theming somehow fixed it?
Are you (or @robertjchen or @Santhosh-Sellavel) still able to reproduce? We may not need this after all... Unless it's something with my simulator which is perfectly possible.

@dangrous I'm able to reproduce it in the simulator. Is your chat showing the recipient's local time above the composer?

@mollfpr Please attach a video performing steps, that's solid to keep us working on that!

Sorry about this proposal not working well. The style of styles.chatItemComposeSecondaryRow uses using margin (I don't know why I see it as padding), so moving the margin style to the list container will remove the spacing between the recipient's local time text.
I ended up just adding padding-top=1 to the list container instead. Are we okay with this?
cc @robertjchen @dangrous

No, It's better to re-evaluate things let's make it open to proposals or dig more to find the exact cause.

@mollfpr I think that would probably be fine. However, I was just looking at your PR and I tried testing on main first just to make sure I knew the bad behavior and... I'm not actually seeing it anymore. I'm wondering if something with the new theming somehow fixed it?
Are you (or @robertjchen or @Santhosh-Sellavel) still able to reproduce? We may not need this after all... Unless it's something with my simulator which is perfectly possible.

@dangrous I too have trouble reproducing it but it was able to reproduce by QA Last week here
@kavimuru Can you check this one more time now, also is this able to reproduce consistently by the tester? Thanks!

@mollfpr Please attach a video performing steps, that's solid to keep us working on that!

Sorry, here's the video.
https://user-images.githubusercontent.com/25520267/204894141-8b273e78-492c-4671-b05f-d443cc346575.mov

@dangrous I too have trouble reproducing it but it was able to reproduce by QA Last week https://github.com/Expensify/App/issues/12198?notification_referrer_id=NT_kwDOBRraj7M0Njk5ODAwODAzOjg1NjQ1OTY3#issuecomment-1323986030

I think it would be great if you could record the step you do. So we would have a clue why is reproduce in some places.

@mollfpr I am able to reproduce this issue Maybe I tried earlier without the timezone.
https://user-images.githubusercontent.com/85645967/205113829-5b6dd19d-2276-416c-aa97-9a345becc6af.mp4
cc: @dangrous

Took me a couple tries but was able to reproduce again as well. Alright, @mollfpr if it's okay maybe we keep digging to try to figure out another option than the added padding... If we can't, let's do a thorough check to make sure that doesn't make any visible difference anywhere else, and then we can move forward if needed. Thanks!

Yup, I’m okay with that! Should I assign it while we are digging?

@dangrous
Let's unassign @mollfpr, and add the help wanted label here! As we are nowhere near a solution we both could just end up penalized.
cc: @laurenreidexpensify Also let's double this up to our new price $1000. To get more eyes thanks!

https://reactnative.dev/docs/scrollview#maintainvisiblecontentposition-ios

Caveat 2: This uses contentOffset and frame.origin in native code to compute visibility. Occlusion, transforms, and other complexity won't be considered whether content is "visible" or not.

It's stated that maintainVisibleContentPosition is using contentOffset. Also, as I said, this issue only occurred when the keyboard was closing, and the height of the list was changing due to the removed edit composer input.
When we use padding-top <= 0 to contentContainerStyle, the contentOffset.y last value is 28.
https://user-images.githubusercontent.com/25520267/205471379-771a042b-9c8a-4263-9f43-a4ebefb9db04.mov
It has different results when we use a padding-top one. The contentOffset.y last value is -27.
https://user-images.githubusercontent.com/25520267/205471384-7a147c5d-d3d9-41cc-9fcd-7024279560d8.mov

contentContainerStyle padding-top <= 0

When showing the edit composer input, contentOffset.y start at 36.333333333333336 and change to 50 because of the edit composer input height.
When the edit composer input showed the contentOffset.y value is 0.
When the edit composer input is closing, the contentOffset.y value is -50.333333333333336 (diff from the contentSize.height when the edit composer input is removed) and ends at 50.333333333333336 and makes the chat offset

contentContainerStyle padding-top > 0

When showing the edit composer input, contentOffset.y start at 0 and change to 16 (the value of our padding vertical for the list)
When closing the edit composer input, contentOffset.y is only set once, and it's a minus value where it's not changing the position

My conclusion for the above, the doc said in Caveat 2 that there is a possibility that content is not managed correctly to show its visibility.

I also found on chat that not showing the recipient's local time and editing the last message; there's a gap below the edit composer input. I don't know if this desire looks. I think we should set the padding top for the list to the container in all conditions.
https://user-images.githubusercontent.com/25520267/205472062-71d09d05-e936-4049-8356-18479eb0de2e.mov
The solution might depend on the action we take for the above issue.
@priyeshshah11 also has a good point about the problem is, but using setTimeout is not what we looking for.

@priyeshshah11 We don't recommend use of setTimeout.
Thanks @mollfpr for detailed explanation here!

Increased to $1000

@priyeshshah11 Never update the proposal which is already reviewed. Always submit it in a new comment, it's easy to track things that happened here. So please submit a new comment with the changes, thanks!

@priyeshshah11 Never update the proposal which is already reviewed. Always submit it in a new comment, it's easy to track things that happened here. So please submit a new comment with the changes, thanks!

@Santhosh-Sellavel sure, here it is.
Proposal
Reproduced it in slow motion here
https://user-images.githubusercontent.com/38547776/205369737-fc2d578f-c2c7-408e-a408-8ad89044c311.mov
Solution
Scroll to the current item in the list once the editing is complete i.e. once the keyboard has closed.
We can do this by adding the keyboardDidHide event listener below in deleteDraft as it is called by both the cancel & save changes buttons for editing and then clear the listener at the end of that callback.
Also, we should only do this for the last comment as this is only an issue for the last comment otherwise it creates an unnecessary scroll for other comments.
https://github.com/Expensify/App/blob/main/src/pages/home/report/ReportActionItemMessageEdit.js#L129-L134
    deleteDraft() {
        this.debouncedSaveDraft.cancel();
        Report.saveReportActionDraft(this.props.reportID, this.props.action.reportActionID, '');
        toggleReportActionComposeView(true, this.props.isSmallScreenWidth);
        ReportActionComposeFocusManager.focus();
        if (this.props.index === 0) {
            const keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => {
                ReportScrollManager.scrollToIndex({animated: true, index: this.props.index}, false);
                keyboardDidHideListener.remove();
            });
        }
    }

After Fix
https://user-images.githubusercontent.com/38547776/205658309-cd5a8db3-de1a-4a92-8741-8c9a4ef1fa4a.mp4

I couldn't find any clue how we can solve this with JS. The scroll with threshold is done in the native ScrollView.
      CGRect newFrame = self->_firstVisibleView.frame;
      CGFloat deltaY = newFrame.origin.y - self->_prevFirstVisibleFrame.origin.y;
      if (ABS(deltaY) > 0.1) {
        CGFloat bottomInset =
            self.inverted ? self->_scrollView.contentInset.top : self->_scrollView.contentInset.bottom;
        CGFloat y = self->_scrollView.contentOffset.y + bottomInset;
        self->_scrollView.contentOffset =
            CGPointMake(self->_scrollView.contentOffset.x, self->_scrollView.contentOffset.y + deltaY);
        if (autoscrollThreshold != nil) {
          // If the offset WAS within the threshold of the start, animate to the start.
          if (y - deltaY <= [autoscrollThreshold integerValue]) {
            [self scrollToOffset:CGPointMake(self->_scrollView.contentOffset.x, -bottomInset) animated:YES];
          }
        }
      }

https://github.com/facebook/react-native/blob/913ebd207c2e7bc1182eab0bd8d82e7d9d7ee567/React/Views/ScrollView/RCTScrollView.m#L953-L967

I guess adding padding-top is influent the deltaY value and triggers the scroll threshold in the correct position. The lowest value for padding-top we can add is 0.2.

@Santhosh-Sellavel sure, here it is.

@Santhosh-Sellavel  any feedback on this proposal?

Sorry for the delay,  but this is unnecessary for other platforms.

Sorry for the delay, but this is unnecessary for other platforms.

Then should we apply my suggested fix just for iOS by adding this line
if (Platform.OS !== 'ios') { return; } after in deleteDraft ?
deleteDraft() {
    this.debouncedSaveDraft.cancel();
    Report.saveReportActionDraft(this.props.reportID, this.props.action.reportActionID, '');
    toggleReportActionComposeView(true, this.props.isSmallScreenWidth);
    ReportActionComposeFocusManager.focus();
    if (this.props.index === 0) {
        const keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => {
            ReportScrollManager.scrollToIndex({animated: true, index: this.props.index}, false);
            keyboardDidHideListener.remove();
        });
    }
}

Yeah I don't love that it's basically useless anywhere but iOS, but it does make sense.... If we were to go this route though I'd definitely prefer having it fire all the time to the Platform.OS !== 'ios'  version. Will the first version of the code cause any problems on web/desktop/anywhere there's no Keyboard to hide?
What do you think @robertjchen?

Will the first version of the code cause any problems on the web/desktop/anywhere there's no Keyboard to hide?

Yeah, console errors are thrown.

Ah, okay thanks for clarifying. Yeah we'll want to keep looking then I think

@laurenreidexpensify Can you double this job please? Thanks!

I'm confused this looks straightforward but also unnecessary at the same time. As this occurs happens only when participant time is shown.

@Santhosh-Sellavel @dangrous I was able to reproduce this even without the participant time showing.
https://user-images.githubusercontent.com/38547776/206302728-6391a0a4-52e5-4b8a-ae85-a338b5d7c062.mov

Will the first version of the code cause any problems on the web/desktop/anywhere there's no Keyboard to hide?

Yeah, console errors are thrown.

@Santhosh-Sellavel have you tested it? because I don't see any console errors in the browser.

@Santhosh-Sellavel @dangrous I was able to reproduce this even without the participant time showing.

@priyeshshah11 What version is this? And from your video, no padding between the latest chat message and the composer where it's should be padding there.

@dangrous  this is one of the oldest issues in the /App repo. To help us clear out the large backlog of bugs, can you:

Decide whether any proposals currently meet our guidelines and can be approved as-is
For any that can't, please take this issue internal and treat it as one of your highest priorities
If you have any questions, don't hesitate to start a discussion in #bug-zero

So I just tested @priyeshshah11 's proposal on the latest main and I think it should work - it is unnecessary for the other platforms but I'm not getting any console errors so I think we might be fine. Doesn't seem to affect behavior on non-timezone chats, and works on the timezone ones.
@Santhosh-Sellavel do you mind double checking my work (e.g. testing) and see if you're seeing any reason not to move forward here, other than the slight conceptual sadness of having it be a global solution only for iOS?

@dangrous

@dangrous
Have you tried editing a message on web/desktop?

That seems very weird as I am not getting those errors, I have been testing on web. I can see the addListener function when I log Keyboard.

yeah, I did... nothing showed up for me. Did you import Keyboard up top?
import {InteractionManager, View} from 'react-native';
(L3 of that file)

Ah 😁 yeah, I missed importing it rookie mistake!
The solution works on iOS, But still, this looks like a workaround to me.
@dangrous. Need to test on other platforms to ensure it doesn't have any weird effects there.

Ah 😁 yeah, I missed importing it rookie mistake!
The solution works on iOS, But still, this looks like a workaround to me.
@dangrous. Need to test on other platforms to ensure it doesn't have any weird effects there.

Tested on iOS, web, mweb & desktop, works well on all of them. Trying to get android emulator going.

I checked out Android, iOS, desktop web, and Desktop and they all seemed okay; mobile web is not working for me right now so TBD on those ones. If we can move forward on Monday, that would be great!
As for this being a workaround or not, I mean I guess I can see where you're coming from. But, I don't feel like this is particularly hacky per se - the Keyboard tends to cause all sorts of problems and this is a relatively clean solution. @robertjchen - would love to know what you think, as you're more experienced!

@Santhosh-Sellavel all platforms have now been tested and are working well, are we good to proceed?

Okay let's proceed with the @priyeshshah11 proposal, thanks!

Applied on upwork & the PR will be ready either today or tomorrow. Also, should the job be $2000 as per https://github.com/Expensify/App/issues/12198#issuecomment-1341614648 ? It is currently set at $500 on upwork.

@priyeshshah11 Final payment will be made correctly.
Let me know when PR is ready for review!

@priyeshshah11 Final payment will be made correctly.
Let me know when PR is ready for review!

@Santhosh-Sellavel https://github.com/Expensify/App/pull/13543#issuecomment-1347465470

@priyeshshah11 apols for the delay here - Christmas holidays have messed up this week a bit 😅 Once you accept contract in Upwork I will issue payment. Thanks
@Santhosh-Sellavel your fee has been issued now 👍🏽

@laurenreidexpensify this qualifies bonus also As it is merged within 3 business days.

@priyeshshah11 apols for the delay here - Christmas holidays have messed up this week a bit 😅 Once you accept contract in Upwork I will issue payment. Thanks

@laurenreidexpensify No worries, I understand 😁 I have replied to you on upwork for the bonus. Thanks! 😊

@Santhosh-Sellavel @priyeshshah11 All sorted- payments and bonuses issued 👍🏽

@Santhosh-Sellavel / @robertjchen / @dangrous - waiting on you to complete these steps https://github.com/Expensify/App/issues/12198#issuecomment-1358867572 so we can close. thanks

I feel like I've been saying this for all of my bugs lately, but I think this is not really a regression, rather it's an unnoticed case that we hadn't accounted for when the code was created - i.e. it never had the proper behavior. We've had a number of issues with the keyboard so this might just be a similar one.
@Santhosh-Sellavel or @robertjchen feel free to disagree - what do you think?

I agree with you @dangrous


make project have problem

ESP32 IDF 2.0    xtensa-esp32-elf-gcc  5.2.0
/home/long/esp/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld: cannot find -lrtc
collect2: error: ld returned 1 exit status

/home/long/esp/esp-idf-v2.0-rc1/make/project.mk:313: recipe for target '/home/long/esp/esp-idf-v2.0-rc1/examples/get-started/hello_world/build/bootloader/bootloader.elf' failed
make[1]: *** [/home/long/esp/esp-idf-v2.0-rc1/examples/get-started/hello_world/build/bootloader/bootloader.elf] Error 1
/home/long/esp/esp-idf-v2.0-rc1/components/bootloader/Makefile.projbuild:31: recipe for target '/home/long/esp/esp-idf-v2.0-rc1/examples/get-started/hello_world/build/bootloader/bootloader.bin' failed
make: *** [/home/long/esp/esp-idf-v2.0-rc1/examples/get-started/hello_world/build/bootloader/bootloader.bin] Error 2

For anyone who finds this in a search, the solution is git submodule update --init --recursive which will fetch the submodule which contains librtc.
A better error message for handling this is going to be merged soon.

Building LoPy from Pycom. Getting this error on linkux 64 bit OS. Please resolve this. Even i have tried the method above but no luck.
Error shown below-----
skmis@skmis-VirtualBox:~/esp/esp32$ make BOARD=LOPY -j5 LORA_BAND=USE_BAND_868 TARGET=app
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
LINK build/LOPY_868/release/application.elf
/home/skmis/esp/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld: cannot find -lrtc_clk
collect2: error: ld returned 1 exit status
application.mk:360: recipe for target 'build/LOPY_868/release/application.elf' failed
make: *** [build/LOPY_868/release/application.elf] Error 1

Rtc_clk is not an existing library anymore: the code has been rewritten and included as open-source. I suggest you contact the LoPy people for this: they need to update their list of dependencies because their build process does not seem to use our esp-idf make process.


Add RawVariation method for proxy calls

Description
Adding a new function called RawVariation.
This method doesn't care about the type of the result and forwards it as an interface.
This is needed if you want to expose the results as json, this will be used by go-feature-flag relay proxy that is an API exposition of go-feature-flag.
I did not add any documentation because it is not required to use this function in normal usage of the library.
Changes include

[ ] Bugfix (non-breaking change that solves an issue)
[x] New feature (non-breaking change that adds functionality)
[ ] Breaking changes (change that is not backward-compatible and/or changes current functionality)

Checklist

[x] I have tested this code
[x] I have added unit test to cover this code
[x] I have followed the contributing guide

Coverage increased (+0.08%) to 94.291% when pulling 40ef76da1ca9f817361566315e60e2c5ad9ee26e on raw-variation into 7aa04a0c12352b22640054600e6a45022bf96783 on main.


Update to 2.2.3 error: ascii codec can't encode character / ordinal not in range

Thanks for the great work, I'm able to operate all the shutters in my house via this integration! Especially the clear and step by step description helped me a lot.
The update to v2.2.3 automatically appeared but when I push the install button the following error shows up:

Kan service update/install niet aanroepen. 'ascii codec can't encode character 'Ixe9' in position 635: ordinal not in range(128)

Someone with the same issue? Any advice on where to look for fixing this?

This has to do with HA trying to write the backup file with encoding.  I will change this to ensure it does not try to encode the characters for the Dutch character set when it is trying to write this file in the next release of the plugin (Hopefully today).

Thanks @rstrouse!

Update the plugin in HA and this should now properly save your backups.

strange, I first updated the plugin but with no success. Eventually deleted everything and reinstalled the integration. I struggled through some "invalid flow specified" issues but got the integration working again. When running the update I get the following error (even after rebooting & CTRL-F5):

That is weird.  I'll take a look.

Ok I guess I needed to actually write a file from a production system instead of my dev system.   Writing the file required first converting it to a byte output before writing.  It is odd that I can't just write an ordinal string.  One would expect to simply write a file and be able to read it back out exactly as it was written.  In v2.3.0 of the plugin that is exactly what it does but I had to transform it from one form then to another.

hey @rstrouse thanks for the follow-up. Nothing on my side that could cause this?

Nope it just required coercion because of the non-Ascii characters you used to name your shades.  The firmware handles it just fine it was just the Python subsystem in HA that didn't want to write the file because it had non-ascii characters in it.   Then when I told it that it was supposed to ignore it, it blew me off and said that I needed to encode it anyway.  Hence the second message.
The Invalid flow you got after the update is because HA needed to restart completely.  A few releases back they added a quick reload that does not go through the full restart process and initialize the custom components.   As a result, the it doesn't always load all the changes until a restart.  So when you update a HACS component it is supposed to restart but sometimes it does a quick reload.
If you update to v2.3.0 for both the firmware and the HA integration all should be good.

okay, I'll try that tomorrow or day after tomorrow and update you here! Thanks again for the great work.

All went well @rstrouse I've downloaded the firmware and application and updated via webinterface. Did a full reboot on HA and it's up-to-date. Keep up the good work!


fix: test

Description

Motivation and Context

Breaking Changes

How Has This Been Tested?

[ ] I have updated at least one of the examples/* to demonstrate and validate my change(s)
[ ] I have tested and validated these changes using one or more of the provided examples/* projects

[ ] I have executed pre-commit run -a on my pull request

:tada: This PR is included in version 1.0.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Two different sheets showing at once (herbarium)

If you enter the collection date entirely with the keyboard and not the mouse, and finally press the Return key, two different sheets are shown next. At first, the image looks normal, but when I try to move or resize it, I find there's a second image underneath the first, and it's this image which I can move and resize. The first image can't be moved or resized. Obviously I can't continue, because I don't know which image to transcribe.
I see there's another bug to do with entering the collection date with the keyboard, but I haven't seen this bug described.
I'm using Firefox 41.0.2 under Kubuntu. Also duplicated in Chrome.
You can see the full discussion here:
http://talk.notesfromnature.org/?_ga=1.194372077.1168850393.1440349035#/boards/BNN0000002/discussions/DNN00005vs?page=1&comment_id=5660700b37ae700096000136
I am not wondering if this is related to #370 and perhaps #381?

Interesting--I was just able to reproduce this locally with the Calbug collection, will dive a bit deeper into it tomorrow and report back

Update: I spent a few hours trying to reproduce this yesterday but was unable to (So far have only seen it that first time). I'm speculating this could be linked to #370 though


Rails 3.1.0 and custom remote validators

Hi,
I recently upgraded my app to Rails 3.1 and I'm happy user of client side validations. I found two problems with your custom validators howto on local wiki https://github.com/bcardarella/client_side_validations/wiki/Custom-Validators.
Speaking about remote validators, you mention
url: '/validators/zipcode.json',
as a URL for validator. Rails 3.1 does not understand that kind of route (I didn't try to find out why exactly). When I remove .json it works (response is in JSON format anyway)
Another problem is this:
module ClientSideValidations::Middleware
class ZipCode < Base
this creates ZipCode in ClientSideValidations::Middleware namespace. In development env I got errors like  LoadError (Expected /.../app/middleware/zipcode.rb to define ZipCode) so I solved it like this:
module ClientSideValidations::Middleware
class ::ZipCode < Base
but this only works for development environment. In production only the old way works
module ClientSideValidations::Middleware
class ZipCode < Base
Do you have any idea what may cause this or how to solve it properly?

Yeah, the wiki should be updated. ClientSideValidations 3.1 removed the .json at the end as it was not necessary.
As for the other issue, I would try naming the file zip_code.rb and see if that helps. Rails tries to be smart about how it loads files.

I ran into the same problem as @ares with rails 3.0.9. my middleware name is Email (under middleware/email.rb).
this works fine under dev:
module ClientSideValidations::Middleware
  class ::Email < Base

but in other envs I had to do:
module ClientSideValidations::Middleware
  class Email < Base


Performance degradation

We used loopback 3 and mysql in our project, detail packages are as below:
 "loopback": "^3.27.0",
 "loopback-boot": "^3.3.1",
 "loopback-component-explorer": "^6.5.1",
 "loopback-connector-mysql": "^6.0.0",

Our deployment environment is Azure K8S
NodeJs 12.18.3
and our Mysql tables also have no special data types expect MEDIUMTEXT and TEXT, and the table columns are no more than 20.
We also integrated Azure Application Insights in our application/service as APM/Distribution Trace service.
We found the performance degradation after several days:

Sometimes, there are some slow queries from application view but we can't find slow query at server side; and the slow queries happened frequently over time.
Event loop CPU time became higher (This metrics is collected by ApplicationInsights nodejs native)

From Azure K8S, the average CPU time is normal, did NOT find high CPU issue
Request performance degradation, we can find it's NOT related to loading/TPS, but the operation time was rising day by day.

We tried to increase UV_THREADPOOL_SIZE to 16 (mysql connection pool size is default: 10), but it seems it just postponed the degradation, but it can't resolve this issue fundamentally. We had to restart our application/service regularly as short-term solution now.
In fact, we also has other services used loopback 3 + Mongodb, we did NOT find similar issue.

Based on even your version numbers, you are not using this module directly, so it would make it even harder to track down. I use this module in various applications with a lot of usage and don't have any issue, but perhaps I am not using the module in the same way.
Unfortunately, though you are having issues, there is just not enough information provided here to actually look into the problem. Perhaps could you provide a reduced test case that just uses this module that reproduces the issue? Or maybe memory dumps from your application for the duration of the issue, or flame graphs of where the time is being spent during the slow queries?

Thx @dougwilson 's quick answer, "loopback-connector-mysql": "^6.0.0" depends on "mysql": "^2.11.1", and the real used mysql version is "2.18.1".
Due to we just find this issue in our production environment now, we still tried to reproduce it in non-prod env.

@emmansun I'd check memory usage as a first suspect, GC pauses might cause increase in latency and CPU load
Try to log regularly process.memoryUsage(), if you see strong signal that your application heap grows over time (unproportional to the load) then start your app with node --trace_gc

Thx @sidorares , the used heap grows over time, we used local memory cache, and start nodejs with --max-semi-space-size=64.
We redeployed it after Oct 23 11:00 AM, and also redeployed it after Nov 03 11:00 PM.
Avg Memory Usage (Heap) :

Max Memory Usage (Heap) :

Avg IncrementalMarking Garbage Collection Duration:

Max IncrementalMarking Garbage Collection Duration:

Avg MarkSweepCompact Garbage Collection Duration

Max MarkSweepCompact Garbage Collection Duration

@emmansun what is the conclusion of this discussion? The decreased performance are caused by mysql driver or some other issue (like memory leak suggest) inside your application ?

@Zikoel , we still do not have conclusion for it, we had upgraded nodejs to 12.22.x , and will upgrade it to 14.16.x soon. We will disable azure application insights mysql auto-collect soon, to check if it's impacted by it.

I think this issue's root cause is NOT related to this package, after we upgraded/changed crypto and uuid related implementation, this issue disappeared .


Some characters give error

Describe the bug
i am using your package to render Arabic text inside images but i found that there is
a word cause error
To Reproduce
Try execute  ArPhpLaravel::utf8Glyphs($text)
with this word "للاستكشاف"
Code Example
$result =  ArPhpLaravel::utf8Glyphs($result);
Versions:

PHP: 8.2
Laravel: 10
Packeage: "still-code/ar-php-laravel": "^2.0"

Error Undefined array key -1
I found that this part للا is the problem

my package is just a warper around the main package:
https://github.com/khaled-alshamaa/ar-php
try this:
$arabic = new \ArPHP\I18N\Arabic();
$result = $arabic->utf8Glyphs('للاستكشاف');

if still an issue, you can open an issue there.


Replace the main context and cancel function by close function/channel

As an alicenet developer, I would like to be able to close the task_handler, task_manager, task_executor and all the spawned tasks without using the context and cancel function.
Stop using the context functionality to close the task_handler, task_manager, task_executor and all the spawned tasks. Use a close function or channel instead to prevent the eventual memory leak.
Acceptance Criteria:
Usage of the main context is replaced by a close function or channel. It closes every element of the task execution chain. Unit tests added and passing.

completed


Android: read model file from arbitrary directory rather than from assets folder

Currently, TensorFlowInferenceInterface's method initializeTensorFlow() and its underlying C implementation (in tensorflow_inference_jni.cc and jni_utils.cc) require the usage of Android's AssetManager in order to read model files stored in the assets folder.
How can we modify TF's code to provide an alternative way to run the classification using a model file that's not stored in the assets folder (i.e. a location described by a File object, or by a String path pointing to another location outside the assets folder).
Is there branch where someone might be working on this? I have poor C skills so as to make such change by myself, but maybe I can work on something with some guidance.
Thanks.
Bruno.

If you remove the file:///android_asset/ prefix from the model file in TensorFlowImageListener.java, it should just work. There already exists code that can load from non-assets in the native C++ layer. If that prefix is not present it will attempt to treat the location as a regular filepath.
The label file in the example is a different matter, but this is not difficult to fix in TensorFlowImageClassifier.java. I have a TODO open for this already, and will update the code soon to be more flexible.

Hi Andrew. It works pretty well using the instructions above. Thanks for the help!
Bruno.

@andrewharp I tried loading a model from the external storage folder but got a runtime exception:
Caused by: java.lang.RuntimeException: Failed to load model from '/storage/emulated/0/optimized_tfdroid.pb'                                                                  at org.tensorflow.contrib.android.TensorFlowInferenceInterface.<init>(TensorFlowInferenceInterface.java:92)                                                                  at com.***.app.tensorflow.TensorFlowImageClassifier.create(TensorFlowImageClassifier.java:118)
Using tensorflow-android-1.2.0. The file definitely exists, what am I doing wrong?

Sir I am trying the same thing as above but could not program it.
Could you please share your code
@andrewharp

Sir I am trying the same thing as above but could not program it.
Could you please share your code
@andrewharp

Instead of using the AssetFileDescriptor use it like this, pass the full file path in load model method
private MappedByteBuffer loadModelFile(String modelPath) throws IOException {
try (FileInputStream fileInputStream = new FileInputStream(
                new File(modelPath))) {
            FileChannel fileChannel = fileInputStream.getChannel();
            return fileChannel.map(MapMode.READ_ONLY, 0, fileChannel.size());
        }
    }


Line breaks always put the cursor back on first line.

 Issue by Warface
Monday Jun 30, 2014 at 15:36 GMT
Originally opened as https://github.com/schnawel007/bootstrap3-wysihtml5/issues/23

When I hit "Return" on the keyboard, the  is created but the cursor don't change line. It stays on the first one I was when I hit "Return".
Using Chrome on Win 8.

Any progress on this ?

¯_(ツ)_/¯


Fix: Ensure SQL catalog contains bundles.

py-mtcli
Description
The codebase contained a bug where validating that a bundle image has Size > 0 is sufficient to ensure a bundle is properly built, but this is not sufficient for an index image.
This is because the index image will always have Size > 0 as it contains a whole alpine or busybox container depending on OPM's version used.
This fix proposes a deeper inspection by extracting the /database/index.db sqlite3 file from a container and ensuring the properties table contains bundles metadata.
Checklist
For any modification to managedtenants/bundles/

[x] $ managedtenants --addons-dir=../managed-tenants-bundles/addons --dry-run bundles (successfuly built all addons)

Also realized the container.remove(force=True) was not executing and code was leaking containers. Not sure why, but moved it inside the try...except


Hay nice project, some other projects similar to take inspiration from.

https://github.com/voraciousdev/ink
https://github.com/fuermosi777/markword

Ink is by far the most well made one yet, while markword has a Mac application up and running with a lot of WYSIWYG functionality up and running.

Hi @bxff, I am aware of both of these fantastic libraries, and they also influence this library in a huge manner. Thank you for providing a source of inspiration for this project. 😄


Fix version number

There was a breaking change in illuminate/queue 5.7.7 which is incompatible
with laravel-pubsub-queue.
See https://github.com/laravel/framework/blob/3c278f372eaf139cefc98aacd716604f71866264/src/Illuminate/Queue/Queue.php#L86 for reference.
This is the cause of the most recent failing build.

Thanks for your PR !
I was planning on changing that today. I think it will require few more changes, i'm going to work on that.

I merged my change and also made the fix related to the breaking change.
https://github.com/kainxspirits/laravel-pubsub-queue/pull/8
I'm closing the PR but feel free to open a new issue if needed.


Unexpected token on reserved keywords

I encountered these errors:

Unexpected token: unset on a function called unset()
Unexpected token: NEW on a class constant called NEW
Unexpected token: EMPTY on a class constant called EMPTY
Unexpected token: DEFAULT on a class constant called DEFAULT

All of those errors are within the php spec (http://php.net/manual/en/reserved.keywords.php).
Similar/related issues:

https://github.com/phpmd/phpmd/issues/556
https://github.com/phpmd/phpmd/issues/592
https://github.com/phpmd/phpmd/issues/589

It depends on https://github.com/pdepend/pdepend/pull/383

Sadly pdepend/pdepend#383 will not be enough, I tested with dev-php-7.1-compatibility and the unexpected token is still there. It should be handled afterward.
In fact, the token_get_all itself produces this misleading result:
https://3v4l.org/rk6uH
After function, the tokenizer should give us a T_STRING, but it actually gives a T_EMPTY. That means the PHP parser handle it while it should be the responsibility of the tokenizer (lexer) if well enclosed.


no wait time between challenge requeues

Describe the bug:
cert-manager logs show that errors in instantiating dns01 solver practically do not have any wait time between retries:
E0624 02:49:41.846863       1 controller.go:166] cert-manager/challenges "msg"="re-queuing item due to error processing" "error"="error instantiating route53 challenge solver: unable to assume role: AccessDenied: User: arn:aws:sts::__OTHER_ACCOUNT__:assumed-role/eksctl-inkydev-addon-iamserviceaccount-cert-Role1-1E9S73WFKBTSN/1656038981801523343 is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::__ACCOUNT_ID__:role/AmazonEKSExternalDNSCrossAccount-Dev\n\tstatus code: 403, request id: 039d64aa-1bbe-4b30-9e66-c376bdb612eb" "key"="monitoring/grafana-tls-8gkhf-4002345480-3499020834"
E0624 02:49:41.897252       1 controller.go:166] cert-manager/challenges "msg"="re-queuing item due to error processing" "error"="error instantiating route53 challenge solver: unable to assume role: AccessDenied: User: arn:aws:sts::__OTHER_ACCOUNT__:assumed-role/eksctl-inkydev-addon-iamserviceaccount-cert-Role1-1E9S73WFKBTSN/1656038981847044427 is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::__ACCOUNT_ID__:role/AmazonEKSExternalDNSCrossAccount-Dev\n\tstatus code: 403, request id: 2047d362-3752-4b1b-9848-9bf787cca185" "key"="monitoring/grafana-tls-8gkhf-4002345480-3499020834"
E0624 02:49:41.950191       1 controller.go:166] cert-manager/challenges "msg"="re-queuing item due to error processing" "error"="error instantiating route53 challenge solver: unable to assume role: AccessDenied: User: arn:aws:sts::__OTHER_ACCOUNT__:assumed-role/eksctl-inkydev-addon-iamserviceaccount-cert-Role1-1E9S73WFKBTSN/1656038981897615525 is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::__ACCOUNT_ID__:role/AmazonEKSExternalDNSCrossAccount-Dev\n\tstatus code: 403, request id: 8ef6834b-752a-4865-9e07-3bcefa2110ef" "key"="monitoring/grafana-tls-8gkhf-4002345480-3499020834"
E0624 02:49:41.998650       1 controller.go:166] cert-manager/challenges "msg"="re-queuing item due to error processing" "error"="error instantiating route53 challenge solver: unable to assume role: AccessDenied: User: arn:aws:sts::__OTHER_ACCOUNT__:assumed-role/eksctl-inkydev-addon-iamserviceaccount-cert-Role1-1E9S73WFKBTSN/1656038981950336358 is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::__ACCOUNT_ID__:role/AmazonEKSExternalDNSCrossAccount-Dev\n\tstatus code: 403, request id: fc4ed32f-0684-49aa-89d9-f132da52adda" "key"="monitoring/grafana-tls-8gkhf-4002345480-3499020834"

this has side effects of increasing log size and API calls unnecessarily.
The order objects were all stuck in "pending"
Expected behaviour:
increase wait time between retries, perhaps raise error up to user?
Steps to reproduce the bug:
attach an ARN that doesn't have enough permissions
Anything else we need to know?:
Environment details::

Kubernetes version: 1.20
Cloud-provider/provisioner: EKS
cert-manager version: 1.8.0
Install method: helm

/kind bug

/remove-lifecycle rotten

/repoen

/reopen


New Elasticsearch article

We added 2 new libraries to Aspire:

Aspire.Hosting.Elasticsearch
Aspire.Elastic.Clients.Elasticsearch

See https://github.com/dotnet/aspire/pull/4430 for more details.
We should add an article on Elasticsearch and how to use it in .NET Aspire.

Duplicate of #1059


Final merge - with workflow file fix

Welcome to Codecov :tada:
Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.
Thanks for integrating Codecov - We've got you covered :open_umbrella:


Bump golang libraries to fix CVEs in Napa branch

The current version golang.org/x/crypto and golang.org/x/net in Napa branch is discovered CVEs

fixed by https://github.com/edgexfoundry/edgex-go/issues/4792

We discovered more CVEs

fixed by https://github.com/edgexfoundry/edgex-go/pull/4799


Initial implementation of diff-only update of objects

Lists will be compared if the length is preserved - otherwise rewritten.
Objects with primary key will always just be updated if they already exist in the database.
In the case of single link to object without primary key we compare each value individually.
Lists of objects without primary key wil not yet be compared.

Will list support be added to this? Because I suspect that setting list elements will actually be the majority of SET instructions?
I think a simple algorithm that traverses the list and if it finds a change, it goes back to clearing/rewriting the whole list. At worst that should be O(2N) and in the happy path we reduce the transaction log by quite a lot.
Also, from testing in the Java binding it looks like single object references are always overriden as well?

Added simple diffing on lists. Only done when size is the same.
Currently objects are always overwritten if there is no primary key.

@tgoyne Can this PR be further improved or can we merge it now?


actions-on-google not available in Maven Central

Has this artifact been moved or renamed? README.md shows this POM dependency:
<dependency>
	<groupId>com.tmsdurham.actions</groupId>
	<artifactId>actions-on-google</artifactId>
	<version>1.5.0</version>
	<type>pom</type>
</dependency>

but mvnrepository.com can't find it.
Maven Central search returns only one result that doesn't match the README:
Group ID: ca.sukhsingh.actions (README says  'com.tmsdurham.actions')
Artifact ID: actions-on-google (matches README)
Latest Version: 1.0.2 (README says 1.5.0)

Is there a new group ID or artifact ID?

@steveperkins I just checked https://github.com/Ticketmaster/actions-on-google-kotlin/blob/master/sdk/build.gradle and it looks like the group id changed to: com.tmsdurham.actions
and visible here on jcenter (not Maven Central): https://bintray.com/patjackson52/maven/com.tmsdurham.actions

The README for this project shows that it's intended to be in Maven Central as well under group ID com.tmsdurham.actions. Is the README wrong? Is the package in Maven Central under a different name?

Sorry, about that misleading readme.  I am in process of getting it on maven.  It is hosted on JCenter for now.  I do not use the maven build tool.  If the documentation is missing something to configure maven to use jcenter, a PR to update the docs would be appreciated.

Hi Patrick, I'm experiencing the same issue. I've added jcenter repository on my pom through
<repositories>
        <repository>
            <id>jcenter</id>
            <url>https://jcenter.bintray.com/</url>
        </repository>
    </repositories>

but it still gives me error: the only way I can use it is through IntelliJ search menu and still it gives me the 1.2.7 as last version (the others simply give me error).
Have you fixed this somehow?

Hi Patrick, I'm using jcenter repo to add your library on my project. Unfortunately it doesn't import DialogflowApp object (com.tmrdurham.actions.DialogflowApp).
Is it a common problem? Do you know some fix?

@davidmarinangeli are you using maven?  I have not used maven with this artifact and I am not much help in that area.

Yep, Maven: nevermind, I will try to make that work or I will create a gradle project. Have a nice weekend :)

Indeed "actions-on-google" looks pretty empty.
Try using "actions-on-google-core" instead. That one seems to have all the objects.
I've tested it today with Maven with the JCenter repository added.

@morbyx yes, -core is the bulk of the lib.  actions-on-google has a dependency on it, so both may be needed.  Were you able to get going?
Also V2 is in the works, so this may change slightly in the near future if you want V2.

I'm waiting for V2, these days I'm working with the node.js library but I would be really happy to come back to Kotlin/Java ;)


Hangs Out the phone

when changing jukebox player item queue main ui hangs up

I'm experiencing some main thread blockages as well when the Player Items are loading. I haven't been able to track it down yet. Anyone have any ideas on how to circumvent this?


remove gzip compression from stapler

Stapler adds some code to do gzip compression on the fly.
However there are various routes as pointed out in the code.
All modern containers (tomcat, weblogic, jetty) have support built in for doing compression which alleviates these tricks.
Therefore in the modern age, just remove any support in stapler for compression handling and make users user their servlet container appropriately if they desire the configuration.

If you can patch Winstone to apply compression by default (or perhaps at an option—unclear you want it for clients on the same LAN) then sure, would be great to simplify the code here.

quote from the jetty docs..

The Jetty GzipHandler is a compression handler that you can apply to any dynamic resource (servlet). It fixes many of the bugs in commonly available compression filters: it works with asynchronous servlets; it handles all ways to set content length. It has been tested with Jetty continuations and suspending requests.

my plan was to remote the support in stapler and then it is up to the end user using stapler to enable it (either via a load balancer, or configuration e.g. tomcat compression option in connector  and to add the jetty servlet dynamically in winstone if a flag to disable compression it is not provided


[Bug]: Dockerfile tries to install requirements/base.txt which does not exist

Describe the bug
Hi,
When trying to open the repo in a container in VSCode, I caught an error.
It seems like the Dockerfile tries to install base.txt which does not exist.
COPY ./requirements/base.txt /tmp/anomalib/requirements/base.txt
Dataset
N/A
Model
N/A
Steps to reproduce the behavior

Clone the repo.
Open it in VSCode Container.

OS information
OS information:

OS: Ubuntu 22.04.3 LTS
Anomalib version: main branch

Expected behavior
Error when building Docker due to the absence of base.txt file.
Screenshots
No response
Pip/GitHub
pip
What version/branch did you use?
main
Configuration YAML
N/A

Logs
=> ERROR [anomalib_development_env 1/7] COPY ./requirements/base.txt /tm  0.0s
------
 > [anomalib_development_env 1/7] COPY ./requirements/base.txt /tmp/anomalib/requirements/base.txt:
------
[2024-02-26T22:51:14.599Z] Dockerfile-with-features:67
--------------------
  65 |
  66 |     # Install all anomalib requirements
  67 | >>> COPY ./requirements/base.txt /tmp/anomalib/requirements/base.txt
  68 |     RUN pip install --no-cache-dir -r /tmp/anomalib/requirements/base.txt
  69 |
--------------------
[2024-02-26T22:51:14.599Z] ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref ijzaf3bamlbf0jye5mopicmg3::tuwtj7wj3ie5o7klledci3esh: "/requirements/base.txt": not found
[2024-02-26T22:51:14.617Z] Stop (76759 ms): Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-duthngo/container-features/0.54.1-1708987797855/Dockerfile-with-features -t vsc-anomalib-1edfedc330af18949a8666985896c78dce1f1deed07f3ebb7fa856896e519be6 --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=anomalib_development_env /home/duthngo/anomalib

Code of Conduct

[X] I agree to follow this project's Code of Conduct

According to this, I think it requires only changing base.txtto installer.txt.

Thanks for reporting this. We have recently merged PR https://github.com/openvinotoolkit/anomalib/pull/1748 . The changes should be reflected here in the dockerfile

I'll submit a PR soon. Thanks

Great, thanks!


[metrics] fixing bug in total processed size metric default value

to @austinbyers
size: small
Changes

I discovered a bug where the TotalProcessedSize metric was using the wrong default lookup value. This fixes that.

Coverage remained the same at 95.231% when pulling ba7d6d0e7958b615f3820a944a39d14380267436 on ryandeivert-metric-default-value-bug into f65e97874009cf0d2ef359973b81f0fb3f50d684 on master.


Session write should be removed in ScopeSessions.php

Bug description
If the developer forgets to write the tenant session after logging in, for example, modify the x-tenant-id when the next request is made, the middleware will judge that there is no session and write the tenant of the new request, breaking the restriction of the session scope.
class ScopeSessions
{
    public static $tenantIdKey = '_tenant_id';

    public function handle(Request $request, Closure $next)
    {
        if (! tenancy()->initialized) {
            throw new TenancyNotInitializedException('Tenancy needs to be initialized before the session scoping middleware is executed');
        }

        // Remove the below
        /*
        if (! $request->session()->has(static::$tenantIdKey)) {
            $request->session()->put(static::$tenantIdKey, tenant()->getTenantKey());
        } else {
            if ($request->session()->get(static::$tenantIdKey) !== tenant()->getTenantKey()) {
                abort(403);
            }
        }*/

        // and add the below
        if ($request->session()->get(static::$tenantIdKey) !== tenant()->getTenantKey()) {
             abort(403);
        }

        return $next($request);
    }
}

Steps to reproduce
Do not write session after login, modify the x-tenant-id when the next request is made, the middleware will judge that there is no session and write the tenant of the new request, breaking the restriction of the session scope.
Expected behavior
Direct forced check session.
Laravel version
v9.1.2
stancl/tenancy version
v3.5.4

Please fill out the template

I don't understand why I write a session when it is judged that it doesn't exist, which makes me very confused. Please help me.

Not sure what the problem is. The if (! ...) case sets the value.


KAFKA-3728 EndToEndAuthorizationTest offsets_topic misconfigured

Set OffsetsTopicReplicationFactorProp to 3 like MinInSyncReplicasProp
and OffsetCommitRequiredAcksProp to 1 to avoid timeouts
unit test for consumer that subscribes added

Hi @ijuma I've