Skip to content

feat(coderd): add mark-all-as-read endpoint for inbox notifications #16976

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

Merged
merged 12 commits into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixes from review
  • Loading branch information
defelmnq committed Mar 20, 2025
commit 9d871fc4a92a9c7bca84c8d865abd12e9f87746c
5 changes: 1 addition & 4 deletions coderd/database/dbmem/dbmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -9506,10 +9506,7 @@ func (q *FakeQuerier) MarkAllInboxNotificationsAsRead(_ context.Context, arg dat

for idx, notif := range q.inboxNotifications {
if notif.UserID == arg.UserID && !notif.ReadAt.Valid {
q.inboxNotifications[idx].ReadAt = sql.NullTime{
Time: dbtime.Now(),
Valid: true,
}
q.inboxNotifications[idx].ReadAt = arg.ReadAt
}
}

Expand Down
8 changes: 4 additions & 4 deletions coderd/inboxnotifications_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestInboxNotification_Watch(t *testing.T) {
// I skip these tests specifically on windows as for now they are flaky - only on Windows.
// For now the idea is that the runner takes too long to insert the entries, could be worth
// investigating a manual Tx.
// Related issue for fix : https://github.com/coder/internal/issues/503
// see: https://github.com/coder/internal/issues/503
if runtime.GOOS == "windows" {
t.Skip("our runners are randomly taking too long to insert entries")
}
Expand Down Expand Up @@ -306,7 +306,7 @@ func TestInboxNotifications_List(t *testing.T) {
// I skip these tests specifically on windows as for now they are flaky - only on Windows.
// For now the idea is that the runner takes too long to insert the entries, could be worth
// investigating a manual Tx.
// Related issue for fix : https://github.com/coder/internal/issues/503
// see: https://github.com/coder/internal/issues/503
if runtime.GOOS == "windows" {
t.Skip("our runners are randomly taking too long to insert entries")
}
Expand Down Expand Up @@ -590,7 +590,7 @@ func TestInboxNotifications_ReadStatus(t *testing.T) {
// I skip these tests specifically on windows as for now they are flaky - only on Windows.
// For now the idea is that the runner takes too long to insert the entries, could be worth
// investigating a manual Tx.
// Related issue for fix : https://github.com/coder/internal/issues/503
// see: https://github.com/coder/internal/issues/503
if runtime.GOOS == "windows" {
t.Skip("our runners are randomly taking too long to insert entries")
}
Expand Down Expand Up @@ -733,7 +733,7 @@ func TestInboxNotifications_MarkAllAsRead(t *testing.T) {
// I skip these tests specifically on windows as for now they are flaky - only on Windows.
// For now the idea is that the runner takes too long to insert the entries, could be worth
// investigating a manual Tx.
// Related issue for fix : https://github.com/coder/internal/issues/503
// see: https://github.com/coder/internal/issues/503
if runtime.GOOS == "windows" {
t.Skip("our runners are randomly taking too long to insert entries")
}
Expand Down
Loading