Merge branch 'main' into dev

This commit is contained in:
Mo Tarbin 2025-02-11 22:17:42 -05:00
commit b08a180d99
3 changed files with 56 additions and 39 deletions

View file

@ -1,38 +1,53 @@
--- # Bug Report
name: Bug report
about: Create a report to help us improve 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.
title: ''
labels: bug
assignees: ''
--- ---
**Describe the bug** ## Description
A clear and concise description of what the bug is. *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 '...' 1. Go to '...'
2. Click on '....' 2. Click on '...'
3. Scroll down to '....' 3. Scroll down to '...'
4. See error 4. See error
**Expected behavior** ---
A clear and concise description of what you expected to happen.
**Screenshots** ## Screenshots (if applicable)
If applicable, add screenshots to help explain your problem. *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):** ## Environment
- Device: [e.g. iPhone6] - **Donetick Version:** (e.g., v1.2.3)
- OS: [e.g. iOS8.1] - **Deployment Method:** (Self-hosted, Docker, Cloud, etc.)
- Browser [e.g. stock browser, safari] - **Operating System:** (e.g., Windows, macOS, Linux)
- Version [e.g. 22] - **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.

View file

@ -1,5 +1,4 @@
version: '3.3' ---
services: services:
app: app:
build: build:

View file

@ -30,7 +30,7 @@ func (n *NotificationPlanner) GenerateNotifications(c context.Context, chore *ch
circleMembers, err := n.cRepo.GetCircleUsers(c, chore.CircleID) circleMembers, err := n.cRepo.GetCircleUsers(c, chore.CircleID)
assignees := make([]*cModel.UserCircleDetail, 0) assignees := make([]*cModel.UserCircleDetail, 0)
for _, member := range circleMembers { for _, member := range circleMembers {
if member.ID == chore.AssignedTo { if member.UserID == chore.AssignedTo {
assignees = append(assignees, member) assignees = append(assignees, member)
} }
} }
@ -71,8 +71,9 @@ func (n *NotificationPlanner) GenerateNotifications(c context.Context, chore *ch
} }
func generateDueNotifications(chore *chModel.Chore, users []*cModel.UserCircleDetail) []*nModel.Notification { func generateDueNotifications(chore *chModel.Chore, users []*cModel.UserCircleDetail) []*nModel.Notification {
var assignee *cModel.UserCircleDetail
notifications := make([]*nModel.Notification, 0) notifications := make([]*nModel.Notification, 0)
var assignee *cModel.UserCircleDetail
for _, user := range users { for _, user := range users {
if user.ID == chore.AssignedTo { if user.ID == chore.AssignedTo {
assignee = user assignee = user
@ -86,8 +87,8 @@ func generateDueNotifications(chore *chModel.Chore, users []*cModel.UserCircleDe
ScheduledFor: *chore.NextDueDate, ScheduledFor: *chore.NextDueDate,
CreatedAt: time.Now().UTC(), CreatedAt: time.Now().UTC(),
TypeID: user.NotificationType, TypeID: user.NotificationType,
UserID: user.ID,
CircleID: user.CircleID, UserID: user.UserID,
TargetID: user.TargetID, 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, assignee.DisplayName),
RawEvent: map[string]interface{}{ RawEvent: map[string]interface{}{
@ -122,10 +123,12 @@ func generatePreDueNotifications(chore *chModel.Chore, users []*cModel.UserCircl
ScheduledFor: *chore.NextDueDate, ScheduledFor: *chore.NextDueDate,
CreatedAt: time.Now().UTC().Add(-time.Hour * 3), CreatedAt: time.Now().UTC().Add(-time.Hour * 3),
TypeID: user.NotificationType, TypeID: user.NotificationType,
UserID: user.ID, UserID: user.UserID,
CircleID: user.CircleID, CircleID: user.CircleID,
TargetID: user.TargetID, 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"), assignee.DisplayName),
RawEvent: map[string]interface{}{ RawEvent: map[string]interface{}{
"id": chore.ID, "id": chore.ID,
"name": chore.Name, "name": chore.Name,
@ -161,7 +164,7 @@ func generateOverdueNotifications(chore *chModel.Chore, users []*cModel.UserCirc
ScheduledFor: scheduleTime, ScheduledFor: scheduleTime,
CreatedAt: time.Now().UTC(), CreatedAt: time.Now().UTC(),
TypeID: user.NotificationType, TypeID: user.NotificationType,
UserID: user.ID, UserID: user.UserID,
CircleID: user.CircleID, CircleID: user.CircleID,
TargetID: fmt.Sprint(user.TargetID), 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, assignee.DisplayName),