This commit fixes the Windows panic issue.
Coco panicked because it accessed `GLOBAL_TAURI_APP_HANDLE` when this global variable wasn't initialized. I removed all the uses of this variable except for the one use in `src-tauri/src/server/http_client.rs`, which I don't have a good way to refactor.
If you are wondering why this didn't happen in the past, the access was triggered by the frontend code, something there likely changed. Regardless, this global variable is still dangerous and error-prone, so we should avoid it.
Also, this commit fixes the issue that the panic hook does not work on Windows because the log filename contains ":", which is not allowed by the Windows file system.
Found this tauri command while reading the code, then I realized that
token management logic should all be kept in the backend, there is no
need to expose it to the frontend. And indeed, searching for it in the
frontend code showed that it is not used at all.
```sh
$ cd src
$ rg get_server_token
commands/servers.ts
75:export function get_server_token(id: string): Promise<ServerTokenResponse> {
76: return invokeWithErrorHandler(`get_server_token`, { id });
```
So remove it.
* refactor: do status code check before deserializing response
This commit adds a status code check to the following requests, only when
this check passes, we deserialize the response JSON body:
- get_connectors_by_server
- mcp_server_search
- datasource_search
A helper function `status_code_check(response, allowed_status_codes)`
is added to make refactoring easier.
* chore: release notes
This commit bumps the windows crate from "0.60.0" to "0.61.3", it should
solve the CI issue happened here[1]:
```text
error[E0277]: `DBOBJECT` doesn't implement `Debug`
--> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\windows-0.60.0\src\Windows\Win32\System\Search\mod.rs:21828:5
|
21826 | #[derive(Clone, Debug, PartialEq)]
| ----- in this derive macro expansion
21827 | pub struct SSVARIANT_0_4 {
21828 | pub dbobj: DBOBJECT,
| ^^^^^^^^^^^^^^^^^^^ the trait `Debug` is not implemented for `DBOBJECT`
|
= note: add `#[derive(Debug)]` to `DBOBJECT` or manually `impl Debug for DBOBJECT`
```
[1]: https://github.com/infinilabs/ci/actions/runs/16314479643/job/46076989290
This commit implements the file search extension for Windows platforms using the [Windows Search](https://learn.microsoft.com/en-us/windows/win32/search/-search-3x-wds-qryidx-overview) functionality.
Something to note:
1. Searching by file content is not natively supported. Coco would search for all the columns (attributes/fields within the index) with this option:
```rust
SearchBy::NameAndContents => {
// Windows File Search does not support searching by file content.
//
// `CONTAINS('query_string')` would search all columns for `query_string`,
// this is the closest solution we have.
format!("((System.FileName LIKE '%{query_string}%') OR CONTAINS('{query_string}'))")
}
```
2. Tests have been added, but they failed in our CI for unknown reasons so I disabled them:
```rust
// Skip these tests in our CI, they fail with the following error
// "SQL is invalid: "0x80041820""
//
// I have no idea about the underlying root cause
#[cfg(all(test, not(ci)))]
mod test {
```
3. The Windows Search index is not real-time and can return obsolete results. Opening the returned documents could fail if the chosen file has been deleted or moved.
* chore: rename QuickLink/quick_link to Quicklink/quicklink
Standardize varaible naming to match the correct term: "Quicklink" and "quicklink".
This updates all incorrect variants such as "QuickLink" and "quick_link".
* chore: release notes
* chore: bump dep applications-rs
Currently Coco depends on atty v0.2.14, a crate that has
[vulnerability](https://github.com/infinilabs/coco-app/security/dependabot/25),
here is the dependency chain:
```
coco -> applications-rs -> freedesktop-file-parser 0.1.0 -> atty 0.2.14
```
I bumped the [`freedesktop-file-parser`](7bdb070e45)
crate in our applications-rs crate, which would eliminate the `atty` crate
from the chain to fix the vulnerability.
This commit bumps the applications-rs crate to include the above change.
* chore: release notes
* refactor: adjust extension code hierarchy
In this commit, I refactored the extension code structure.
* We can only install third-party extensions so the `store.rs` file should
belong to the `third_party` directory.
* Move tauri command `uninstall_extension()` to `extension/mod.rs` from
`third_party.rs` since one can uninstall an extension regardless of
how you installed it.
* Refactor the `install_extension_from_store()` function, add more
descriptive code comments.
Also, a trivial change, bump Rust toolchain and edition to use the
[let-chains](https://blog.rust-lang.org/2025/06/26/Rust-1.88.0/#let-chains) syntax.
* chore: release notes
* chore: replace meval-rs with our fork to clear dep warning
This commit replaces the meval-rs dependency with our
[fork](https://github.com/infinilabs/meval-rs). The original meval-rs
crate has not been maintained for a long time and uses nom 1.0, a crate
that was released 9 years ago, which would be rejected by future Rust
compiler because it contains outdated Rust syntaxes. This is the reason
why we are seeing the following warning:
```
warning: the following packages contain code that will be rejected by a future version of Rust: nom v1.2.4
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 1
```
Switching to our fork would solve this warning.
* chore: release notes