Skip to content

Commit 7991479

Browse files
chore(deps): bump actions/checkout from 6.0.2 to 6.0.3 (#155)
* chore(deps): bump actions/checkout from 6.0.2 to 6.0.3 Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@de0fac2...df4cb1c) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix: run cargo fmt and add missing fields to test struct * fix: correct undo/redo logic for cell edits and insert rows * fix: add missing ConnectionProfile fields to integration_tests.rs --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Elliot <ElliotWorth@protonmail.com>
1 parent c08a0e1 commit 7991479

10 files changed

Lines changed: 58 additions & 25 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
name: Dependency Age Gate
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
1717
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
1818
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
1919
with:
@@ -28,7 +28,7 @@ jobs:
2828
name: Lint (TypeScript)
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
31+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3232
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
3333
with:
3434
node-version: '20'
@@ -44,7 +44,7 @@ jobs:
4444
name: Lint (Rust)
4545
runs-on: ubuntu-latest
4646
steps:
47-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
47+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
4848
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
4949
with:
5050
components: rustfmt, clippy
@@ -82,7 +82,7 @@ jobs:
8282
--health-timeout 5s
8383
--health-retries 10
8484
steps:
85-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
85+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
8686
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
8787
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
8888
with:
@@ -106,7 +106,7 @@ jobs:
106106
name: Test Frontend
107107
runs-on: ubuntu-latest
108108
steps:
109-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
109+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
110110
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
111111
with:
112112
node-version: '20'
@@ -133,7 +133,7 @@ jobs:
133133
runs-on: ubuntu-latest
134134
needs: [test-rust, test-frontend]
135135
steps:
136-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
136+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
137137
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
138138
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
139139
with:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
steps:
3333
- name: Checkout
34-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3535

3636
- name: Install Linux dependencies
3737
if: matrix.platform == 'ubuntu-22.04'

src-tauri/crates/mas-admin/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,7 @@ impl AdminService {
101101
) -> Result<(), CoreError> {
102102
tracing::info!(process_id = process_id, "Killing MySQL process");
103103
let pool = self.connection_manager.get_pool(connection_id)?;
104-
let result = sqlx::query("KILL ?")
105-
.bind(process_id)
106-
.execute(&pool)
107-
.await;
104+
let result = sqlx::query("KILL ?").bind(process_id).execute(&pool).await;
108105
match result {
109106
Ok(_) => {
110107
tracing::info!(process_id = process_id, "Process killed successfully");

src-tauri/crates/mas-core/src/connection/manager.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ impl ConnectionManager {
3535
"Creating connection pool"
3636
);
3737

38-
let charset = profile.charset.clone().unwrap_or_else(|| "utf8mb4".to_string());
38+
let charset = profile
39+
.charset
40+
.clone()
41+
.unwrap_or_else(|| "utf8mb4".to_string());
3942
let mut options = MySqlConnectOptions::new()
4043
.host(&profile.host)
4144
.port(profile.port)
@@ -64,7 +67,9 @@ impl ConnectionManager {
6467
.after_connect(move |conn, _meta| {
6568
let charset = charset_for_after_connect.clone();
6669
Box::pin(async move {
67-
sqlx::query(&format!("SET NAMES {}", charset)).execute(&mut *conn).await?;
70+
sqlx::query(&format!("SET NAMES {}", charset))
71+
.execute(&mut *conn)
72+
.await?;
6873
Ok(())
6974
})
7075
})
@@ -150,7 +155,10 @@ impl ConnectionManager {
150155
) -> Result<TestConnectionResult, CoreError> {
151156
let start = Instant::now();
152157

153-
let charset = profile.charset.clone().unwrap_or_else(|| "utf8mb4".to_string());
158+
let charset = profile
159+
.charset
160+
.clone()
161+
.unwrap_or_else(|| "utf8mb4".to_string());
154162
let mut options = MySqlConnectOptions::new()
155163
.host(&profile.host)
156164
.port(profile.port)

src-tauri/crates/mas-core/src/connection/store.rs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,21 @@ impl ConnectionStore {
5555
db.execute("ALTER TABLE connection_profiles ADD COLUMN env TEXT", [])
5656
.ok();
5757
// Migration: add advanced settings columns if missing
58-
db.execute("ALTER TABLE connection_profiles ADD COLUMN connect_timeout_secs INTEGER", [])
59-
.ok();
60-
db.execute("ALTER TABLE connection_profiles ADD COLUMN query_timeout_secs INTEGER", [])
61-
.ok();
62-
db.execute("ALTER TABLE connection_profiles ADD COLUMN charset TEXT", [])
63-
.ok();
58+
db.execute(
59+
"ALTER TABLE connection_profiles ADD COLUMN connect_timeout_secs INTEGER",
60+
[],
61+
)
62+
.ok();
63+
db.execute(
64+
"ALTER TABLE connection_profiles ADD COLUMN query_timeout_secs INTEGER",
65+
[],
66+
)
67+
.ok();
68+
db.execute(
69+
"ALTER TABLE connection_profiles ADD COLUMN charset TEXT",
70+
[],
71+
)
72+
.ok();
6473
tracing::debug!("Connection profiles table initialized");
6574
Ok(())
6675
}

src-tauri/crates/mas-core/tests/integration_tests.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ fn test_profile() -> ConnectionProfile {
4242
pool_min: 1,
4343
pool_max: 5,
4444
read_only: false,
45+
connect_timeout_secs: None,
46+
query_timeout_secs: None,
47+
charset: None,
4548
environment: None,
4649
created_at: Utc::now(),
4750
updated_at: Utc::now(),

src-tauri/crates/mas-core/tests/query_database_context_regression.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ fn test_profile() -> ConnectionProfile {
2020
pool_min: 1,
2121
pool_max: 5,
2222
read_only: false,
23+
connect_timeout_secs: None,
24+
query_timeout_secs: None,
25+
charset: None,
2326
environment: None,
2427
created_at: Utc::now(),
2528
updated_at: Utc::now(),

src-tauri/src/commands/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,9 @@ pub async fn write_file_contents(path: String, contents: String) -> Result<(), S
534534
.ok_or_else(|| "Invalid path: missing file name".to_string())?,
535535
)
536536
} else {
537-
path_buf.canonicalize().map_err(|e| format!("Invalid path: {e}"))?
537+
path_buf
538+
.canonicalize()
539+
.map_err(|e| format!("Invalid path: {e}"))?
538540
};
539541
tokio::fs::write(&resolved, &contents).await.map_err(|e| {
540542
tracing::error!(error = %e, path = %path, "Failed to write file");

src/components/editor/__tests__/QueryToolbar.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,10 @@ describe("QueryToolbar", () => {
386386
expect(screen.getByText("Save").closest("button")).toBeDisabled();
387387
});
388388

389-
it("shows Running state when executing", () => {
389+
it("shows Cancel button when executing", () => {
390390
mockIsExecuting = true;
391391
render(<QueryToolbar />);
392-
expect(screen.getByText("Running...")).toBeInTheDocument();
392+
expect(screen.getByText("Cancel")).toBeInTheDocument();
393393
expect(screen.queryByText("Run")).not.toBeInTheDocument();
394394
});
395395

src/hooks/useGridEditing.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export function useGridEditing() {
134134
setDeletes(new Set());
135135
undoStack.current = [];
136136
redoStack.current = [];
137+
bumpVersion();
137138
}, []);
138139

139140
const applyAction = useCallback((action: EditAction): EditAction => {
@@ -143,7 +144,11 @@ export function useGridEditing() {
143144
const next = new Map(prev);
144145
const rowChanges = [...(next.get(action.rowIndex) ?? [])];
145146
const existing = rowChanges.findIndex((c) => c.column === action.column);
146-
if (action.newValue === action.oldValue || (action.oldValue === undefined && action.newValue === action.oldValue)) {
147+
if (existing >= 0 && action.newValue === rowChanges[existing].originalValue) {
148+
rowChanges.splice(existing, 1);
149+
if (rowChanges.length === 0) next.delete(action.rowIndex);
150+
else next.set(action.rowIndex, rowChanges);
151+
} else if (action.newValue === action.oldValue) {
147152
if (existing >= 0) {
148153
rowChanges.splice(existing, 1);
149154
if (rowChanges.length === 0) next.delete(action.rowIndex);
@@ -172,6 +177,10 @@ export function useGridEditing() {
172177
return { ...action, index: -1 };
173178
}
174179
case "deleteRow": {
180+
if (action.rowIndex === -1) {
181+
setInserts((prev) => prev.slice(0, -1));
182+
return { type: "insertRow", index: 0 }; // forward action for redo
183+
}
175184
setDeletes((prev: Set<number>) => {
176185
const next = new Set(prev);
177186
if (next.has(action.rowIndex)) next.delete(action.rowIndex);
@@ -194,7 +203,9 @@ export function useGridEditing() {
194203
const redo = useCallback(() => {
195204
const action = redoStack.current.pop();
196205
if (!action) return;
197-
const reverse = applyAction(reverseAction(action));
206+
const reverse = action.type === "insertRow"
207+
? applyAction(action)
208+
: applyAction(reverseAction(action));
198209
undoStack.current.push(reverse);
199210
bumpVersion();
200211
}, [applyAction]);

0 commit comments

Comments
 (0)