From 3ad22b63cdbfeec3bcacd3fed18e367bea6da83e Mon Sep 17 00:00:00 2001 From: Amin Vakil Date: Tue, 21 Jan 2025 12:44:14 +0330 Subject: [PATCH 1/3] Remove version from docker-compose.yaml https://docs.docker.com/reference/compose-file/version-and-name/#version-top-level-element-obsolete --- docker-compose.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 39bfd6e..b1d1523 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,5 +1,4 @@ -version: '3.3' - +--- services: app: build: @@ -9,7 +8,7 @@ services: restart: unless-stopped volumes: - # sqlite database: + # sqlite database: - ./data:/usr/src/app/data ports: From 922b26818586d409ac63b39df7fd58ca691f8f60 Mon Sep 17 00:00:00 2001 From: mschwerz Date: Thu, 30 Jan 2025 18:40:53 -0500 Subject: [PATCH 2/3] Fixing an issue that prevented notifications from being made due to the wrong ID being used. --- internal/notifier/service/planner.go | 37 +++++++--------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/internal/notifier/service/planner.go b/internal/notifier/service/planner.go index a8f8ef6..427862b 100644 --- a/internal/notifier/service/planner.go +++ b/internal/notifier/service/planner.go @@ -30,7 +30,7 @@ func (n *NotificationPlanner) GenerateNotifications(c context.Context, chore *ch circleMembers, err := n.cRepo.GetCircleUsers(c, chore.CircleID) assignees := make([]*cModel.UserCircleDetail, 0) for _, member := range circleMembers { - if member.ID == chore.AssignedTo { + if member.UserID == chore.AssignedTo { assignees = append(assignees, member) } } @@ -71,14 +71,7 @@ func (n *NotificationPlanner) GenerateNotifications(c context.Context, chore *ch } func generateDueNotifications(chore *chModel.Chore, users []*cModel.UserCircleDetail) []*nModel.Notification { - var assignee *cModel.UserCircleDetail notifications := make([]*nModel.Notification, 0) - for _, user := range users { - if user.ID == chore.AssignedTo { - assignee = user - break - } - } for _, user := range users { notification := &nModel.Notification{ ChoreID: chore.ID, @@ -86,9 +79,9 @@ func generateDueNotifications(chore *chModel.Chore, users []*cModel.UserCircleDe ScheduledFor: *chore.NextDueDate, CreatedAt: time.Now().UTC(), TypeID: user.NotificationType, - UserID: user.ID, + UserID: user.UserID, TargetID: user.TargetID, - Text: fmt.Sprintf("📅 Reminder: *%s* is due today and assigned to %s.", chore.Name, assignee.DisplayName), + Text: fmt.Sprintf("📅 Reminder: *%s* is due today and assigned to %s.", chore.Name, user.DisplayName), } if notification.IsValid() { notifications = append(notifications, notification) @@ -99,13 +92,7 @@ func generateDueNotifications(chore *chModel.Chore, users []*cModel.UserCircleDe } func generatePreDueNotifications(chore *chModel.Chore, users []*cModel.UserCircleDetail) []*nModel.Notification { - var assignee *cModel.UserCircleDetail - for _, user := range users { - if user.ID == chore.AssignedTo { - assignee = user - break - } - } + notifications := make([]*nModel.Notification, 0) for _, user := range users { notification := &nModel.Notification{ @@ -114,9 +101,9 @@ func generatePreDueNotifications(chore *chModel.Chore, users []*cModel.UserCircl ScheduledFor: *chore.NextDueDate, CreatedAt: time.Now().UTC().Add(-time.Hour * 3), TypeID: user.NotificationType, - UserID: user.ID, + UserID: user.UserID, TargetID: user.TargetID, - Text: fmt.Sprintf("📢 Heads up! *%s* is due soon (on %s) and assigned to %s.", chore.Name, chore.NextDueDate.Format("January 2nd"), assignee.DisplayName), + Text: fmt.Sprintf("📢 Heads up! *%s* is due soon (on %s) and assigned to %s.", chore.Name, chore.NextDueDate.Format("January 2nd"), user.DisplayName), } if notification.IsValid() { notifications = append(notifications, notification) @@ -128,13 +115,7 @@ func generatePreDueNotifications(chore *chModel.Chore, users []*cModel.UserCircl } func generateOverdueNotifications(chore *chModel.Chore, users []*cModel.UserCircleDetail) []*nModel.Notification { - var assignee *cModel.UserCircleDetail - for _, user := range users { - if user.ID == chore.AssignedTo { - assignee = user - break - } - } + notifications := make([]*nModel.Notification, 0) for _, hours := range []int{24, 48, 72} { scheduleTime := chore.NextDueDate.Add(time.Hour * time.Duration(hours)) @@ -145,9 +126,9 @@ func generateOverdueNotifications(chore *chModel.Chore, users []*cModel.UserCirc ScheduledFor: scheduleTime, CreatedAt: time.Now().UTC(), TypeID: user.NotificationType, - UserID: user.ID, + UserID: user.UserID, TargetID: fmt.Sprint(user.TargetID), - Text: fmt.Sprintf("🚨 *%s* is now %d hours overdue. Please complete it as soon as possible. (Assigned to %s)", chore.Name, hours, assignee.DisplayName), + Text: fmt.Sprintf("🚨 *%s* is now %d hours overdue. Please complete it as soon as possible. (Assigned to %s)", chore.Name, hours, user.DisplayName), } if notification.IsValid() { notifications = append(notifications, notification) From d47dbbc63bb8d82a57f82c55c7a60731b19b6513 Mon Sep 17 00:00:00 2001 From: Mohamad Tarbin Date: Tue, 4 Feb 2025 23:57:38 -0500 Subject: [PATCH 3/3] Update bug_report.md --- .github/ISSUE_TEMPLATE/bug_report.md | 69 +++++++++++++++++----------- 1 file changed, 42 insertions(+), 27 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f3d5c41..71c1619 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,38 +1,53 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug -assignees: '' +# Bug Report + +Thank you for taking the time to report a bug in Donetick! Please fill out the information below to help us diagnose and fix the issue as quickly as possible. --- -**Describe the bug** -A clear and concise description of what the bug is. +## Description +*A clear and concise description of the bug.* + +**Expected Behavior:** +*A clear and concise description of what you expected to happen.* + +**Actual Behavior:** +*A clear and concise description of what actually happened.* + +--- + +## Steps to Reproduce +*Steps to reproduce the behavior.* -**To Reproduce** -Steps to reproduce the behavior: 1. Go to '...' -2. Click on '....' -3. Scroll down to '....' +2. Click on '...' +3. Scroll down to '...' 4. See error -**Expected behavior** -A clear and concise description of what you expected to happen. +--- -**Screenshots** -If applicable, add screenshots to help explain your problem. +## Screenshots (if applicable) +*Attach screenshots or screen recordings to help explain the issue.* -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] +--- -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] +## Environment +- **Donetick Version:** (e.g., v1.2.3) +- **Deployment Method:** (Self-hosted, Docker, Cloud, etc.) +- **Operating System:** (e.g., Windows, macOS, Linux) +- **Browser & Version:** (if applicable, e.g., Chrome 110.0, Firefox 99.0) +- **Relevant Logs:** (Paste any relevant error messages or logs here.) + +--- + +## Additional Context +*Add any other context about the problem here.* + +--- + +### Checklist +- [ ] I have searched for existing issues that might be related to this bug. +- [ ] I have provided detailed information to help reproduce the issue. +- [ ] I have included logs or screenshots where applicable. + +Thank you for reporting this issue! -**Additional context** -Add any other context about the problem here.