Skip to content

fix: サーバー500エラー修正 + 登録後の通知設定フォローアップ対応#16

Merged
fezzlk merged 1 commit intomainfrom
fix/nlp-notify-followup-and-500-errors
Mar 4, 2026
Merged

fix: サーバー500エラー修正 + 登録後の通知設定フォローアップ対応#16
fezzlk merged 1 commit intomainfrom
fix/nlp-notify-followup-and-500-errors

Conversation

@fezzlk
Copy link
Copy Markdown
Owner

@fezzlk fezzlk commented Mar 4, 2026

Summary

Bug fixes(本番で500エラー発生中)

  • stock.notify_enabledstock.notify_days_before is not None に修正(Stock エンティティに存在しない属性を参照していた)
  • url_for('views_blueprint.stock_trash')url_for('views_blueprint.view_deleted_stock_list') に修正(誤ったエンドポイント名)

Feature: 登録後の通知設定フォローアップ

  • アイテム登録(期限あり)確認後に update_recent_notify コンテキストを保存
  • update_recent_expiry(期限フォローアップ)解決後も同様にチェーン
  • フォローアップメッセージ(「通知は3日前から」等)はアイテム名を補完して NLP に渡すことで認識
  • 正規表現ではなく既存の Function Calling ベース NLP を活用

Test plan

  • / ホームページが 500 エラーなく表示される
  • /stock アイテム一覧が 500 エラーなく表示される(削除済みボタンのリンクが正常)
  • LINEで「牛乳 3/15まで」登録確認 → 「通知は3日前から」で通知設定が反映される
  • venv/bin/pytest src/UseCases/Line/tests/test_handle_intent_operation_use_case.py -v が全パス

🤖 Generated with Claude Code

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b466e365fb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

notify_on_count = 0
for stock in stocks:
if stock.notify_enabled:
if stock.notify_days_before is not None:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include always-notify stocks in notify-on KPI

notify_on_count is incremented only when notify_days_before is not None, but this codebase treats notify_days_before == None as “常に通知” (for example _should_notify returns True in src/UseCases/Line/CheckExpiredStockUseCase.py:11). As a result, stocks configured for always-notify are excluded from the “通知ONアイテム” dashboard metric, so the KPI is systematically undercounted (often near zero) even when notifications are effectively enabled.

Useful? React with 👍 / 👎.

- fix: stock.notify_enabled → notify_days_before is not None (Stock エンティティに存在しない属性参照)
- fix: url_for('stock_trash') → url_for('view_deleted_stock_list') (誤ったエンドポイント名)

- feat: アイテム登録後に通知設定をフォローアップメッセージで変更可能に
  - 期限あり登録確認後に update_recent_notify コンテキストを保存
  - update_recent_expiry 解決後も同様にチェーン
  - アイテム名を補完して NLP に渡すことで「通知は3日前から」などを認識
  - DummyIntentParserService に extra_responses 対応を追加

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fezzlk fezzlk force-pushed the fix/nlp-notify-followup-and-500-errors branch from b466e36 to 69951ef Compare March 4, 2026 00:23
@fezzlk fezzlk merged commit b8b63e4 into main Mar 4, 2026
4 checks passed
@fezzlk fezzlk deleted the fix/nlp-notify-followup-and-500-errors branch March 4, 2026 00:24
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