Skip to content

Conversation

@adhami3310
Copy link
Member

No description provided.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 2, 2026

CodSpeed Performance Report

Merging #6073 will not alter performance

Comparing add-uuid-to-deserializers (3168ca2) with main (5b3aa27)

Summary

✅ 8 untouched

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 2, 2026

Greptile Summary

Added uuid.UUID to the _deserializers dictionary to enable automatic conversion of string values to UUID objects when passed as event handler parameters.

  • Imported the uuid module
  • Added uuid.UUID: uuid.UUID entry to _deserializers dictionary, following the same pattern as existing deserializers for datetime types
  • Enables event handlers with UUID-typed parameters to receive properly deserialized UUID objects instead of raw strings

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is minimal, follows established patterns in the codebase (identical to datetime deserializers), and simply adds UUID support to the existing deserialization mechanism. The uuid.UUID constructor accepts string values and will raise ValueError on invalid input, which is already handled by the existing error handling at reflex/state.py:1942-1944
  • No files require special attention

Important Files Changed

Filename Overview
reflex/state.py Added uuid.UUID deserializer to enable string-to-UUID conversion for event handler parameters

Sequence Diagram

sequenceDiagram
    participant Client
    participant EventHandler
    participant Deserializer
    participant UUIDClass

    Client->>EventHandler: Send event with UUID string parameter
    EventHandler->>EventHandler: Check parameter type hint
    EventHandler->>Deserializer: Lookup deserializer for uuid.UUID
    Deserializer->>Deserializer: Find uuid.UUID in _deserializers dict
    Deserializer->>UUIDClass: Call uuid.UUID(string_value)
    UUIDClass->>Deserializer: Return UUID object
    Deserializer->>EventHandler: Return deserialized UUID
    EventHandler->>EventHandler: Execute handler with UUID object
Loading

@masenf
Copy link
Collaborator

masenf commented Jan 3, 2026

a test case might be cool

@masenf masenf merged commit 6718679 into main Jan 6, 2026
48 checks passed
@masenf masenf deleted the add-uuid-to-deserializers branch January 6, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants