You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Binary uuid started creating error "Json malformed (Errno: 5)" even with use of a custom attribute modifier to cast from bytes to string and string to bytes. It worked fine for months till I updated from v13.5.1 to v13.6.3. I downgraded to v13.5.1 and it started working back fine as expected.
Expected Behaviour
After investigation, it looks like my custom BinaryUuid::class is no longer called and the object to be casted into json still contains binary information. With v13.5.1 I can confirm that it my attribute modifiers is called to cast binary data into string
Steps to Reproduce
Here is the class I used in my models that have binary uuid (Dyryndra/Laravel-efficient-uuid):
`class BinaryUuid implements AttributeEncoder
{
public static function encode($value)
{
if (blank($value)) {
return null;
}
return Uuid::fromBytes($value)->toString();
}
public static function decode($value)
{
if (blank($value)) {
return null;
}
return Uuid::fromString(strtolower($value))->getBytes();
}
I am sure at 90% that my custom cipher class (BinaryUuid::class) I gave in attributeModifiers is no longer getting called. When I put die("CALLED") in the encode function, I can see the message printed in the debugger for the v13.5.1 but it doesn't show when I am under v13.6.3 which mean the function is not called to cast the binary data before attempting to store it, which create the Malformed UTF-8 characters error
I have released 13.6.4 where the queue feature is disabled by default (as it should have been, sorry). I expect avoiding the serialization for queue should mitigate the problem. If not, let me know and stick to v13.5.1 in production.
Actual Behaviour
Binary uuid started creating error "Json malformed (Errno: 5)" even with use of a custom attribute modifier to cast from bytes to string and string to bytes. It worked fine for months till I updated from v13.5.1 to v13.6.3. I downgraded to v13.5.1 and it started working back fine as expected.
Expected Behaviour
After investigation, it looks like my custom BinaryUuid::class is no longer called and the object to be casted into json still contains binary information. With v13.5.1 I can confirm that it my attribute modifiers is called to cast binary data into string
Steps to Reproduce
Here is the class I used in my models that have binary uuid (Dyryndra/Laravel-efficient-uuid):
`class BinaryUuid implements AttributeEncoder
{
}`
And then I do this in Models:
protected $attributeModifiers = [ "id" => BinaryUuid::class, "withhold_of" => BinaryUuid::class, "slavery" => BinaryUuid::class, "pin" => RightRedactor::class ];
Possible Solutions
If you have any ideas on how to solve the issue, add them here, otherwise you can omit this part.
The text was updated successfully, but these errors were encountered: