Skip to content

Complete subsecond fields for mixed-precision attribute packets - #168

Open
OskarEichler wants to merge 1 commit into
net-ssh:masterfrom
OskarEichler:codex/mixed-timestamp-precision
Open

Complete subsecond fields for mixed-precision attribute packets#168
OskarEichler wants to merge 1 commit into
net-ssh:masterfrom
OskarEichler:codex/mixed-timestamp-precision

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

When any timestamp requests subsecond encoding, provide zero nanoseconds for the other present whole-second timestamps, including v6 ctime.

Reproduction

V04::Attributes.new(atime: 100, atime_nseconds: 123, mtime: 200).to_s raises TypeError on baseline because the shared flag requires an mtime nanosecond field but its value is nil. Fixed serializes mtime nanoseconds as zero. The same issue affects v6.

Verification

  • Baseline and this isolated patch: 433 existing tests, 1,201 assertions, zero failures/errors/skips, Ruby 4.0.6 through rbenv, net-ssh 7.3.3, Minitest 5.27.0 and Mocha 2.1.0.
  • 1,026 external assertions cover every absent/whole-second/precise combination for v4 and v6, complete packet consumption, preserved seconds and repeatable serialization. The shared flag follows the file-transfer draft attribute layout.
  • The combined consumer candidate also passes 10,384 external model assertions, 21 local OpenSSH pipe assertions, and the existing suite with frozen string literals enabled and disabled. These combined checks include separately attributed portions of Handle frozen strings #157/ensure ruby 4 compatibility and address some security concerns #162; they are not claimed as this isolated branch's changes.
  • Packaging preserves all 37 release paths and dependency metadata. All 26 runtime files compile on Ruby 4.0.6 and parse with Parser::Ruby25. Comparative Lint checks retain the same 33 baseline findings; no all-green lint claim.

Breaking changes and limitations

No signature change. Mixed-precision inputs that failed now serialize; missing nanosecond values for present timestamps become zero during serialization. Whole-second-only packets remain without the subsecond flag. Nanoseconds without their corresponding seconds and other invalid input validation are not broadened. No native v4/v6 server was available; these are packet-level checks.

No repository tests were added or modified under the contribution's no-new-tests constraint; focused repro/model drivers ran outside the repository. An external verification Gemfile supplies compatible test tools and RDoc without changing upstream tooling. Actual older Ruby/JRuby/Windows compatibility and upstream CI have not been verified. No production or SSH connections, version bumps, release-tool changes or unrelated modernization are included. Git builds are not signed by the upstream gem release key.

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.

1 participant