DOC: Update Rust backend API documentation for Tauri v2 and missing IPC commands
What's wrong with the existing documentation
Currently, docs/backend/backend_rust/api.md contains several critical inaccuracies and is severely out of date:
- Outdated Tauri v1 API imports: The usage example imports
invokefrom@tauri-apps/api/tauri(Tauri v1), whereas PictoPy has migrated to Tauri v2 where commands must be invoked via@tauri-apps/api/core. - Broken code example: The example references an undefined variable
serverPathinstead ofresourcesFolderPath(console.log("Resources folder path:", serverPath)), causing a runtimeReferenceErrorwhen executed. - Missing 12 of 13 registered IPC commands:
The documentation only lists
get_resources_folder_path. The remaining 12 commands defined and registered infrontend/src-tauri/src/main.rs(invoke_handler!) are completely undocumented:- File System / Media:
open_image_file - Reverse Tunnel Service:
tunnel_start,tunnel_stop,tunnel_status - Window & UI Management:
open_model_manager,get_close_to_tray,set_close_to_tray - System Autostart:
enable_autostart,disable_autostart,is_autostart_enabled - Memories Service:
open_memory,take_pending_memory
- File System / Media:
- Missing Event Bus Documentation: Undocumented native desktop events (
memory:pending,memory:open) emitted from Rust to the frontend webview.
Proposed Solution
Update docs/backend/backend_rust/api.md to:
- Migrate frontend code samples to Tauri v2 syntax (
import { invoke } from '@tauri-apps/api/core';). - Fix the broken variable reference in
get_resources_folder_path. - Document all 13 commands with Rust signatures, source file locations, parameters, return types, and TypeScript usage examples.
- Document background IPC events (
memory:pending,memory:open) and their frontend subscription pattern withlisten. - Ensure clean compliance with repository markdown linting (
.github/.markdownlint-cli2.jsonc).
Record
- [x] I agree to follow this project'''s Code of Conduct
- [x] I want to work on this issue
👋 Thanks for opening this issue! The maintainers will review it shortly. Till then, do not open any PR. This is a strict rule we like to follow around here :)
⚠️ Potential Duplicate Issue (Semantic Match)
This issue appears semantically similar to the following issues in AOSSIE-Org/PictoPy:
-
Remove unwanted Tauri code and update documentation (#511, closed) https://github.com/AOSSIE-Org/PictoPy/issues/511 Similarity: 67.5%
-
Good First Issue: Change Tauri/Rust docs to match the current state of the repository (#358, closed) https://github.com/AOSSIE-Org/PictoPy/issues/358 Similarity: 67.2%
-
BUG: HTTP requests fail - missing
tauri-plugin-httpin Tauri v2 (#1087, open) https://github.com/AOSSIE-Org/PictoPy/issues/1087 Similarity: 64.9%
Please review before proceeding.
@Prakhar1808 can i work on this if its not assigned to anyone?
@Prakhar1808 can i work on this if its not assigned to anyone?
it has not been validated or approved by the maintainers yet, i would again encourage you to check the beta release to find bugs, there's plenty to work on in PROD
@Prakhar1808 I would like to work on this issue can you please assign it to me if its not assigned to anyone ?
hey @swastiksharma45 the issue is still not approved by the maintainers and i myself am working on this, you should check the beta of pictopy to find more issues
i'm working on this, i'll raise a PR asap