Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 returning nil instead of empty CmpExpr in FilterDuration #584

Merged
merged 1 commit into from
Feb 16, 2025

Conversation

iChemy
Copy link
Contributor

@iChemy iChemy commented Feb 15, 2025

GET: /api/events が 400 bad request: invalid expression を返してくる問題を修正

@iChemy iChemy requested a review from Nzt3-gh February 15, 2025 12:59
@iChemy
Copy link
Contributor Author

iChemy commented Feb 15, 2025

クエリに dateBegindateEnd のどちらも含まれていない場合,
FilterDuration には time.Time{}, time.Time{} が渡され, since.IsZero() && until.IsZero()true となって&CmpExpr{} が返されてしまう.

空の &CmpExpr が含まれた Expression が createEventFilter に入ると ErrExpression が投げられる.

ので &CmpExpr{} じゃなくて nil を返すべきだった.

@mathsuky mathsuky self-requested a review February 16, 2025 06:42
Copy link
Contributor

@mathsuky mathsuky left a comment

Choose a reason for hiding this comment

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

すみません,自分の変更で壊していました...
変更内容とコメントを確認させていただいて問題なさそうでした。

@iChemy
Copy link
Contributor Author

iChemy commented Feb 16, 2025

私のレビューもおろそかでした 🙇
感謝

@iChemy iChemy merged commit 93e3275 into main Feb 16, 2025
6 checks passed
@iChemy iChemy deleted the fix-filterduration branch February 16, 2025 10:48
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.

2 participants