fix: add missing logger to SubmitConfirmationModal #123

Open
cal wants to merge 1 commits from fix/submit-modal-missing-logger into main
Owner

Summary

  • SubmitConfirmationModal.on_submit error handler referenced self.logger but __init__ never set it
  • This caused AttributeError that silently swallowed the real error — users saw nothing when /ilmove submission failed
  • Fix: add self.logger = get_contextual_logger(...) in __init__, import get_contextual_logger

Test plan

  • 983/983 bot tests pass
  • Trigger a transaction submission error and verify the error message is shown to the user

🤖 Generated with Claude Code

## Summary - `SubmitConfirmationModal.on_submit` error handler referenced `self.logger` but `__init__` never set it - This caused `AttributeError` that silently swallowed the real error — users saw nothing when `/ilmove` submission failed - Fix: add `self.logger = get_contextual_logger(...)` in `__init__`, import `get_contextual_logger` ## Test plan - [x] 983/983 bot tests pass - [ ] Trigger a transaction submission error and verify the error message is shown to the user 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cal added 1 commit 2026-04-02 13:30:52 +00:00
The error handler at line 384 referenced self.logger but __init__
never set it, causing AttributeError that silently swallowed the
real error from users.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude added the
ai-reviewing
label 2026-04-02 13:45:16 +00:00
Claude reviewed 2026-04-02 13:46:07 +00:00
Claude left a comment
Collaborator

AI Code Review

Files Reviewed

  • views/transaction_embed.py (modified)

Findings

Correctness

  • Fix is correct. SubmitConfirmationModal.on_submit line 384 calls self.logger.error(...) inside the outer except Exception handler, but self.logger was never set in __init__. Without this fix, any submission error triggers an AttributeError on self.logger, which discord.py silently discards — the user sees nothing. The added assignment resolves this completely.
  • Import placement is correct: get_contextual_logger inserted after import discord and before the service imports.

Security

  • No issues. The fix only adds a logger initialization; no user input is involved.

Style & Conventions

  • self.logger = get_contextual_logger(f"{__name__}.SubmitConfirmationModal") matches the project-standard pattern documented in CLAUDE.md exactly.
  • SubmitConfirmationModal inherits directly from discord.ui.Modal rather than the project's BaseModal (which already initializes a logger). That's a pre-existing design choice — not introduced by this PR — and the inline fix is the minimal correct approach.

Suggestions

  • No blockers. As a follow-up, SubmitConfirmationModal could inherit from BaseModal to get error handling, logging, and timeout handling for free. This is out of scope for a targeted bug fix.

Verdict: COMMENT

Minimal, correct fix. Logger initialized using the project-standard pattern, 983/983 tests pass. No issues found.


Automated review by Claude PR Reviewer

## AI Code Review ### Files Reviewed - `views/transaction_embed.py` (modified) ### Findings #### Correctness - Fix is correct. `SubmitConfirmationModal.on_submit` line 384 calls `self.logger.error(...)` inside the outer `except Exception` handler, but `self.logger` was never set in `__init__`. Without this fix, any submission error triggers an `AttributeError` on `self.logger`, which discord.py silently discards — the user sees nothing. The added assignment resolves this completely. - Import placement is correct: `get_contextual_logger` inserted after `import discord` and before the service imports. #### Security - No issues. The fix only adds a logger initialization; no user input is involved. #### Style & Conventions - `self.logger = get_contextual_logger(f"{__name__}.SubmitConfirmationModal")` matches the project-standard pattern documented in `CLAUDE.md` exactly. - `SubmitConfirmationModal` inherits directly from `discord.ui.Modal` rather than the project's `BaseModal` (which already initializes a logger). That's a pre-existing design choice — not introduced by this PR — and the inline fix is the minimal correct approach. #### Suggestions - No blockers. As a follow-up, `SubmitConfirmationModal` could inherit from `BaseModal` to get error handling, logging, and timeout handling for free. This is out of scope for a targeted bug fix. ### Verdict: COMMENT Minimal, correct fix. Logger initialized using the project-standard pattern, 983/983 tests pass. No issues found. --- *Automated review by Claude PR Reviewer*
Claude added
ai-reviewed
and removed
ai-reviewing
labels 2026-04-02 13:46:57 +00:00
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/submit-modal-missing-logger:fix/submit-modal-missing-logger
git checkout fix/submit-modal-missing-logger
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/major-domo-v2#123
No description provided.