-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Open
ahundt
wants to merge
13
commits into
happier-dev:dev
Choose a base branch
from
ahundt:fix/preserve-yolo-mode-across-remote-switch
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0b0dfab
fix(ui): fix Tauri macOS app launch regressions (codex crash, icons, …
ahundt 10a53a3
session.ts: add spawnPermissionMode field for launch intent preservation
ahundt c921b99
loop.ts:89: set session.spawnPermissionMode from opts.permissionMode
ahundt f18e7ee
claudeLocalLauncher.ts:248-255: use spawnPermissionMode as floor for …
ahundt 5185383
Merge remote-tracking branch 'origin/dev' into fix/preserve-yolo-mode…
ahundt 8cb7698
fix(state/persistence): validate permission mode values loaded from MMKV
ahundt 6a7fab2
test(health,serverFeatures): add missing /health endpoint and offline…
ahundt 50028c6
apps/server/.gitignore: ignore prisma/migrations/ directory
ahundt 7c77927
Merge branch 'fix/tauri-macos-launch-regressions' into fix/preserve-y…
ahundt 9524cf7
fix(review): address CodeRabbit actionable comments on PR #144
ahundt ce2c7e5
Merge branch 'origin/dev' into fix/preserve-yolo-mode-across-remote-s…
ahundt ddf6265
prepareTauriSidecar.test.mjs,.gitignore: fix missing mocks and traili…
ahundt 26dd43f
test(useConnectAccount): add mediaDevices stub for phone-sized web QR…
ahundt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
apps/server/sources/app/api/utils/enableMonitoring.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(() => {}); | ||
| } | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 />; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useMemodependency array after removing dimension-based checkisRunningOnMac(),Platform.OS, andisWebQrScannerSupported()are all constant for the lifetime of the component, socanUseCameranever changes on window resize. The[height, width]dependency array is now stale — it causes the memo to recompute on every window resize even though neither value is used in the computation.