-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
API: Search Issues, dont show 500 if filter result in empty list #19244
API: Search Issues, dont show 500 if filter result in empty list #19244
Conversation
But at least we need to know there is a bug there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lunny I have no idea why it should be an error that no issue matched the filter.
The combination of returning no error and 0
should be hint enough for that.
I would also consider a filter that is to restrictive and so return 0 not an error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to be improved in my mind.
- the sql
select count(t1.id) from t1 inner join t2 on t1.id=t2.id
always return 1 rows with a column value0
or123
. - why the
Find
result becomes 0 rows, I think it's a bug caused byopts.Page>0
, then there is alimit 10,20
in the sql, or maybe something else related tolimit
. How it happens? Is it correct? - the
RepoID int64
in countsSlice struct seems useless (and incorrect .... there is no such column in result)
Since we are fixing bugs, I think if there is a chance, we should fix the root case.
I proposed a full fix: There are 4 functions need to call |
I think we can have this fix in 1.16.6 since it's a bug. |
Ok let me |
Use setupSessionNoLimit instead of setupSessionWithLimit when no pagination
…gitea#19244) * remove error who is none * use setupSessionNoLimit instead of setupSessionWithLimit when no pagination Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* giteaofficial/main: (22 commits) Add logic to switch between source/rendered on Markdown (go-gitea#19356) Fixed registry host value. (go-gitea#19363) [skip ci] Updated translations via Crowdin Allow package linking to private repository (go-gitea#19348) Use "main" as default branch name (go-gitea#19354) Move milestone to models/issues/ (go-gitea#19278) Refactor CSRF protection modules, make sure CSRF tokens can be up-to-date. (go-gitea#19337) Remove dependent on session auth for api/v1 routers (go-gitea#19321) API: Search Issues, dont show 500 if filter result in empty list (go-gitea#19244) [skip ci] Updated translations via Crowdin Never use /api/v1 from Gitea UI Pages (go-gitea#19318) [skip ci] Updated translations via Crowdin Show ssh command directly in template instead of i18n translation (go-gitea#19335) Package registry changes (go-gitea#19305) [skip ci] Updated translations via Crowdin Add `ENABLE_SSH_LOG` to debugging problems (go-gitea#19316) Warn on SSH connection for incorrect configuration (go-gitea#19317) escape fake link Allow custom redirect for landing page (go-gitea#19324) [skip ci] Updated translations via Crowdin ...
…gitea#19244) * remove error who is none * use setupSessionNoLimit instead of setupSessionWithLimit when no pagination Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
…gitea#19244) * remove error who is none * use setupSessionNoLimit instead of setupSessionWithLimit when no pagination Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
as title