Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.

Centralise payload conversion utilities#200

Merged
brothercorvo merged 1 commit intomainfrom
corvo/add-conversion-module-and-improve-client
Nov 11, 2025
Merged

Centralise payload conversion utilities#200
brothercorvo merged 1 commit intomainfrom
corvo/add-conversion-module-and-improve-client

Conversation

@brothercorvo
Copy link
Copy Markdown
Contributor

Summary

  • add a conversion module to decode MessagePack/zlib payloads and normalise dataclass responses
  • update LXMFClient plus the Emergency Management client and gateway to use the shared helpers
  • extend unit tests to cover conversion helpers and refresh example and integration tests

Testing

  • pytest

Codex Task

@brothercorvo brothercorvo merged commit 4f3f24e into main Nov 11, 2025
0 of 2 checks passed
@brothercorvo brothercorvo deleted the corvo/add-conversion-module-and-improve-client branch November 11, 2025 13:52
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +171 to +175
convert_value(key_type, raw_key)
if key_type not in {Any, object}
else raw_key
)
result[str(key)] = convert_value(value_type, raw_value)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve dictionary key types during conversion

The mapping branch of convert_value coerces every converted key to a string (result[str(key)] = …) even when the target type specifies non‑string keys. For annotations such as Dict[int, Foo] or Dict[Enum, Bar] the integer/enum key is computed correctly but then immediately stringified, so callers receive a Dict[str, …] instead of the requested type. This silently breaks code that relies on integer or enum lookups and differs from the previous decoders that preserved key types. Only convert to string when the requested key type is unconstrained; otherwise keep the converted key’s native type.

Useful? React with 👍 / 👎.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant