Skip to content

Commit e8119a9

Browse files
sync 24 april (#112)
1 parent ca6b361 commit e8119a9

File tree

259 files changed

+3446
-2038
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+3446
-2038
lines changed

.eslintrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": ["next/core-web-vitals", "plugin:prettier/recommended"],
3+
"plugins": ["prettier"],
4+
"rules": {
5+
"prettier/prettier": "error"
6+
}
7+
}

.prettierignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Build output
2+
.next
3+
dist
4+
out
5+
6+
# Dependencies
7+
node_modules
8+
9+
# Cache
10+
.cache
11+
.eslintcache
12+
13+
# Environment variables
14+
.env*
15+
!.env.example
16+
17+
# Misc
18+
.DS_Store
19+
*.pem
20+
21+
# Debug
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*
25+
26+
# TypeScript
27+
*.tsbuildinfo
28+
next-env.d.ts
29+
30+
# Generated Prisma files
31+
prisma/generated/
32+
33+
# Coverage directory
34+
coverage/

.prettierrc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"semi": true,
3+
"singleQuote": false,
4+
"tabWidth": 2,
5+
"trailingComma": "es5",
6+
"printWidth": 80,
7+
"bracketSpacing": true,
8+
"arrowParens": "always",
9+
"endOfLine": "lf",
10+
"plugins": [
11+
"prettier-plugin-tailwindcss",
12+
"@trivago/prettier-plugin-sort-imports"
13+
],
14+
"importOrder": [
15+
"^react$",
16+
"^next(.*)$",
17+
"<THIRD_PARTY_MODULES>",
18+
"^@/components/(.*)$",
19+
"^@/lib/(.*)$",
20+
"^@/hooks/(.*)$",
21+
"^@/store/(.*)$",
22+
"^@/types/(.*)$",
23+
"^[./]"
24+
],
25+
"importOrderSeparation": true,
26+
"importOrderSortSpecifiers": true
27+
}

@TODO.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Background Jobs Implementation with BullMQ
22

33
## Infrastructure Setup
4+
45
- [x] Add Redis StatefulSet to Kubernetes configuration in `src/saas/k8s/deployment.yaml`
56
- [x] Add Redis Service to Kubernetes configuration
67
- [x] Create worker deployment configuration in Kubernetes
@@ -9,38 +10,44 @@
910
- [x] Create GitHub Actions workflow for staging deployment in `.github/workflows/deploy.staging.saas.yml`
1011

1112
## BullMQ Setup
13+
1214
- [x] Install required packages: `bullmq`, `ioredis`, `cron`
1315
- [x] Create Redis connection configuration in `src/saas/jobs/config/redis.ts`
1416
- [x] Set up queue definitions in `src/saas/jobs/queues/index.ts`
1517
- [x] Create worker entry point in `src/saas/jobs/worker.ts`
1618

1719
## Job Processors Implementation
20+
1821
- [x] Create base job processor class in `src/saas/jobs/processors/base-processor.ts`
1922
- [x] Implement calendar sync processor in `src/saas/jobs/processors/calendar-sync.ts`
2023
- [x] Implement email processor in `src/saas/jobs/processors/email.ts`
2124
- [x] Implement task reminder processor in `src/saas/jobs/processors/task-reminder.ts`
2225

2326
## Daily Summary Email Implementation
27+
2428
- [x] Create email template for daily summary in `src/saas/jobs/templates/daily-summary.ts`
2529
- [x] Implement function to fetch user's daily meetings in `src/saas/jobs/utils/meeting-utils.ts`
2630
- [x] Implement function to fetch user's top tasks in `src/saas/jobs/utils/task-utils.ts`
2731
- [x] Create daily summary job processor in `src/saas/jobs/processors/daily-summary.ts`
2832
- [x] Set up scheduled job to trigger daily summary emails
2933

3034
## Admin Interface
35+
3136
- [x] Create job status database schema in Prisma
3237
- [x] Implement job tracking and logging in `src/saas/jobs/utils/job-tracker.ts`
3338
- [x] Create admin dashboard UI in `src/app/(saas)/admin/jobs/page.tsx`
3439
- [x] Implement job status viewing and filtering
3540
- [x] Add manual job triggering functionality
3641

3742
## Testing
43+
3844
- [x] Create test environment with Redis
3945
- [ ] Write unit tests for job processors
4046
- [ ] Write integration tests for job queue
4147
- [ ] Test email delivery
4248

4349
## Staging Environment
50+
4451
- [x] Create staging Kubernetes configuration in `src/saas/k8s/deployment.staging.saas.yaml`
4552
- [x] Set up separate Redis instance for staging
4653
- [x] Configure GitHub Actions workflow for staging deployment in `.github/workflows/deploy.staging.saas.yml`
@@ -49,19 +56,22 @@
4956
- [x] Test background jobs in staging environment
5057

5158
## Documentation
59+
5260
- [ ] Document job system architecture
5361
- [ ] Create developer guide for adding new job types
5462
- [ ] Document admin interface usage
5563
- [ ] Update deployment documentation
5664
- [x] Document staging environment setup and usage in `src/saas/k8s/README.staging.saas.md`
5765

5866
## Monitoring and Logging
67+
5968
- [x] Implement job performance metrics
6069
- [x] Set up error alerting for failed jobs
6170
- [x] Configure log aggregation for job system
6271
- [ ] Create dashboard for job system health
6372

6473
## Security
74+
6575
- [ ] Secure Redis with password authentication
6676
- [ ] Implement rate limiting for job creation
6777
- [x] Add validation for job input data

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
### Added
11+
1112
- Added visual indicator for externally synced tasks in task list view
1213

1314
### Changed
1415

16+
- Updated future task detection to consider tasks as "upcoming" only if they are scheduled for tomorrow or later
17+
- Added new `isFutureDate` utility function in date-utils
18+
- Improved date formatting in task views to consistently show "Upcoming" label for future tasks
19+
- Fixed task overdue check to not mark today's tasks as overdue
20+
- Modified auto-scheduling to exclude tasks that are in progress, preventing them from being automatically rescheduled
21+
1522
### Fixed
23+
1624
- Improved all-day event UI by removing time selection when "All day" is checked, showing only date picker instead
1725
- Fixed Google Calendar event deletion by adding missing userId parameter for authentication
1826
- Fixed Outlook task sync issues with recurring tasks
@@ -23,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2331
## [1.3.0] 2025-03-25
2432

2533
### Added
34+
2635
- Comprehensive bidirectional task synchronization system with support for Outlook
2736
- Field mapping system for consistent task property synchronization
2837
- Recurrence rule conversion for recurring tasks
@@ -35,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3544
- Resend API key management through SystemSettings
3645

3746
### Changed
47+
3848
- Enhanced task sync manager for true bidirectional synchronization
3949
- Improved date and timezone handling across calendar and task systems
4050
- Moved sensitive credentials from environment variables to SystemSettings
@@ -45,6 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4555
- Created synchronous version in `route.open.ts` for open source edition
4656

4757
### Fixed
58+
4859
- Multiple task synchronization issues:
4960
- Prevented duplicate task creation in Outlook
5061
- Fixed task deletion synchronization
@@ -54,12 +65,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5465
- Various TypeScript and linter errors throughout the task sync system
5566

5667
### Removed
68+
5769
- Legacy one-way Outlook task import system and related components
5870
- OutlookTaskListMapping model in favor of new TaskListMapping
5971
- RESEND_API_KEY from environment variables
6072

6173
## [1.2.3]
74+
6275
### Added
76+
6377
- Added task start date feature to specify when a task should become active
6478
- Tasks with future start dates won't appear in focus mode
6579
- Auto-scheduling respects start dates, not scheduling tasks before their start date
@@ -72,6 +86,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7286
- Added "Resend Invitation" button to individual user actions in waitlist management
7387

7488
### Changed
89+
7590
- Updated email templates to use "FluidCalendar" instead of "Fluid Calendar" for consistent branding
7691
- Refactored task scheduling logic into a common service to reduce code duplication
7792
- Created `TaskSchedulingService` with shared scheduling functionality
@@ -83,6 +98,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8398
- Updated client-side code to use the correct endpoints based on version
8499

85100
### Fixed
101+
86102
- Fixed type errors in the job retry API by using the correct compound unique key (queueName + jobId)
87103
- Fixed database connection exhaustion issue in task scheduling:
88104
- Refactored SchedulingService to use the global Prisma instance instead of creating new connections
@@ -91,7 +107,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
91107
- Resolved "Too many database connections" errors in production
92108

93109
## [1.2.2] 2025-03-18
110+
94111
### Added
112+
95113
- Added rate limiting to email queue to limit processing to 2 emails per second
96114
- Added additional logging to email processor to monitor rate limiting effectiveness
97115
- Added ability to manually retry failed jobs from the admin jobs interface
@@ -112,6 +130,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
112130
- Added data retention and deletion information to privacy policy to comply with Google's app verification requirements
113131

114132
### Changed
133+
115134
- Modified job retry functionality to update existing job records instead of creating new ones
116135
- Updated email templates to use "FluidCalendar" instead of "Fluid Calendar" for consistent branding
117136
- Refactored task scheduling logic into a common service to reduce code duplication
@@ -124,6 +143,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
124143
- Updated client-side code to use the correct endpoints based on version
125144

126145
### Fixed
146+
127147
- Fixed type errors in the job retry API by using the correct compound unique key (queueName + jobId)
128148
- Fixed database connection exhaustion issue in task scheduling:
129149
- Refactored SchedulingService to use the global Prisma instance instead of creating new connections
@@ -132,6 +152,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
132152
- Resolved "Too many database connections" errors in production
133153

134154
### Technical Debt
155+
135156
- Added proper TypeScript types to replace `any` types
136157
- Added eslint-disable comments only where absolutely necessary
137158
- Fixed linter and TypeScript compiler errors
@@ -140,25 +161,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
140161
- Standardized error handling across the codebase
141162

142163
### Removed
164+
143165
- Separate one-way sync methods in favor of a more efficient bidirectional approach
144166

145167
## [1.2.1] 2025-03-13
168+
146169
### Added
170+
147171
- Added login button to SAAS home page that redirects to signin screen or app root based on authentication status
148172
- Added SessionProvider to SAAS layout to support authentication state across SAAS pages
149173
- Added pre-commit hooks with husky and lint-staged to run linting and type checking before commits
150174

151175
### Changed
176+
152177
- Removed Settings option from the main navigation bar since it's already available in the user dropdown menu
153178
- Improved dark mode by replacing black with dark gray colors for better visual comfort and reduced contrast
154179

155180
### Fixed
181+
156182
- Fixed event title alignment in calendar events to be top-aligned instead of vertically centered
157183
- Removed minimum height constraint for all-day events in WeekView and DayView components to improve space utilization
158184
- Made EventModal and TaskModal content scrollable on small screens to ensure buttons remain accessible
159185

160186
## [1.2.0] 2025-03-13
187+
161188
### Added
189+
162190
- Added background job processing system with BullMQ
163191
- Implemented BaseProcessor for handling job processing
164192
- Added DailySummaryProcessor for generating and sending daily summary emails
@@ -186,6 +214,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
186214
- Email queue system for better reliability and performance
187215

188216
### Fixed
217+
189218
- Fixed TypeScript errors in the job processing system:
190219
- Replaced `any` types with proper type constraints in BaseProcessor, job-creator, and job-tracker
191220
- Added proper type handling for job data and results
@@ -208,6 +237,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
208237
- Reduced potential for rate limiting by queueing emails
209238

210239
### Changed
240+
211241
- Updated job tracking system to be more robust:
212242
- Improved error handling in job tracker
213243
- Added better type safety for job data and results

0 commit comments

Comments
 (0)