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 @@
---
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.

View file

@ -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:

View file

@ -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,8 +71,9 @@ 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)
var assignee *cModel.UserCircleDetail
for _, user := range users {
if user.ID == chore.AssignedTo {
assignee = user
@ -86,10 +87,10 @@ func generateDueNotifications(chore *chModel.Chore, users []*cModel.UserCircleDe
ScheduledFor: *chore.NextDueDate,
CreatedAt: time.Now().UTC(),
TypeID: user.NotificationType,
UserID: user.ID,
CircleID: user.CircleID,
TargetID: user.TargetID,
Text: fmt.Sprintf("📅 Reminder: *%s* is due today and assigned to %s.", chore.Name, assignee.DisplayName),
UserID: user.UserID,
TargetID: user.TargetID,
Text: fmt.Sprintf("📅 Reminder: *%s* is due today and assigned to %s.", chore.Name, assignee.DisplayName),
RawEvent: map[string]interface{}{
"id": chore.ID,
"name": chore.Name,
@ -122,10 +123,12 @@ 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,
CircleID: user.CircleID,
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{}{
"id": chore.ID,
"name": chore.Name,
@ -161,7 +164,7 @@ func generateOverdueNotifications(chore *chModel.Chore, users []*cModel.UserCirc
ScheduledFor: scheduleTime,
CreatedAt: time.Now().UTC(),
TypeID: user.NotificationType,
UserID: user.ID,
UserID: user.UserID,
CircleID: user.CircleID,
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),