Skip to content

Commit d7eb4cb

Browse files
thisisharsh7claude
andcommitted
fix(updater): add missing permissions and auto-check on launch for v0.1.6
This release fixes critical auto-updater issues that prevented v0.1.4 users from receiving update notifications. ## Key Fixes - Added missing updater and process permissions to capabilities file - Auto-updater now checks for updates on app launch (2s delay) - Improved error handling with visual feedback for failed update checks - Fixed permission errors that blocked update API calls ## Changes - src-tauri/capabilities/default.json: Added updater:*, process:allow-restart permissions - src/App.tsx: Added useEffect hook to check for updates on launch - src/components/ui/UpdateChecker.tsx: Enhanced error handling with red error text - Version bumped to 0.1.6 across all config files ## Technical Details The root cause was Tauri v2's security model blocking updater API calls due to missing permissions. Even though the updater plugin was initialized and configured correctly, the frontend couldn't call check(), download(), or install() without explicit permission grants. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 84dcc9b commit d7eb4cb

File tree

9 files changed

+91
-8
lines changed

9 files changed

+91
-8
lines changed

RELEASE_NOTES_v0.1.5.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## What's Changed
2+
3+
**Test release for auto-update functionality.** This release adds version display in Settings footer, making it easy to verify which version you're running. This is primarily a test release to verify that auto-updates from v0.1.4 work correctly.
4+
5+
### New Features
6+
- Added version number display in Settings footer (shows "v0.1.5")
7+
- Easy visual confirmation of successful updates
8+
9+
**Auto-update test:** Users on v0.1.4 should see "Update available" in Settings and be able to one-click update to v0.1.5. After update, Settings footer will show "v0.1.5" confirming the update worked.
10+
11+
## Download
12+
13+
### macOS
14+
- **Apple Silicon (M1/M2/M3/M4):** [Seeva.AI.Assistant_aarch64.app.tar.gz](https://github.com/thisisharsh7/seeva-ai-assistant/releases/download/v0.1.5/Seeva.AI.Assistant_aarch64.app.tar.gz)
15+
- **Intel:** [Seeva.AI.Assistant_x64.app.tar.gz](https://github.com/thisisharsh7/seeva-ai-assistant/releases/download/v0.1.5/Seeva.AI.Assistant_x64.app.tar.gz)
16+
17+
**First launch:** Right-click → Open. If "app is damaged" error appears, run:
18+
```bash
19+
xattr -d com.apple.quarantine "/path/to/Seeva AI Assistant.app"
20+
21+
# Example if in Downloads:
22+
xattr -d com.apple.quarantine "~/Downloads/Seeva AI Assistant.app"
23+
24+
# Example if in Applications:
25+
xattr -d com.apple.quarantine "/Applications/Seeva AI Assistant.app"
26+
```
27+
28+
### Windows
29+
- **EXE Installer:** [Seeva.AI.Assistant_0.1.5_x64-setup.exe](https://github.com/thisisharsh7/seeva-ai-assistant/releases/download/v0.1.5/Seeva.AI.Assistant_0.1.5_x64-setup.exe)
30+
- **MSI Installer:** [Seeva.AI.Assistant_0.1.5_x64_en-US.msi](https://github.com/thisisharsh7/seeva-ai-assistant/releases/download/v0.1.5/Seeva.AI.Assistant_0.1.5_x64_en-US.msi)
31+
32+
### Linux
33+
- **Debian/Ubuntu:** [Seeva.AI.Assistant_0.1.5_amd64.deb](https://github.com/thisisharsh7/seeva-ai-assistant/releases/download/v0.1.5/Seeva.AI.Assistant_0.1.5_amd64.deb)
34+
- **Fedora/RHEL:** [Seeva.AI.Assistant-0.1.5-1.x86_64.rpm](https://github.com/thisisharsh7/seeva-ai-assistant/releases/download/v0.1.5/Seeva.AI.Assistant-0.1.5-1.x86_64.rpm)
35+
- **AppImage:** [Seeva.AI.Assistant_0.1.5_amd64.AppImage](https://github.com/thisisharsh7/seeva-ai-assistant/releases/download/v0.1.5/Seeva.AI.Assistant_0.1.5_amd64.AppImage)
36+
37+
## Requirements
38+
- **macOS:** 10.15 (Catalina) or later
39+
- **Windows:** Windows 10 (64-bit) or later
40+
- **Linux:** Ubuntu 20.04+ / Fedora 34+ / Any distro with AppImage support
41+
42+
**Issues?** https://github.com/thisisharsh7/seeva-ai-assistant/issues

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "seeva-ai-assistant",
33
"private": true,
4-
"version": "0.1.5",
4+
"version": "0.1.6",
55
"description": "Cross-platform AI assistant with screenshot capabilities",
66
"type": "module",
77
"scripts": {

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tauri-app"
3-
version = "0.1.5"
3+
version = "0.1.6"
44
description = "A Tauri App"
55
authors = ["you"]
66
edition = "2021"

src-tauri/capabilities/default.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
"core:window:allow-set-position",
1515
"core:window:allow-set-size",
1616
"core:window:allow-hide",
17-
"core:window:allow-show"
17+
"core:window:allow-show",
18+
"updater:default",
19+
"updater:allow-check",
20+
"updater:allow-download",
21+
"updater:allow-install",
22+
"process:default",
23+
"process:allow-restart"
1824
]
1925
}

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "Seeva AI Assistant",
4-
"version": "0.1.5",
4+
"version": "0.1.6",
55
"identifier": "ai.seeva.assistant",
66
"build": {
77
"beforeDevCommand": "bun run dev",

src/App.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useTheme } from "./hooks/useTheme";
55
import { useEffect } from "react";
66
import { shortcutAPI } from "./lib/tauri-api";
77
import { useSettingsStore } from "./stores/settingsStore";
8+
import { check } from "@tauri-apps/plugin-updater";
89

910
function App() {
1011
// Set up stream event listener
@@ -18,6 +19,25 @@ function App() {
1819
document.documentElement.setAttribute('data-theme', theme);
1920
}, [theme]);
2021

22+
// Check for updates on app launch
23+
useEffect(() => {
24+
const checkForUpdates = async () => {
25+
try {
26+
const update = await check();
27+
if (update) {
28+
console.log('Update available:', update.version);
29+
}
30+
} catch (error) {
31+
console.error('Failed to check for updates on launch:', error);
32+
}
33+
};
34+
35+
// Check for updates 2 seconds after app launch to avoid blocking startup
36+
const timeoutId = setTimeout(checkForUpdates, 2000);
37+
38+
return () => clearTimeout(timeoutId);
39+
}, []);
40+
2141
// Register global shortcut on mount and when shortcut changes
2242
// Note: Window toggle is now handled directly in Rust to avoid race conditions
2343
useEffect(() => {

src/components/ui/UpdateChecker.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export function UpdateChecker({ className = '' }: UpdateCheckerProps) {
1313
const [isInstalling, setIsInstalling] = useState(false);
1414
const [downloadProgress, setDownloadProgress] = useState(0);
1515
const [showUpToDate, setShowUpToDate] = useState(false);
16+
const [error, setError] = useState<string | null>(null);
1617

1718
const upToDateTimeoutRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
1819
const isManualCheckRef = useRef(false);
@@ -34,6 +35,7 @@ export function UpdateChecker({ className = '' }: UpdateCheckerProps) {
3435

3536
try {
3637
setIsChecking(true);
38+
setError(null);
3739
const update = await check();
3840

3941
if (update) {
@@ -54,6 +56,13 @@ export function UpdateChecker({ className = '' }: UpdateCheckerProps) {
5456
}
5557
} catch (error) {
5658
console.error('Failed to check for updates:', error);
59+
setError('Failed to check for updates');
60+
if (upToDateTimeoutRef.current) {
61+
clearTimeout(upToDateTimeoutRef.current);
62+
}
63+
upToDateTimeoutRef.current = setTimeout(() => {
64+
setError(null);
65+
}, 5000);
5766
} finally {
5867
setIsChecking(false);
5968
isManualCheckRef.current = false;
@@ -69,6 +78,7 @@ export function UpdateChecker({ className = '' }: UpdateCheckerProps) {
6978
try {
7079
setIsInstalling(true);
7180
setDownloadProgress(0);
81+
setError(null);
7282
downloadedBytesRef.current = 0;
7383
contentLengthRef.current = 0;
7484
const update = await check();
@@ -98,6 +108,10 @@ export function UpdateChecker({ className = '' }: UpdateCheckerProps) {
98108
await relaunch();
99109
} catch (error) {
100110
console.error('Failed to install update:', error);
111+
setError('Failed to install update');
112+
setTimeout(() => {
113+
setError(null);
114+
}, 5000);
101115
} finally {
102116
setIsInstalling(false);
103117
setDownloadProgress(0);
@@ -107,6 +121,7 @@ export function UpdateChecker({ className = '' }: UpdateCheckerProps) {
107121
};
108122

109123
const getUpdateStatusText = () => {
124+
if (error) return error;
110125
if (isInstalling) {
111126
return downloadProgress > 0 && downloadProgress < 100
112127
? `Downloading ${downloadProgress}%`
@@ -129,7 +144,7 @@ export function UpdateChecker({ className = '' }: UpdateCheckerProps) {
129144

130145
const isUpdateDisabled = isChecking || isInstalling;
131146
const isUpdateClickable =
132-
!isUpdateDisabled && (updateAvailable || (!isChecking && !showUpToDate));
147+
!isUpdateDisabled && (updateAvailable || (!isChecking && !showUpToDate && !error));
133148

134149
return (
135150
<div className={`flex items-center gap-2 ${className}`}>
@@ -150,7 +165,7 @@ export function UpdateChecker({ className = '' }: UpdateCheckerProps) {
150165
{getUpdateStatusText()}
151166
</button>
152167
) : (
153-
<span className="text-xs text-tertiary">
168+
<span className={`text-xs ${error ? 'text-red-400' : 'text-tertiary'}`}>
154169
{getUpdateStatusText()}
155170
</span>
156171
)}

src/lib/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ModelInfo, Settings } from './types';
22

33
// App metadata
44
export const APP_NAME = 'Seeva AI Assistant';
5-
export const APP_VERSION = '0.1.5';
5+
export const APP_VERSION = '0.1.6';
66

77
// Default settings
88
export const DEFAULT_SETTINGS: Settings = {

0 commit comments

Comments
 (0)