Conversation
- New validation.py with validate_email, validate_username, validate_password functions matching server constraints (username 1-39 chars, alphanumeric + underscores/hyphens; email format + domain dot; password min 8 chars) - get_new_user_information() now re-prompts per field on invalid input rather than sending bad data to the API - Added password confirmation prompt with mismatch re-prompt loop - 19 unit tests for validators, 7 integration-style tests for the full registration prompt flow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add _extract_error_message() helper that surfaces plain text server responses, falls back to DRF JSON extraction, then to a generic string - register_user(), login_user(), register_system() now print clean messages for 409/422 (server text) and 401 (hardcoded "Incorrect username or password."); all other status codes also attempt extraction before falling back to a generic message - Fix typo: "Lets retry" -> "Let's retry" - 17 new tests covering extraction logic and all three call sites Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add type annotations to all functions and tricky variables across all source files using from __future__ import annotations for Python 3.9+ compatibility with X | None and list[X] syntax - Use TypeVar on Serializable.from_JSON/from_JSON_list so subclass calls return the correct type (e.g. LoginResponse.from_JSON returns LoginResponse) - Add mypy and ruff configs to pyproject.toml; add dev dependency group with mypy, ruff, types-requests, types-python-dateutil - Fix real bugs caught by mypy: get_mac_address variable type reuse, get_user_information_and_login returning None instead of (None, None, None), SystemPatch.__str__ concatenating nullable fields, traceback.format_exc called with wrong signature, missing return in get_system_information - Clean up stale/duplicate imports, unused variables, == None comparisons, star imports replaced with explicit imports throughout Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Asserts are stripped in optimized mode (-O) and give unhelpful errors. Replace with proper if-guards that exit gracefully with a user-facing message, matching the existing error handling style in the file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Install .[dev] in CI to pull in mypy, ruff, and type stubs - Run ruff and mypy as steps before pytest on every push - Consolidate separate access_token/system_name None checks into one guard Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tions The mac fingerprint used to identify a system with the server was recomputed from uuid.getnode() on every run and never persisted, so any drift (multi-interface boxes, VPN/Docker churn, random-mac fallbacks) caused get_system_information to 404 and forced a duplicate registration under a new name. This was most commonly hit on routine `bashhub update` runs, where update_system_info 404s on PATCH and the installer falls through to bashhub setup. Treat ~/.bashhub/config as the source of truth for the mac. On any successful server interaction (register, PATCH, or name-fallback resolve), pin the agreed-on value into config so future runs read it back instead of recomputing. Add a name-fallback self-heal to both update_system_info and handle_system_information using the server's existing GET ?mac=&name= fallback and PATCH-with-mac-in-body support — no server changes needed. Plan and follow-ups (py-machineid adoption, explicit-confirm name reclaim) captured in docs/tasks/mac-fingerprint-stabilization-plan.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.