Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(agent): major version dependency bump #4446

Merged

Conversation

CuriousCorrelation
Copy link
Contributor

@CuriousCorrelation CuriousCorrelation commented Oct 17, 2024

This is a consolidated dependency bump PR for agent.

Closes HFE-614, HFE-620, HFE-621

tauri-plugin-store

Summary

Updating tauri-plugin-store in Hoppscotch Agent.

Package Updated

Package Old Version New Version
tauri-plugin-store 2.0.0-rc.3 2.0.1

Changes

  1. Updated tauri-plugin-store dependency in Cargo.toml
  2. Modified state.rs to use new API for store operations
  3. Updated error handling in error.rs
  4. Refactored store initialization and usage in state.rs

Code Changes

Cargo.toml

- tauri-plugin-store = "2.0.0-rc.3"
+ tauri-plugin-store = "2.0.1"

src/error.rs

+ #[error("Store error: {0}")]
+ TauriPluginStore(#[from] tauri_plugin_store::Error),

src/state.rs

- let mut store = StoreBuilder::new("app_data.bin").build(app_handle);
+ let store = StoreBuilder::new(&app_handle, "app_data.bin").build();

- let _ = store.load();
+ let _ = store.load()?;

- store.delete("registrations").map_err(|_| AppError::RegistrationClearError)?;
+ let _ = store
+     .delete("registrations")
+     .then_some(())
+     .ok_or(AppError::RegistrationClearError)?;

- store.insert("registrations".into(), serde_json::to_value(self.registrations.clone()).unwrap())
-     .map_err(|_| AppError::RegistrationInsertError)?;
+ let _ = store.set(
+     "registrations",
+     serde_json::to_value(self.registrations.clone()).unwrap(),
+ );

Breaking Changes

  • Changed StoreBuilder::new() to take a reference to app_handle
  • Replaced store.insert() with store.set()
  • Updated error handling for store operations

Additional Updates

  • Better error handling with TauriPluginStore error variant
  • Refactored store initialization and usage for error propagation.

Status

Post dep bump registration

agent-post-store-dep-bump-registration

Prompt

agent-post-store-dep-bump-otp

Success

agent-post-store-dep-bump-otp-success

Context Menu

agent-post-store-dep-bump-registration-clear-context-menu

Post Clear

agent-post-store-dep-bump-after-registration-clear

tauri-plugin-dialog

Updating tauri-plugin-dialog in Hoppscotch Agent.

Changes

  1. Updated tauri-plugin-dialog dependency in Cargo.toml
  2. Modified updater.rs to use new API for dialog buttons

Code Changes

Cargo.toml

- tauri-plugin-dialog = "2.0.0-rc.7"
+ tauri-plugin-dialog = "2.0.1"

src/updater.rs

- use tauri_plugin_dialog::MessageDialogKind;
- use tauri_plugin_dialog::DialogExt;
+ use tauri_plugin_dialog::DialogExt;
+ use tauri_plugin_dialog::MessageDialogButtons;
+ use tauri_plugin_dialog::MessageDialogKind;

// ...

- .ok_button_label("Update")
- .cancel_button_label("Cancel")
+ .buttons(MessageDialogButtons::OkCancelCustom(
+     "Update".to_string(),
+     "Cancel".to_string(),
+ ))

Breaking Changes

  • Replaced MessageDialogBuilder::ok_button_label and MessageDialogBuilder::cancel_button_label with MessageDialogBuilder::buttons which now takes an enum

@CuriousCorrelation CuriousCorrelation changed the title chore: major version dependency bump chore(agent): major version dependency bump Oct 17, 2024
@CuriousCorrelation CuriousCorrelation marked this pull request as ready for review October 22, 2024 05:33
- Refactor updater, state and dialog buttons for breaking changes after bump
- Upgrade various Rust and Node.js dependencies
- Add `cargo-edit` to `devenv.nix` for easier Cargo management
@AndrewBastin AndrewBastin force-pushed the agent/deps/bump/consolidated branch from 6452bd3 to ab00b2c Compare October 23, 2024 14:42
@AndrewBastin AndrewBastin merged commit aef11e3 into hoppscotch:next Oct 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants