Commit graph

14151 commits

Author SHA1 Message Date
Johannes Millan
8201f745ba feat(sync): split up webdav model stuff into different files 2025-07-18 14:09:22 +02:00
Johannes Millan
6858ce3c91 test(sync): make first e2e test work 2025-07-18 13:53:05 +02:00
Johannes Millan
3958b39f13 fix(webdav): prevent infinite loop in WebDAV 409 retry logic
- Pass _retryAttempted flag correctly in _retryUploadWithDirectoryCreation
- Add retry flag to error object to track retry attempts across error boundaries
- Update catch block to check both parameter and error flags
- Fix return type of retry method to handle undefined case
- Update test expectations to match new retry behavior
- Change incorrect error log to debug log in _getUrl method

This prevents infinite recursion when WebDAV server returns 409 Conflict
errors for missing parent directories.
2025-07-18 12:11:05 +02:00
Johannes Millan
9171142021 build(webdav): make webdav.yaml work with cors etc 2025-07-18 12:11:05 +02:00
Johannes Millan
9a3ac7cc72 test(webdav): fix all webdav tests 2025-07-18 12:11:05 +02:00
Johannes Millan
ff20913231 build: fix docker command 2025-07-18 12:11:05 +02:00
Johannes Millan
048a77e34c test(webdav): fix webdav 2025-07-18 12:11:05 +02:00
Johannes Millan
3e6171d567 build: speed up tests 2 2025-07-18 12:11:05 +02:00
Johannes Millan
747ff3a98e build: speed up tests 2025-07-18 12:11:05 +02:00
Johannes Millan
fc439a3be3 build: improve testing setup to give indication about which test hangs 2025-07-18 12:11:05 +02:00
Johannes Millan
136c8ef477 test: fix several 2025-07-18 12:11:05 +02:00
Johannes Millan
905f8d1770 build: cleanup 2025-07-18 12:11:05 +02:00
Johannes Millan
5e44292859 build: improve karma setup 2025-07-18 12:11:05 +02:00
Johannes Millan
b757cb2592 fix(webdav): fix failing unit tests for improved error handling
- Fix 412 error handling to throw appropriate error types
- FileExistsAPIError for 412 without expectedEtag (new file conflicts)
- Descriptive Error messages for 412 with expectedEtag (conflict details)
- Descriptive Error messages for 423 Locked resources
- Update test expectations to match improved error handling

All WebDAV unit tests now pass:
- Last-Modified tests: 15/15 
- Integration tests: 8/8 
- Error handling tests: 13/13 
- Upload tests: 22/22 
- Fallback tests: 36/36 

Total: 94/94 WebDAV tests passing
2025-07-18 12:11:05 +02:00
Johannes Millan
b3158b008d refactor(e2e): use bundled hacdias/webdav instead of mock server
- Replace custom mock server with real hacdias/webdav:latest
- Use existing webdav.yaml configuration and alice/bob users
- Remove unnecessary mock server code following KISS principle
- WebDAV server now matches production setup exactly
- Persistent data storage in ./e2e-webdav-data

This provides more realistic e2e testing with the actual WebDAV
server used in production deployments.
2025-07-18 12:11:05 +02:00
Johannes Millan
017dbf80e6 feat(e2e): add minimal WebDAV e2e testing setup
- Add mock WebDAV server with ETag and Last-Modified support
- Create basic WebDAV sync e2e test following KISS principle
- Add docker-compose configuration for isolated testing
- Include npm script for automated WebDAV e2e testing

The minimal setup tests WebDAV configuration and basic sync
functionality with both ETag and Last-Modified fallback support.
2025-07-18 12:11:05 +02:00
Johannes Millan
8238606f46 feat(webdav): add comprehensive Last-Modified fallback support
- Implements robust WebDAV sync for servers without ETag support
- Adds _extractValidators method for ETag and Last-Modified headers
- Enhances conditional header creation with Last-Modified support
- Adds LOCK/UNLOCK mechanism for safe resource creation
- Implements server capability detection with caching
- Adds NoRevAPIError retry mechanism for missing validators
- Includes comprehensive test coverage for all workflows
- Maintains backward compatibility with existing ETag-based code

This enables WebDAV sync with basic servers that only support
Last-Modified headers while preserving optimal performance
for servers with full ETag support.
2025-07-18 12:11:05 +02:00
Johannes Millan
0ba66bc266 feat(webdav): implement Phase 4 - alternative safe creation methods
- Added support for WebDAV If header with Not token for safe creation
- Implemented LOCK/UNLOCK mechanism for exclusive resource creation
- Added _lockResource() and _unlockResource() helper methods
- Updated _createConditionalHeaders to check server capabilities for safe creation
- Added warning when no safe creation method is available
- Enhanced upload method to use locking when needed for safe creation
- Maintains backward compatibility with ETag-supporting servers
2025-07-18 12:11:05 +02:00
Johannes Millan
642edbc55a feat(webdav): implement Phase 3.3 - core methods with Last-Modified fallback logic
- Updated upload, download, getFileMeta, and remove methods to use validators
- Added _getOrDetectCapabilities() helper for efficient capability caching
- Updated _retrieveEtagWithFallback to support both ETag and Last-Modified validators
- Added NoRevAPIError handling with automatic retry after capability detection
- Fixed conditional header usage to properly support Last-Modified validators
- All tests passing with backward compatibility maintained
2025-07-18 12:11:05 +02:00
Johannes Millan
911af8d471 feat(webdav): implement core methods with Last-Modified fallback support
- Update upload method to support Last-Modified validators
- Add automatic server capability detection on NoRevAPIError
- Update download method to use If-Modified-Since for conditional requests
- Return undefined for 304 Not Modified responses (breaking change)
- Update getFileMeta to extract Last-Modified as fallback validator
- Update remove method to support If-Unmodified-Since for deletions
- Add _getOrDetectCapabilities helper for efficient capability caching
- Update _retrieveEtagWithFallback to support both validator types
- Update _parseXmlResponseElement to use Last-Modified when no ETag

All changes maintain backward compatibility for ETag-capable servers.

Part of Phase 3.3 of WebDAV non-ETag server support implementation.
2025-07-18 12:11:05 +02:00
Johannes Millan
a129066fb3 feat(webdav): enhance conditional headers method for Last-Modified support
- Update _createConditionalHeaders to support Last-Modified validators
- Add expectedLastModified and validatorType parameters
- Maintain backward compatibility with existing ETag-only calls
- Implement RFC 7232 compliant conditional header logic:
  - If-Unmodified-Since for Last-Modified updates
  - Prevent unsafe resource creation with Last-Modified only
- Add comprehensive test coverage for all header combinations
- All existing upload tests continue to pass

Part of Phase 3.2 of WebDAV non-ETag server support implementation.
2025-07-18 12:11:05 +02:00
Johannes Millan
9a71ce7ecc feat(webdav): implement _extractValidators method for ETag and Last-Modified support
- Add _extractValidators private method to handle both ETag and Last-Modified headers
- Method extracts validators from response headers with case-insensitive lookup
- Prefers ETag over Last-Modified per RFC 7232 specification
- Returns validator type ('etag', 'last-modified', 'none') for conditional requests
- Add comprehensive test suite for _extractValidators method
- Maintains backward compatibility - all 180 existing tests pass

Part of Phase 3.1 of WebDAV non-ETag server support implementation.
2025-07-18 12:11:05 +02:00
Johannes Millan
5b8c33caa0 feat(webdav): add server capability detection for non-ETag servers
- Add WebdavServerCapabilities interface to detect server features
- Implement detectServerCapabilities() method in WebdavApi
- Support detection of ETags, Last-Modified, If headers, and locking
- Add comprehensive test coverage for capability detection
- Cache detected capabilities to avoid repeated requests
- Support configuration-based capability overrides
- Add documentation for WebDAV conditional headers analysis
- Maintain 100% backward compatibility with existing ETag behavior

This is Phase 2 of WebDAV non-ETag server support implementation.
All existing 180 tests continue to pass.
2025-07-18 12:11:05 +02:00
Johannes Millan
8c37448292 test: fix 2025-07-18 12:11:05 +02:00
Johannes Millan
f24225156e feat(webdav): simplify webdav-api.ts 2025-07-18 12:11:05 +02:00
Johannes Millan
468dc39f47 test(webdav): add and improve for all code paths 2025-07-18 12:11:05 +02:00
Johannes Millan
576aa173a0 Merge branch 'fix/various4'
* fix/various4:
  fix: disable more shortcuts for task description context
2025-07-18 11:37:52 +02:00
Johannes Millan
e01a0c9dc8 fix: disable more shortcuts for task description context
Closes #4779
2025-07-18 11:37:24 +02:00
Johannes Millan
be0367450c fix: auth token dialog not showing up when configuring sync from settings
Closes #4659
2025-07-18 10:05:34 +02:00
Johannes Millan
6a76492a9b fix: formly button error for undefined values 2025-07-18 09:51:11 +02:00
Johannes Millan
f499802306 fix: worklog export in other timezones
Closes #4763
2025-07-17 22:05:42 +02:00
Johannes Millan
6ff9afb0f7 fix: emoji problem
Closes #4767
2025-07-17 21:12:42 +02:00
Johannes Millan
5816456447 fix: 12 am should be 12 pm (even though I think it is not logical :D)
Closes #4741
2025-07-17 21:12:37 +02:00
Johannes Millan
e295655127 feat(electron): add debug logging for suspend/resume idle detection #4734
Add comprehensive logging to help diagnose why idle detection is not
triggering properly when the system suspends/resumes, particularly on
Wayland systems where powerMonitor events may not fire reliably.

The logging covers:
- Power monitor suspend/resume/lock/unlock events
- Idle time calculations on system wake
- Whether idle messages are sent to frontend based on thresholds

This will help identify if:
1. PowerMonitor events are firing on the user's KDE Wayland system
2. Idle time is being calculated correctly during sleep periods
3. Messages are being sent but not processed by the frontend

Related to issue #4734 where time tracking continues during sleep mode.
2025-07-17 21:12:37 +02:00
Johannes Millan
f9eb77b792 fix: add planner state to baseState in task-shared.reducer.spec.ts
- Fixes failing tests by initializing planner state in test setup
- The planner-shared.reducer now handles transferTask actions and needs planner state
- All 5 failing tests now pass
2025-07-17 21:04:43 +02:00
Johannes Millan
fd56627cb1 refactor: remove transferTask handling from individual reducers
- Remove transferTask handling from task.reducer.ts
- Remove transferTask handling from planner.reducer.ts
- Remove transferTask handling from tag.reducer.ts
- Update tests to use meta-reducers for proper action handling
- All transferTask logic now centralized in planner-shared.reducer.ts
- All tests pass successfully
2025-07-17 20:55:46 +02:00
Johannes Millan
18dca49bef feat: migrate transferTask logic to planner-shared.reducer
- Add task reducer logic: updates task dueDay and clears dueWithTime
- Add planner reducer logic: manages planner days arrays
- Preserves all existing behavior from individual reducers
- All tests still pass
2025-07-17 20:55:46 +02:00
Johannes Millan
4251eb6d64 test: add comprehensive unit tests for transferTask action handling
- Add task.reducer.transferTask.spec.ts with 9 test cases covering task dueDay updates
- Add planner.reducer.transferTask.spec.ts with 17 test cases covering planner days array manipulation
- Tests verify current behavior before migrating to planner-shared.reducer
- All tests pass in Berlin timezone
2025-07-17 20:55:46 +02:00
Johannes Millan
c346694055 test: add timezone tests for getWorklogStr occurrences that work correctly
- dialog-edit-task-repeat-cfg: converts timestamp to local date string correctly
- date.service: utility wrapper working as intended
- metric.util: converts timestamps for metrics display correctly
- archive.service: uses current time for today string correctly
2025-07-17 20:55:46 +02:00
Johannes Millan
d22d0ff97f fix(issue-providers): use date strings directly to avoid timezone conversion issues
When GitLab and OpenProject return due dates as YYYY-MM-DD strings,
we should use them directly instead of converting through getWorklogStr()
which causes timezone issues. In timezones with negative UTC offset,
dates would appear as the previous day.

- GitLab: use issue.due_date directly
- OpenProject: use issue.startDate directly
2025-07-17 17:53:25 +02:00
Johannes Millan
5353e1177c fix: timezone issues with task due date comparisons
- Replace Date object creation from dueDay strings with string comparisons
- Use dateStrToUtcDate utility for mixed dueDay/dueWithTime comparisons
- Fix task filtering by scheduled date to use string comparisons
- Fix task sorting by scheduled date to avoid timezone conversion issues
- Add explanatory comments about why string comparison works for YYYY-MM-DD format

This fixes the issue where tasks scheduled for today would incorrectly
appear as overdue in timezones with negative UTC offsets (like São Paulo).
The YYYY-MM-DD format is lexicographically sortable, making string
comparison both simpler and more reliable than Date object comparison.

Fixes #4714
2025-07-17 17:28:07 +02:00
Johannes Millan
5b49ba5aa1 fix: wrong day comparison in other timezones 2 #4714 2025-07-17 17:11:41 +02:00
Johannes Millan
e8438b6929 fix: wrong day comparison in other timezones #4714 2025-07-17 16:52:08 +02:00
Johannes Millan
bc43c490c2 fix(planner): wrong day assigned #4714 2025-07-17 16:32:17 +02:00
Johannes Millan
86dc1409da fix(schedule): remove date string from schedule event 2025-07-17 11:46:15 +02:00
Johannes Millan
a75fa21639 refactor(schedule): to signals 2025-07-17 11:45:25 +02:00
Johannes Millan
fab310ef14 feat(schedule): make mobile week headers also work 2025-07-17 11:35:28 +02:00
Johannes Millan
a92fbfdf43 feat(schedule): make mobile month view slightly more useful 2025-07-17 11:25:44 +02:00
Johannes Millan
be8e102f47 fix(schedule): mobile week planner 2025-07-17 11:23:00 +02:00
Johannes Millan
6edff77bb4 refactor: convert to signals 2025-07-17 11:21:36 +02:00