-
-
Notifications
You must be signed in to change notification settings - Fork 60
fix: preserve yolo/permission mode across remote switch; validate persisted values; fix Ionicons, QR scanning, MCP bridge on macOS Tauri; add health/relay/spawn-mode tests #144
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
base: dev
Are you sure you want to change the base?
Changes from 9 commits
0b0dfab
10a53a3
c921b99
f18e7ee
5185383
8cb7698
6a7fab2
50028c6
7c77927
9524cf7
ce2c7e5
ddf6265
26dd43f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,3 +12,5 @@ dist | |
| .claude/ | ||
|
|
||
| generated/ | ||
|
|
||
| prisma/migrations/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import Fastify from 'fastify'; | ||
| import { describe, expect, it, vi } from 'vitest'; | ||
|
|
||
| const mockQueryRaw = vi.fn(); | ||
|
|
||
| vi.mock('@/storage/db', () => ({ | ||
| db: { $queryRaw: mockQueryRaw }, | ||
| })); | ||
|
|
||
| describe('enableMonitoring (unit)', () => { | ||
| it('returns 503 with database connectivity error in body when database query fails', async () => { | ||
| mockQueryRaw.mockRejectedValueOnce(new Error('SQLITE_CANTOPEN: cannot open database')); | ||
|
|
||
| const { enableMonitoring } = await import('./enableMonitoring'); | ||
| const app = Fastify({ logger: false }) as any; | ||
|
|
||
| try { | ||
| enableMonitoring(app); | ||
| await app.ready(); | ||
|
|
||
| const res = await app.inject({ method: 'GET', url: '/health' }); | ||
| expect(res.statusCode).toBe(503); | ||
| const body = res.json() as { status?: string; service?: string; error?: string }; | ||
| expect(body.status).toBe('error'); | ||
| expect(body.service).toBe('happier-server'); | ||
| expect(body.error).toBe('Database connectivity failed'); | ||
| } finally { | ||
| await app.close().catch(() => {}); | ||
| } | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,15 @@ | ||
| import * as React from 'react'; | ||
| import { Platform, useWindowDimensions } from 'react-native'; | ||
| import { Platform } from 'react-native'; | ||
|
|
||
| import { isRunningOnMac } from '@/utils/platform/platform'; | ||
| import { RestoreQrView } from '@/components/account/restore/RestoreQrView'; | ||
| import { RestoreScanComputerQrView } from '@/components/account/restore/RestoreScanComputerQrView'; | ||
| import { isWebQrScannerSupported } from '@/utils/platform/qrScannerSupport'; | ||
| import { isWebMobileLikeQrScannerHost } from '@/utils/platform/webMobileHeuristics'; | ||
|
|
||
| export default function RestoreIndex() { | ||
| const { width, height } = useWindowDimensions(); | ||
| const isNativePhone = (Platform.OS === 'ios' || Platform.OS === 'android') && !isRunningOnMac(); | ||
| const isWebPhoneWithCamera = | ||
| Platform.OS === 'web' && isWebQrScannerSupported() && isWebMobileLikeQrScannerHost({ width, height }); | ||
| const showScannerFirst = isNativePhone || isWebPhoneWithCamera; | ||
| const webHasCamera = Platform.OS === 'web' && isWebQrScannerSupported(); | ||
| const showScannerFirst = isNativePhone || webHasCamera; | ||
|
|
||
| return showScannerFirst ? <RestoreScanComputerQrView /> : <RestoreQrView />; | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,7 +10,6 @@ import { t } from '@/text'; | |||||||||||||||||||||||||
| import { Typography } from '@/constants/Typography'; | ||||||||||||||||||||||||||
| import { isRunningOnMac } from '@/utils/platform/platform'; | ||||||||||||||||||||||||||
| import { isWebQrScannerSupported } from '@/utils/platform/qrScannerSupport'; | ||||||||||||||||||||||||||
| import { isWebMobileLikeQrScannerHost } from '@/utils/platform/webMobileHeuristics'; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| const stylesheet = StyleSheet.create((theme) => ({ | ||||||||||||||||||||||||||
| root: { | ||||||||||||||||||||||||||
|
|
@@ -115,8 +114,7 @@ export const QrCodeScannerView = React.memo(function QrCodeScannerView(props: Qr | |||||||||||||||||||||||||
| const canUseCamera = React.useMemo(() => { | ||||||||||||||||||||||||||
| if (isRunningOnMac()) return false; | ||||||||||||||||||||||||||
| if (Platform.OS !== 'web') return true; | ||||||||||||||||||||||||||
| if (!isWebQrScannerSupported()) return false; | ||||||||||||||||||||||||||
| return isWebMobileLikeQrScannerHost({ width, height }); | ||||||||||||||||||||||||||
| return isWebQrScannerSupported(); | ||||||||||||||||||||||||||
| }, [height, width]); | ||||||||||||||||||||||||||
|
Comment on lines
114
to
118
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| React.useEffect(() => { | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.