Commit graph

14164 commits

Author SHA1 Message Date
Johannes Millan
90b1dc6991 test(sync): add unit tests for WebDAV XML parser and HTTP adapter
- Add comprehensive unit tests for webdav-xml-parser covering PROPFIND parsing, file metadata extraction, and edge cases
- Add unit tests for webdav-http-adapter covering both fetch and CapacitorHttp modes (14/19 tests passing)
- Fix Response constructor issue with status 0 in error handling
- Document code issues found during testing in webdav-code-issues.md
2025-07-18 17:01:23 +02:00
Johannes Millan
3ced51b168 fix(sync): error in xml parser 2025-07-18 16:47:33 +02:00
Johannes Millan
1689b6c34b feat(sync): prevent concurrent write edge case better 2025-07-18 16:39:43 +02:00
Johannes Millan
e9d01f3cea feat(sync): only try to create directory on error 2025-07-18 16:11:07 +02:00
Johannes Millan
9bee38597c feat(sync): make basic new sync work 2025-07-18 16:05:43 +02:00
Johannes Millan
ddfa4ddb15 feat(sync): webdav new simpler approach first draft 2025-07-18 15:33:56 +02:00
Johannes Millan
62a2ec2105 feat(sync): start fresh 2025-07-18 15:06:38 +02:00
Johannes Millan
2a02c3991c feat(sync): extract xml parser 2025-07-18 14:48:16 +02:00
Johannes Millan
ff541d0e1f feat(sync): revert to older webdav-api.ts 2025-07-18 14:38:26 +02:00
Johannes Millan
aaf6e8c34c feat(sync): half way remove lock stuff 2025-07-18 14:35:18 +02:00
Johannes Millan
e9cc5f7038 feat(sync): extract webdav-xml-parser.ts 2025-07-18 14:28:18 +02:00
Johannes Millan
18f7f6a42c feat(sync): extract webdav-capabilities-detector.ts 2025-07-18 14:22:37 +02:00
Johannes Millan
264c2fb43f feat(sync): add logs 2025-07-18 14:17:14 +02:00
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