Skip to content

Enhance notifications#37107

Open
bircni wants to merge 7 commits intogo-gitea:mainfrom
bircni:feature/restart-notifications
Open

Enhance notifications#37107
bircni wants to merge 7 commits intogo-gitea:mainfrom
bircni:feature/restart-notifications

Conversation

@bircni
Copy link
Copy Markdown
Member

@bircni bircni commented Apr 4, 2026

Restarts #34803

@lunny :
This PR improved notifications.

  • Improve repository transfer notification to use the queue rather than directly insert database records

image

image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 4, 2026
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/migrations labels Apr 4, 2026
Copy link
Copy Markdown
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

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

The tests written by AI are not right

@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 4, 2026
@bircni
Copy link
Copy Markdown
Member Author

bircni commented Apr 4, 2026

The tests written by AI are not right

I am not done still trying to understand that old bad code lol

@wxiaoguang
Copy link
Copy Markdown
Contributor

Suggest to do it step by step with a plan.

Design the table for the future, but the first step should refactor the existing code first.

@bircni bircni force-pushed the feature/restart-notifications branch from ca66385 to d035e0d Compare April 4, 2026 13:28
bircni added 5 commits April 4, 2026 15:35
Co-authored-by: Claude (Opus 4.6) noreply@anthropic.com
Co-authored-by: Claude (Opus 4.6) noreply@anthropic.com
@bircni
Copy link
Copy Markdown
Member Author

bircni commented Apr 4, 2026

Suggest to do it step by step with a plan.

Design the table for the future, but the first step should refactor the existing code first.

made it like you suggested with the unique

@GiteaBot GiteaBot added lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. and removed lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged labels Apr 4, 2026
@bircni bircni marked this pull request as ready for review April 4, 2026 19:55
@bircni bircni requested a review from lunny April 4, 2026 19:55
repoIDIndex.AddColumn("repo_id")
indices = append(indices, repoIDIndex)

statusIndex := schemas.NewIndex("idx_notification_status", schemas.IndexType)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why this index removed. I think it's important.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not addressed.

@@ -43,6 +46,9 @@ func (opts FindNotificationOptions) ToConds() builder.Cond {
if opts.IssueID != 0 {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since now we are using a unique key, the search condition should use that key instead of this one, otherwise it will become very slow.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well, Maybe it's better to keep unique key as an internal condition so that the options could still have the same fields like before but when building the condition, we can use unique key rather than the issue id?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/migrations modifies/templates This PR modifies the template files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants