Tunglies
355a18e5eb
refactor(async): migrate from sync-blocking async execution to true async with unified AsyncHandler::spawn ( #4502 )
...
* feat: replace all tokio::spawn with unified AsyncHandler::spawn
- 🚀 Core Improvements:
* Replace all tokio::spawn calls with AsyncHandler::spawn for unified Tauri async task management
* Prioritize converting sync functions to async functions to reduce spawn usage
* Use .await directly in async contexts instead of spawn
- 🔧 Major Changes:
* core/hotkey.rs: Use AsyncHandler::spawn for hotkey callback functions
* module/lightweight.rs: Async lightweight mode switching
* feat/window.rs: Convert window operation functions to async, use .await internally
* feat/proxy.rs, feat/clash.rs: Async proxy and mode switching functions
* lib.rs: Window focus handling with AsyncHandler::spawn
* core/tray/mod.rs: Complete async tray event handling
- ✨ Technical Advantages:
* Unified task tracking and debugging capabilities (via tokio-trace feature)
* Better error handling and task management
* Consistency with Tauri runtime
* Reduced async boundaries for better performance
- 🧪 Verification:
* Compilation successful with 0 errors, 0 warnings
* Maintains complete original functionality
* Optimized async execution flow
* feat: complete tokio fs migration and replace tokio::spawn with AsyncHandler
🚀 Major achievements:
- Migrate 8 core modules from std::fs to tokio::fs
- Create 6 Send-safe wrapper functions using spawn_blocking pattern
- Replace all tokio::spawn calls with AsyncHandler::spawn for unified async task management
- Solve all 19 Send trait compilation errors through innovative spawn_blocking architecture
🔧 Core changes:
- config/profiles.rs: Add profiles_*_safe functions to handle Send trait constraints
- cmd/profile.rs: Update all Tauri commands to use Send-safe operations
- config/prfitem.rs: Replace append_item calls with profiles_append_item_safe
- utils/help.rs: Convert YAML operations to async (read_yaml, save_yaml)
- Multiple modules: Replace tokio::task::spawn_blocking with AsyncHandler::spawn_blocking
✅ Technical innovations:
- spawn_blocking wrapper pattern resolves parking_lot RwLock Send trait conflicts
- Maintain parking_lot performance while achieving Tauri async command compatibility
- Preserve backwards compatibility with gradual migration strategy
🎯 Results:
- Zero compilation errors
- Zero warnings
- All async file operations working correctly
- Complete Send trait compliance for Tauri commands
* feat: refactor app handle and command functions to use async/await for improved performance
* feat: update async handling in profiles and logging functions for improved error handling and performance
* fix: update TRACE_MINI_SIZE constant to improve task logging threshold
* fix(windows): convert service management functions to async for improved performance
* fix: convert service management functions to async for improved responsiveness
* fix(ubuntu): convert install and reinstall service functions to async for improved performance
* fix(linux): convert uninstall_service function to async for improved performance
* fix: convert uninstall_service call to async for improved performance
* fix: convert file and directory creation calls to async for improved performance
* fix: convert hotkey functions to async for improved responsiveness
* chore: update UPDATELOG.md for v2.4.1 with major improvements and performance optimizations
2025-08-26 01:49:51 +08:00
Tunglies
537d27d10b
fix: clippy errors with new config ( #4428 )
...
* refactor: improve code quality with clippy fixes and standardized logging
- Replace dangerous unwrap()/expect() calls with proper error handling
- Standardize logging from log:: to logging\! macro with Type:: classifications
- Fix app handle panics with graceful fallback patterns
- Improve error resilience across 35+ modules without breaking functionality
- Reduce clippy warnings from 300+ to 0 in main library code
* chore: update Cargo.toml configuration
* refactor: resolve all clippy warnings
- Fix Arc clone warnings using explicit Arc::clone syntax across 9 files
- Add #[allow(clippy::expect_used)] to test functions for appropriate expect usage
- Remove no-effect statements from debug code cleanup
- Apply clippy auto-fixes for dbg\! macro removals and path statements
- Achieve zero clippy warnings on all targets with -D warnings flag
* chore: update Cargo.toml clippy configuration
* refactor: simplify macOS job configuration and improve caching
* refactor: remove unnecessary async/await from service and proxy functions
* refactor: streamline pnpm installation in CI configuration
* refactor: simplify error handling and remove unnecessary else statements
* refactor: replace async/await with synchronous locks for core management
* refactor: add workflow_dispatch trigger to clippy job
* refactor: convert async functions to synchronous for service management
* refactor: convert async functions to synchronous for UWP tool invocation
* fix: change wrong logging
* refactor: convert proxy restoration functions to async
* Revert "refactor: convert proxy restoration functions to async"
This reverts commit b82f5d250b .
* refactor: update proxy restoration functions to return Result types
* fix: handle errors during proxy restoration and update async function signatures
* fix: handle errors during proxy restoration and update async function signatures
* refactor: update restore_pac_proxy and restore_sys_proxy functions to async
* fix: convert restore_pac_proxy and restore_sys_proxy functions to async
* fix: await restore_sys_proxy calls in proxy restoration logic
* fix: suppress clippy warnings for unused async functions in proxy restoration
* fix: suppress clippy warnings for unused async functions in proxy restoration
2025-08-18 02:02:25 +08:00
renovate[bot]
cdc1fd2d87
chore(deps): update cargo dependencies ( #4329 )
...
* chore(deps): update cargo dependencies
* fix: update warp dependency to include server feature
* fix: update return type of scheme_handler to String for consistency
* fix: add hyper-util dependency and update warp path handlers for response status
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tunglies <tunglies.dev@outlook.com >
Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com >
2025-08-06 22:46:46 +08:00
Tunglies
764ef48fd1
refactor(Draft): Replace latest() with latest_ref() and data() with data_mut() in multiple files for improved mutability handling and consistency across the codebase ( #3987 )
...
* feat: add benchmarking for draft operations and new draft management structure
* Refactor Config Access: Replace `latest()` with `latest_ref()` and `data()` with `data_mut()` in multiple files for improved mutability handling and consistency across the codebase.
* refactor: remove DraftNew implementation and related benchmarks for cleaner codebase
2025-07-04 22:43:23 +08:00
Tunglies
a574ced428
Refactor logging statements to use the new formatting syntax for improved readability and consistency across the codebase. This includes updating error, warning, and info logs in various modules such as system commands, configuration, core functionalities, and utilities. Additionally, minor adjustments were made to string formatting in backup and proxy features to enhance clarity.
2025-06-27 23:30:59 +08:00
Tunglies
b6a6f5f434
Add AsyncHandler for wrapping task spawning
2025-04-11 17:30:30 +08:00
Tunglies
0de304d4e3
Fix and Optimize
...
fix : #3187 and #3096 , silent startup can not trigger lightweight mode
fix: optimize startup initializing processing
2025-04-05 10:28:27 +08:00
Tunglies
e8e16f7d57
refactor(logging): replace log_err! with structured logging_error! calls
...
refactor(cm-service): better error handling from Backend to Frontend
2025-03-28 03:39:34 +08:00
Tunglies
b57c6e408a
chore: git hooks for linter and formatter
2025-03-13 12:51:20 +08:00
huzibaca
1c894f3cfa
refactor: unify and simplify the call of app_handle
2024-09-23 16:31:58 +08:00
huzibaca
7dad46adb4
chore: update
2024-09-16 06:37:39 +08:00
huzibaca
fd963a8e66
chore: delete useless emebd server api
2024-09-12 19:01:08 +08:00
huzibaca
c07165531a
chore: update
2024-09-04 07:53:16 +08:00
huzibaca
6cc81fe6b8
chore: update
2024-09-02 19:33:17 +08:00
MystiPanda
3efef52398
refactor: Associate Profile with Merge/Script.
2024-06-29 23:07:44 +08:00
MystiPanda
b85929772e
refactor: use async instead of block_on
2024-06-29 19:02:37 +08:00
MystiPanda
c698b24e01
chore: update & fmt & clippy
2024-06-12 10:00:22 +08:00
MystiPanda
8c2a4e627e
fix: start param error
2024-06-09 20:00:17 +08:00
MystiPanda
65924e9a5d
chore: add content type
2024-05-26 19:26:57 +08:00
MystiPanda
b9ec94d835
feat: Support PAC Mode
2024-05-26 17:59:39 +08:00
MystiPanda
965f10698b
feat: Support URL Scheme for Windows
...
#165
2024-01-09 21:57:06 +08:00
GyDi
a786023160
fix: adjust singleton detect
2022-11-18 08:24:27 +08:00
GyDi
84c12dee80
refactor: wip
2022-11-17 17:07:13 +08:00
GyDi
837422fbb8
refactor: wip
2022-11-14 01:26:33 +08:00
GyDi
a45c61f19e
chore: format rust code
2022-11-12 11:37:23 +08:00
GyDi
1eecf26429
fix: init config error
2022-10-28 01:02:47 +08:00
GyDi
72dcdf4483
feat: change default singleton port and support to change the port
2022-09-06 00:45:01 +08:00
GyDi
0fab0f207c
chore: add dev feature
2022-03-18 10:59:35 +08:00
GyDi
c29eadd9ee
feat: Window Send and Sync
2022-01-04 21:29:04 +08:00
GyDi
1d87f78088
feat: compatible with macos(wip)
2021-12-29 18:49:38 +08:00
GyDi
34725b517b
feat: implement a simple singleton process
2021-12-23 01:35:17 +08:00