Files
logos-protocol/cpp
Dario LipicarandClaude Opus 4.8 4775e635ff fix(json-convert): preserve integer types inside QVariant containers (#21)
* fix(json-convert): preserve integer types inside containers

qvariantToNlohmann() kept integer QVariant types only for a top-level scalar;
a QVariantList/QVariantMap fell through to QJsonValue::fromVariant, which
degrades every numeric to double at every depth. So a `[int]`/`[uint]`/
`[float64]`/`[bool]` method arg (a QVariantList of ints) arrived as a float
array, and the generated cdylib dispatch's strict .get<std::vector<int64_t>>()
threw -> the param decoded as an EMPTY vector. Surfaced by a UI plugin driving
[int] method args over QtRO.

Recurse into QVariantList/QStringList/QVariantMap element-by-element so nested
integers keep their type (and bytes/maps/lists keep their shape); also route the
LogosResult value through the same recursion. Adds JsonConvertInts tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* test: pin LongLong container test with values > 2^53

Copilot review: (10, 20) survive an accidental IEEE-754 double detour, so they
did not actually pin the integer-preservation regression. Use 2^53+1 and
INT64_MAX, which lose precision / serialize in scientific notation if degraded.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 16:22:06 -03:00
..