`upload(url, path, onProgress, { headers, method })` and
`download(url, path, onProgress, { headers, body })` replace the
positional optional arguments.
`headers` accepts both a `Map` and a plain object; previously a `Map`
was silently serialized as an empty object.
* refactor(dialog)!: remove deprecated MessageDialogOptions.okLabel
Use `buttons: { ok: 'label' }` instead. `ConfirmDialogOptions` (used by
`ask` and `confirm`) still accepts `okLabel` and `cancelLabel`.
* Apply suggestion from @amrbashir
---------
Co-authored-by: Amr Bashir <github@amrbashir.me>
* refactor(fs)!: return Watcher from watch and watchImmediate
Both resolve to a `Watcher` resource instead of an `UnwatchFn` callback;
call `await watcher.close()` to stop watching. `UnwatchFn` is removed and
`Watcher` is now exported.
* fix change file
* fmt
`WatchEvent` now follows notify v8's format: the event kind is flattened
into the event, with `type` holding the top-level kind and `kind`/`mode`
refining it, e.g. `{ type: 'modify', kind: 'data', mode: 'content' }`
instead of `{ type: { modify: { kind: 'data', mode: 'content' } } }`.
`attrs` is now typed as `WatchEventAttributes` and its `flag` is
`rescan` instead of `Rescan`.
There has been no `unwatch` command since v2.0 (`Watcher.close()` releases
the resource), so `allow-unwatch` and `deny-unwatch` never granted anything.
`readTextFile` and `writeTextFile` now go through `read_file` and
`write_file`, so the `allow-read-text-file`, `deny-read-text-file`,
`allow-write-text-file` and `deny-write-text-file` permissions are gone;
grant `fs:allow-read-file` and `fs:allow-write-file` instead.
* refactor(deep-link)!: return Error::Execute when an OS command fails to run
On Linux, `register`, `unregister` and `is_registered` now fail with the
new `Error::Execute(command, io_error)` variant when `xdg-mime` or
`update-desktop-database` cannot be spawned, instead of logging and
returning the raw `Error::Io`. This is the change deferred to v3 in #2970.
* docs(deep-link): unregister does not run OS commands
* refactor(http)!: remove deprecated macos-system-configuration feature
Use `system-proxy` (enabled by default) instead.
* chore(upload): enable reqwest's system-proxy feature instead of the deprecated alias
---------
Co-authored-by: Lucas Nogueira <lucas@crabnebula.dev>
* refactor(http)!: always enforce the scope on redirects
Removes the `scopeRedirects` option (and the `Config` struct with it) that
was added as an opt-in in 2.7.0. Every hop of a redirect chain is now
checked against the URL scope, so a server on an allowed origin can no
longer redirect the request to a URL the scope denies.
`tauri_plugin_http::init()` returns `TauriPlugin<R>` again.
* chore(http): compile without warnings when the cookies feature is disabled
* refactor(store)!: reset to defaults before merging the on-disk state in reload
`Store::reload` / `reload()` previously merged the on-disk state into the
current in-memory store. It now resets the store to its defaults first,
so in-memory keys that are neither in the defaults nor on disk are
dropped. `reload_ignore_defaults` / `reload({ ignoreDefaults: true })`
is unchanged.
* test(store): cover reload resetting to the defaults before merging the on-disk state
---------
Co-authored-by: Lucas Nogueira <lucas@crabnebula.dev>
* fix(http): stop unhandled rejections from the fetch cleanup path
The request/body cleanup commands are fired as floating promises, and the
Rust side releases a resource only once: fetch_cancel_body is
resources_table.close(rid)?, and fetch_read_body also closes the rid at
end-of-body. So every release after the first rejects with BadResourceId
into a promise nobody is listening to.
Make dropBody idempotent and let both cleanup calls handle their own
rejection.
* chore: add changefile
* chore(http): rebuild api-iife.js
* 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
* feat(updater): option to not restart after install
* More platform cfg
* Add the same function for `UpdaterBuilder`
* Fix missing `#[cfg(windows)]`
* Mark `current_exe_args` cfg(windows)
* Mark `on_before_exit` cfg(windows)
* Mark `installer_args` cfg(windows)
* Note about `installer_arg` apply to both
* Remove current args and restart together
* Only build needed bundle on windows as well
* Remove `/NS` since it breaks the msi updater
* Add launch updater debug log
* Add a folder to test updates
* Remove unused `#[allow(unused)]`
* Format
* messed up git stage
* Add change file
* Clean up
* Disable NSIS compression for API example
* Bump wry for v1 test to pull in https://github.com/tauri-apps/wry/pull/1703
* format
* Make typescript happy
* Close new update on destroy
* Fix example insets
* Add app-region: drag
* Use `Theme.Material3.DayNight.NoActionBar`
* Re-generate some kotlin files
* Use MaterialAlertDialogBuilder
* Add change file
* Revert back to margin-top: 0.5rem
* Re-generate outdated gradle wrapper from #3039
* Move title bar to its own file
* Fix cancel message
* Use tokio UnixListener so the task can yield and release the thread
* use standard unix listener, convert to non blocking and cast into tokio yielding one
* Create fix-yield-single-instance-macos.md
* Update .changes/fix-yield-single-instance-macos.md
Co-authored-by: Fabian-Lars <30730186+FabianLars@users.noreply.github.com>
* use net feature in Tokio dependency
* Use tokio UnixListener::bind, inside the tokio task
---------
Co-authored-by: Fabian-Lars <30730186+FabianLars@users.noreply.github.com>