Skip to content

fix: remove dead serialize_dict call in format_prop - #7587

Open
masenf wants to merge 1 commit into
mainfrom
claude/project-thread-8w0spl
Open

masenf wants to merge 1 commit into
mainfrom
claude/project-thread-8w0spl

Conversation

@masenf

@masenf masenf commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Masen · project thread

Before: format_prop({"a": 1}) raised AttributeError: module 'reflex_base.utils.serializers' has no attribute 'serialize_dict'. The dict branch in format_prop called a serializer that no longer exists, hidden behind a pyright-ignore.

After: a plain dict is JSON-encoded like every other literal and wrapped in braces, so format_prop({"a": 1}) returns {{"a": 1}}.

The branch was unreachable from inside the framework, since every internal caller passes a Var or EventChain and returns earlier; only direct callers with a raw dict hit it.

How: drop the isinstance(prop, dict) branch and the unused serializers import so dicts fall through to json_dumps, which already encodes nested values through the registered serializers. Adds a regression test and a reflex-base news fragment.

Closes ENG-10109.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Generated by Claude Code

View guided diff Turn on auto-fix

format_prop's dict branch called serializers.serialize_dict, which no
longer exists, so a plain dict raised AttributeError instead of being
formatted. Every framework caller passes a Var or EventChain and returns
before reaching it, so the branch was dead internally. Let dicts fall
through to json_dumps like every other literal, which encodes nested
values through the registered serializers.

Closes ENG-10109.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmkRjNPQfbihbxXpYNqXh6
@masenf
masenf requested a review from a team as a code owner October 16, 2026 23:23
@linear-code

linear-code Bot commented Oct 16, 2026

Copy link
Copy Markdown

ENG-10109

@masenf masenf self-assigned this Oct 16, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack

View guided diff | Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Fixes format_prop for plain dictionaries by removing the call to the missing serialize_dict function.

  • Plain dictionaries now format as JSON props wrapped in braces.

Reviews (1) · Last reviewed commit: "fix: remove dead serialize_dict call in ..." · Reviewed by Greptile

@codspeed

codspeed Bot commented Oct 16, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 17 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 148 untouched benchmarks


Comparing claude/project-thread-8w0spl (d5e3eb2) with main (5ae5dcd)

Open in CodSpeed

This branch has not been deployed

No deployments
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.

2 participants