Skip to content

fix: enable --ensure-no-loss false flag to disable functionality#187

Merged
troykessler merged 2 commits intoKYVENetwork:mainfrom
Liver-23:fix/ensure-no-loss-flag
Feb 2, 2026
Merged

fix: enable --ensure-no-loss false flag to disable functionality#187
troykessler merged 2 commits intoKYVENetwork:mainfrom
Liver-23:fix/ensure-no-loss-flag

Conversation

@Liver-23
Copy link
Contributor

Summary

This PR completes the fix for the --ensure-no-loss flag, allowing users to properly disable the functionality by passing --ensure-no-loss false.

Changes

  • Updated option definition in both tools/kysor/src/commands/start.ts and common/protocol/src/index.ts:

    • Changed from --ensure-no-loss (boolean flag) to --ensure-no-loss [value] (option that accepts a value)
    • Changed default from boolean true to string "true" for proper parsing
    • Updated description to indicate users can set to false to disable
  • Fixed kysor.ts logic (tools/kysor/src/kysor.ts):

    • Replaced incomplete if/else logic with proper value handling
    • Added type normalization to handle both string and boolean types
    • Properly handles the false case by passing --ensure-no-loss false
    • For true or default case, just passes the flag (defaults to true)
  • Updated version numbers in package.json files

Expected Behavior

  • --ensure-no-loss or no flag → defaults to true (enabled) ✅
  • --ensure-no-loss false → disables the functionality ✅
  • --ensure-no-loss true → explicitly enables (same as default) ✅

Testing

After applying these changes, verify:

  1. ./kysor start --valaccount <name> --ensure-no-loss false should disable ensureNoLoss
  2. ./kysor start --valaccount <name> --ensure-no-loss should enable ensureNoLoss (default)
  3. ./kysor start --valaccount <name> (without flag) should enable ensureNoLoss (default)

Related

This completes the fix that was partially addressed in PR #185, which fixed parsing but didn't allow users to pass --ensure-no-loss false to disable the functionality.

- Update option definition to accept [value] parameter in both kysor and protocol
- Change default from boolean true to string "true" for proper parsing
- Fix kysor.ts logic to properly handle false case by passing --ensure-no-loss false
- Add proper type normalization to handle both string and boolean types
- Update version numbers in package.json files

This completes the fix for ensureNoLoss flag, allowing users to disable
the functionality by passing --ensure-no-loss false.
@troykessler troykessler merged commit f01a581 into KYVENetwork:main Feb 2, 2026
2 of 3 checks passed
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