Skip to content

[Livecomponent] Livecomponent breaks on integer overflow and stays broken #3137

@mmarton

Description

@mmarton

Hi all!

Example:

<?php

namespace App\Twig\Components;

use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
use Symfony\UX\LiveComponent\Attribute\LiveProp;
use Symfony\UX\LiveComponent\DefaultActionTrait;

#[AsLiveComponent]
final class Test
{
    use DefaultActionTrait;

    #[LiveProp(writable: true)]
    public int $count = 0;
}
<div{{ attributes }}>
    <input type="text" data-model="count">
    {{ count|number_format }}
</div>

If you put a number larger than PHP_INT_MAX into the input field, then you get an
Invalid checksum sent when updating the live component. Exception.

Thats ok, but it could be more precise.
The problem is that if I delete, or change a smaller number below int_max, the error stays until I reload the page.

Image

Is there a way to prevent this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions