Commit Graph
245 Commits
Author SHA1 Message Date
github-actions[bot] 6bbd44d4ef publish new versions (#3675)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-10 12:50:18 -03:00
Lucas Nogueira 46f7c878a0 chore: fmt 2026-10-09 15:08:52 -03:00
Lucas Fernandes Nogueira e03dca60e7 fix(fs): accept absolute paths in the iOS security-scope commands (#3628)
In plugins/fs/src/commands.rs, start/stop_accessing_security_scoped_resource
only handled SafeFilePath::Url, so a plain path was a silent no-op
although the JS docs say "path or file:// URL" (and
Fs::stop_accessing_security_scoped_resource accepts paths).

Absolute paths are now converted to file:// URLs first; relative paths keep
being ignored. iOS-only code: formatted but not compiled here (the iOS
tauri build script fails in this environment).
2026-10-09 13:25:05 -03:00
Lucas Fernandes Nogueira 3a9000177c fix(fs): resolve symlinks of missing paths before checking the scope (#3627)
In plugins/fs/src/commands.rs resolve_path / is_forbidden, only paths
that already existed were canonicalized, so a new file below a symlinked
directory in the scope was matched by its unresolved path and written
outside of the scope. Relative symlink targets were resolved against the
process CWD, only the link target was checked against deny patterns, and
resolution errors made is_forbidden fail open.

resolve_path now computes the real path (canonical nearest existing
ancestor + remaining components, following dangling symlinks relative to
their parent, bounded to 40 links) and checks it against the allow and deny
patterns; deny patterns also match the path as given. Resolution errors
fail closed. Unit tests cover symlinked ancestors, relative and dangling
links and loops.
2026-10-09 13:21:34 -03:00
Lucas Fernandes Nogueira f81f0447cc fix(fs): read uncompressed Android assets from the cache copy (#3635)
In plugins/fs/android/src/main/java/FsPlugin.kt getFileDescriptor, for
uncompressed assets AssetManager.openFd returns an AssetFileDescriptor
whose parcel descriptor is the whole APK; its startOffset/length were
dropped and Rust read from offset 0, i.e. APK bytes. Only compressed
assets (openFd throws) took the cache copy path.

All assets now use the cache copy path. The cache file path is also checked
to stay below cacheDir/_assets. Kotlin not compiled here: unverified, needs
an on-device check.
2026-10-09 13:20:34 -03:00
Lucas Fernandes Nogueira a934743b73 feat(fs): allow disabling the drag and drop scope extension (#3637)
In plugins/fs/src/lib.rs on_event, every path dropped onto any window is
added to the global runtime scope, directories recursively, with no
opt-out.

Adds the `scopeDroppedPaths` plugin config option (default true, the
current behaviour) so apps can turn it off. Changing the default or
scoping it per window is deferred to v3.
2026-10-09 13:07:34 -03:00
Lucas Fernandes Nogueira 085a02835d fix(fs): return an error when Android returns no file descriptor (#3636)
In plugins/fs/src/android.rs resolve_content_uri, a null `fd` from
getFileDescriptor (openAssetFileDescriptor returning null, e.g. for
virtual files) hit unimplemented!() and panicked inside the command handler.

It now returns an Unsupported I/O error. Also switches the two
io::Error::new(Other, ..) calls to io::Error::other, which clippy flags on
the Android target. Checked with cargo clippy --target aarch64-linux-android.
2026-10-09 13:06:59 -03:00
Lucas Fernandes Nogueira 5de7ebfc95 fix(fs): do not deserialize customFlags from IPC (#3634)
In plugins/fs/src/lib.rs OpenOptions, custom_flags was deserializable
from the `open` command arguments even though it is not in the TS types,
so a webview with a read-only permission set could pass arbitrary open(2)
flags such as O_TRUNC.

The field is now #[serde(skip)]; Rust callers still set it through
OpenOptionsExt. Rejecting write/truncate/create options of `open` under
read-only sets changes permission semantics and is deferred to v3.
2026-10-09 13:05:12 -03:00
Lucas Fernandes Nogueira 77d00a4f54 fix(fs): reject negative offsets when seeking from the start (#3633)
In plugins/fs/src/commands.rs seek, `SeekFrom::Start(offset as u64)`
turned -1 into u64::MAX. The offset is now converted with u64::try_from
and a negative one is an error. E2E spec added.
2026-10-09 13:04:44 -03:00
Lucas Fernandes Nogueira 5c144e7466 fix(fs): only split UTF-16 lines on aligned line feeds (#3631)
In plugins/fs/src/commands.rs read_until_bytes / LinesBytes, the line
feed sequence was matched at any byte offset, so UTF-16LE "ਗĀ"
(17 0a 00 01) or UTF-16BE "Āਗ" (01 00 0a 17) split mid code unit and every
following line was decoded misaligned.

Line feed and carriage return sequences now only match on a multiple of
their length from the start of the line. Unit tests with both examples
(they fail without the fix).
2026-10-09 13:04:09 -03:00
Lucas Fernandes Nogueira dcc8cb032b fix(fs): truncate the file when writeFile writes a stream (#3629)
In plugins/fs/guest-js/index.ts writeFile, the stream path opened the
file with {write, create} but no truncate, unlike the buffer path which
truncates unless `append` is set (commands.rs write_file_inner), so
shorter content left stale trailing bytes.

The stream path now passes `truncate: !options?.append`. api-iife.js
regenerated. E2E spec covers overwrite and append with a stream.
2026-10-09 13:01:30 -03:00
Lucas Fernandes Nogueira 5e6c023a79 fix(fs): cap the buffer allocated by the read command (#3626)
In plugins/fs/src/commands.rs read, `vec![0; len]` used the length sent
by the webview as is, so a huge `len` aborted the process on allocation
failure, and the whole buffer (not only the bytes read) was sent back.

The length is now capped to the rest of the file (at least 64 KiB) for
regular files and to 64 MiB otherwise, the allocation uses try_reserve so a
failure is an error, and the buffer is truncated to the bytes read. The JS
side only ever used the first `nread` bytes. Unit test for the cap.
2026-10-09 12:58:35 -03:00
github-actions[bot]andLucas Nogueira cbfd428bcc Publish New Versions (v2) (#3618)
* publish new versions

* clippy

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2026-09-26 17:21:49 -03:00
Lucas Nogueira f460570b44 chore: fmt 2026-09-26 15:57:33 -03:00
Lucas Nogueira a433ec09d1 fix: mobile clippy warnings 2026-09-26 15:57:33 -03:00
Lucas Nogueira 3d8a3c877b chore: edition 2024 2026-09-26 15:36:22 -03:00
Lucas Nogueira 9b29b601f3 feat: update to tauri 2.12
- (MSRV bump
- Android compiler options update
- notification plugin windows7 feature deprecation
2026-09-26 14:46:48 -03:00
Lucas Fernandes Nogueira 1cae06a55b fix(fs): report read errors of readTextFileLines (#3625)
* fix(fs): report read errors of readTextFileLines

In plugins/fs/src/commands.rs read_text_file_lines_next, a read error was
mapped to "not done, empty line", so a persistent error such as EISDIR
(File::open of a directory succeeds on Unix) made the iterator yield ""
forever and the error was swallowed.

The command now closes the resource and returns the error; the JS iterator
resets its rid so a new iteration starts over. api-iife.js regenerated. E2E
spec iterates a directory and expects a rejection.

* fix(fs): close the file when a readTextFileLines loop exits early

In plugins/fs/guest-js/index.ts readTextFileLines, the async iterator did
not implement return(), so breaking out of a for await loop left the
StdLinesResource (an open file) in the webview resource table.

return() now closes the resource and resets the iterator. api-iife.js
regenerated. E2E spec breaks out of a loop, checks the resource id is no
longer valid and that iterating again starts over.
2026-09-23 13:05:04 -03:00
Lucas Fernandes Nogueira 9106093f77 fix(fs): map open options to valid Android modes (#3624)
In plugins/fs/src/lib.rs OpenOptions::android_mode, the mode was built by
concatenating r/w/t/a, so open(url, {append: true}) (read defaults to
true) produced "ra" and write+truncate+append "wta", which
ParcelFileDescriptor.parseMode / ContentResolver reject.

The options now map to r, w, wt, wa, rw or rwt. append wins over the
default read (no read+append mode exists). create/createNew still have no
Android equivalent (documented on the function). Unit tests for the
mapping, compiled on the host with cfg(test).
2026-09-23 12:58:28 -03:00
Lucas Fernandes Nogueira 97e865bc13 feat(fs): accept baseDir in size (#3623)
In plugins/fs/guest-js/index.ts, the size function only sent `path`
although the Rust command accepts `options.baseDir` and the JSDoc example
passed `{ baseDir: BaseDirectory.AppData }` (a TS error, silently dropped
at runtime, so the relative path was rejected).

Adds an optional `options?: SizeOptions` parameter (new exported type).
api-iife.js regenerated. The e2e spec now measures a file and a directory
relative to AppData instead of working around the missing option.
2026-09-23 12:58:03 -03:00
Lucas Fernandes Nogueira b46a88ff55 fix(fs): reject malformed write_file options instead of ignoring them (#3622)
In plugins/fs/src/commands.rs write_file_inner, a malformed or non-ASCII
`options` header was dropped with .ok(), so baseDir/append/createNew were
silently ignored and the call became a truncating write to the raw path;
the JSON array body fallback truncated values above 255 and dropped
non-numbers.

The header is parsed with parse_write_file_options: empty, `undefined`
(what fetch sends for JSON.stringify(undefined)) and `null` mean no
options, anything else must parse. Array bodies must only contain bytes.
Unit test for the header parser; e2e spec for writes without options,
which is the case the `undefined` handling keeps working.
2026-09-23 12:57:49 -03:00
Lucas Fernandes Nogueira 0c84c917e3 fix(fs): log file watcher errors (#3621)
In plugins/fs/src/watcher.rs, notify errors were discarded (TODO), so a
watch that died left no trace. They are now logged with log::error!.
Reporting them to the JS callback would change the event payload and is
deferred to v3.
2026-09-23 12:57:33 -03:00
Lucas Fernandes Nogueira 28d644572c test(docs): run doctest on CI, make sure doctests pass (#3620)
* test(docs): run doctest on CI, make sure doctests pass

* no_run on dialog doctests [skip ci]
2026-09-22 13:18:21 -03:00
Lucas Nogueira a87a3c7d44 chore: update documentation 2026-09-22 11:30:47 -03:00
Lucas Fernandes Nogueira ae3c808eb6 fix: global API script should reuse window.__TAURI__ types (#3602)
currently each script inlines what it needs from @tauri-apps/api, so type checks like `image instanceof Image` all fail
2026-09-22 06:04:28 -03:00
github-actions[bot] 6aa2854f31 publish new versions (#3509)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-31 19:17:31 +08:00
Tony db9c5998fe fix(android): missing consumer-rules.pro (#3531)
* fix(android): missing `consumer-rules.pro`

* setup android test

* copy right too new

* build api first

* we're still on gradle 8 right now...

* restore the right host on mac
2026-08-13 17:44:29 +08:00
Tony 685610ae78 fix(fs): default permissions (#3507)
* Fix deny-webview-data platfroms and scopes

* Fix `create-app-specific-dirs` scopes

* Fix read-app-specific-dirs-recursive

* Re-generate schema and docs

* Remove unused `fs:allow-unwatch`

* Add change file

* Remove unused permissions

* Update linux permissions

* Update change file

* regenerate doc md and schema
2026-08-10 15:48:27 +08:00
Tony f8053e659e docs: cargo features (#3527)
* dialog

* fs

* geolocation

* haptic

* log

* single instance

* notification

* updater

* ##

* persisted scopes

* stronghold

* sql

* upload

* websocket

* http
(this one was too long that I generated through codex, didn't review yet)

* add change file

* no persisted-scope-js

* add `://`

* Merge branch 'v2' into document-cargo-features

* update system-proxy docs

* finish http docs

* notification doesn't need version bumps

* clean up docs
2026-08-05 15:48:11 +08:00
paul valladares dc7f87bc7e chore: exclude dev-only files from published crates (#3518)
* chore: exclude dev-only files from published crates

* format
2026-07-29 09:35:15 +02:00
Vitor AyresandTony 3fb27bf13a fix(docs): deep link platform specific and fs scope (#3504)
* deep link fix Platform Specific heading

* fix fs permission toml

* .changes

* Update change files

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

* Update .changes/fs-deny-scope.md

* fix eol

---------

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2026-07-21 14:56:52 +08:00
Tony 7e45774610 refactor(fs): cfg gate some ios code (#3510) 2026-07-21 14:42:45 +08:00
Jsu e571e0be9d docs(fs): typo wether -> whether in commands.rs (#3429) 2026-05-23 21:28:55 +02:00
github-actions[bot] 5c7668b6bb publish new versions (#3397)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-02 19:37:51 +08:00
renovate[bot]andTony ec0540138b chore(deps): update rust crate toml to v1 (#3323)
* chore(deps): update rust crate toml to v1

* downgrade to 1.0.x in lockfile

* Add change file

* Downgrade indexmap

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2026-05-01 18:09:41 +08:00
Tony b86e999beb chore(deps): update tauri packages to 2.11 (#3407)
* chore(deps): update tauri packages to 2.11

* Downgrade derive_more

* Fix audit

* Update tauri-plugin
2026-05-01 16:39:43 +08:00
renovate[bot]andTony 250857b7b7 chore(deps): update dependency typescript to v6 (#3363)
* chore(deps): update dependency typescript to v6

* Use 6.0.3

* Fix eslint

* Add `rootDir` since it's no longer inferred
  > https://github.com/microsoft/TypeScript/issues/62508#issuecomment-3348659946

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2026-04-18 18:57:41 +08:00
github-actions[bot] d6a3898001 Publish New Versions (v2) (#3268)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-04 18:47:18 +02:00
Tony f75d21db33 chore(deps): remove used of tauri-utils build feature (#3360) 2026-03-25 22:22:30 +08:00
renovate[bot]andTony 2c0883e64e chore(deps): update dependency vite to v8 (#3346)
* chore(deps): update dependency vite to v8

* `pnpm update --recursive`

* Regenerate api-iife

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2026-03-20 20:05:30 +08:00
Lucas Fernandes NogueiraandFabianLars f5f68063e4 feat(fs): access security scoped resources on iOS (#3185)
Co-authored-by: FabianLars <30730186+FabianLars@users.noreply.github.com>
2026-03-04 13:59:03 +01:00
aiueo13andOkaYu 6c3da6d290 fix(fs): use correct line detection for encodings in readTextFileLines (#3273)
Co-authored-by: OkaYu <aiueo13>
2026-02-13 03:41:43 +02:00
Seiji Okuda e97a4dedab feat(fs): #3243 add encoding option to readTextFile functions (#3244)
* feat(fs): #3243 add encoding option to readFile and readTextFile functions

* feat(fs): add encoding option to ReadFileOptions and update readTextFileLines functions

* add change file
2026-02-09 16:08:26 +02:00
Lucas Fernandes Nogueira 89f3e17952 chore: bump tauri to 2.10 (#3246)
* chore: bump tauri to 2.10

* pnpm i

* audit fix
2026-02-02 21:48:08 -03:00
github-actions[bot] 6e2e7e48c3 publish new versions (#3070)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-08 15:34:17 +01:00
Elias*andTony 521cd8b372 fix(fs): off by one error in readTextFileLines (#3155)
* fix: off by one error in readTextFileLines (#3154)

Signed-off-by: EliasStar <31409841+EliasStar@users.noreply.github.com>

* Format and regenerate `api-iife.js`

---------

Signed-off-by: EliasStar <31409841+EliasStar@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-12-09 11:48:18 +08:00
github-actions[bot] e7a68fa637 publish new versions (#3068)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-27 11:31:06 +01:00
FabianLars 93426f8512 fix: fix docsrs builds 2025-10-27 11:12:56 +01:00
github-actions[bot] 06124af8d6 publish new versions (#2972)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-26 22:02:33 +01:00
Fabian-Lars 6c9b61fb65 chore: Update compileSdk to 36 (#3039) 2025-10-20 16:58:29 +02:00