Skip to content

Feat/per session logging#69

Merged
shiliu-yang merged 21 commits into
refactor/v3from
feat/per-session-logging
Jun 29, 2026
Merged

Feat/per session logging#69
shiliu-yang merged 21 commits into
refactor/v3from
feat/per-session-logging

Conversation

@shiliu-yang

Copy link
Copy Markdown
Contributor

No description provided.

…ailed mapping, existingUuid, lockFailed cleanup, auth_write error)
If a device was authorized without lock_otp, a second run with
lock_otp=true now detects this via the Excel STEP/STATUS column
(already_otp_locked from find_by_mac) and sends auth-otp-lock in
the AlreadyDone branch instead of short-circuiting.

Also fix DisclaimerModal confirm button class (ty-btn-primary-solid).
…te credentials

When conflict_policy=Skip and a device already carries an auth code, the
MAC-keyed flow no longer marked that code's Excel row as used (the old
find_and_confirm_by_uuid was dropped). If that UUID still sat in an
Available row (cross-Excel reuse, re-exported sheet, cleared MAC column),
allocate_row could later hand the same code to a different device.

Add ExcelRowAllocator::confirm_existing_uuid, which claims the matching
Available row for this MAC (binds MAC, marks Done) and is a no-op for
unknown or already-bound rows. The Skipped branch in batch_auth_start
calls it. Restores the duplicate-credential guard under the new model.
…>-N.log

Per-session log files previously had no in-session size limit: the CLI
dropped its 5MB rotation and the GUI removed tauri-plugin-log's
max_file_size, so a long-running session could grow one file without
bound (prune only runs at startup and always keeps >=1 file).

- CLI: new SessionLogWriter caps the active file at 10MB and rolls over
  to tyutool-<ts>-1.log, -2.log, ... (fern has no rotation of its own).
- GUI: restore tauri-plugin-log max_file_size(10MB) + KeepAll; rolled
  files keep the tyutool- prefix so prune_log_files/list_log_files still
  manage them.

Update the pick_active_log test to match the newest-by-mtime behavior.
The backend removed the LockFailed result/event, so slot.lockFailed was
permanently undefined while the UI still rendered a "Lock failed" badge,
gated retry on !lockFailed, and the disclaimer referenced "(lockFailed)".
OTP-lock failure now surfaces as an ordinary failed step (with error
text) and is retryable — a retry re-attempts the lock via the
already-done supplement-lock path.

Remove the lockFailed field, slot-row branches, store retry guards,
the lockFailedLabel/Badge i18n keys, and the disclaimer mention; prune
the tests that exercised the removed exclusion behavior.
….md, CLAUDE.md

Logs are now tyutool-<timestamp>.log (capped at 10MB, rolling to -N.log),
not tyutool.log. Update the bug-report template path, docs/cli.md log
locations, and CLAUDE.md (routing table, Bounded-growth and
active-filename rules) to match. Required by the CLAUDE.md rule that log
file-location changes update the issue template.
find_by_mac returns the first matching row, so a MAC duplicated across
rows (manual edit, copy/paste) would silently route a device to the
wrong credential. Detect duplicate non-empty MACs in load() and emit a
log::warn so the operator can spot it; loading is not blocked.
@shiliu-yang shiliu-yang force-pushed the feat/per-session-logging branch from 0cbdcc9 to 53da4af Compare June 29, 2026 12:27
- is_default_mac: use eq_ignore_ascii_case instead of comparing
  to_ascii_uppercase() (manual_ignore_case_cmp).
- run_batch_auth_slot: allow too_many_arguments — the three row callbacks
  (find_by_mac / allocate_row / update_row) plus context are intentional.
- session-writer test: assert the write() return count (unused_io_amount).
@shiliu-yang shiliu-yang merged commit 6cff497 into refactor/v3 Jun 29, 2026
3 checks passed
@shiliu-yang shiliu-yang deleted the feat/per-session-logging branch June 29, 2026 12:34
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