Skip to content

fix: omit unset setOptions fields from transaction summary - #10

Merged
ZeePearl56 merged 1 commit into
mainfrom
fix/setoptions-null-summary
Sep 16, 2026
Merged

ZeePearl56 merged 1 commit into
mainfrom
fix/setoptions-null-summary

Conversation

@Hollujay

Copy link
Copy Markdown
Contributor

Summary

  • Fix the setOptions decoder handling of absent optional numeric fields.
  • Prevent literal null from appearing in signer-facing transaction summaries.
  • Preserve explicit values, including 0, as real transaction instructions.
  • Update the shared decoder fixture and regression coverage.

Problem

@stellar/stellar-sdk represents absent Optional<uint32> values in
SetOptionsOp as null.

The decoder previously checked those fields with !== undefined, causing
absent fields to render as literal null.

That inaccurately suggested the transaction was modifying account properties
that were actually untouched.

Fix

The six affected guards now use != null:

  • masterWeight
  • lowThreshold
  • medThreshold
  • highThreshold
  • setFlags
  • clearFlags

Absent fields are omitted from the summary, while explicit values such as
masterWeight: 0 remain visible.

Testing

  • npm test — 56/56 passed
  • npm run typecheck — passed
  • npm run lint — passed
  • git diff --check — clean

Scope

This PR only changes the setOptions decoder behavior and its regression
coverage.

No signing, submission, database, dependency, or CI behavior was changed.

The corresponding coordinator-web fix will be landed separately to preserve
the two-repository decoder parity.

@ZeePearl56
ZeePearl56 merged commit 2b9cdd9 into main Sep 16, 2026
1 check passed
@ZeePearl56
ZeePearl56 deleted the fix/setoptions-null-summary branch September 16, 2026 14:37
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