Skip to content

Conversation

@pRizz
Copy link
Owner

@pRizz pRizz commented Feb 4, 2026

Summary

Upgrade the whoami crate from version 1.5 to 2.1, which introduces a breaking API change where whoami::username() now returns a Result instead of a String. This PR updates the dependency and handles the potential error case gracefully.

Changes

  • Upgrade whoami dependency from 1.5 to 2.1 in packages/core/Cargo.toml
  • Update Cargo.lock to reflect new whoami 2.1.0 and its transitive dependencies:
    • wasite upgraded from 0.1.0 to 1.0.2
    • wasi pinned to 0.11.1+wasi-snapshot-preview1 in existing dependencies
    • New wasi 0.14.7+wasi-0.2.4 added as a dependency of wasite
  • Update default_user() function in packages/core/src/host/schema.rs to handle the Result return type by providing a fallback value of "user" when username retrieval fails

Type of Change

  • Dependency upgrade (non-breaking change that updates external crate)
  • Bug fix (handles potential errors in username retrieval)

Testing

Describe how you tested your changes:

  • Unit tests pass (just test-rust)
  • Linting passes (just lint)
  • Manual testing performed

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Related Issues

N/A

https://claude.ai/code/session_01FjPuTe8aJr25G84ScsaTvn

The whoami crate 2.x changed username() to return Result<String, Error>
instead of String. Update the dependency and fix the default_user()
function to handle the new API by unwrapping with a "user" fallback.

Fixes #18

https://claude.ai/code/session_01FjPuTe8aJr25G84ScsaTvn
@pRizz pRizz merged commit 2ca0c98 into main Feb 4, 2026
4 checks passed
@pRizz pRizz deleted the claude/fix-issue-18-4T6TJ branch February 4, 2026 03:42
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.

3 participants