Repository navigation
fix(dev): separate app identity while sharing sessions and login - #1820
Merged
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Running development beside the installed app reused
org2ai.org2, so the single-instance plugin forwarded the launch to the bundled app and exited without opening a dev window. Giving dev a separate identity must still preserve the user's existing login and session database. First-start “Follow device” styling could also hang after the old theme loader cleared its timeout and waited for animation frames in an occluded WebView, or continue without a working fallback after a CSS failure.Solution
ORG2 Dev. This preserves PID, args, environment, cwd, stdio, and resource location; packaged and numbered instances are excluded. Anchor the frontend cleanup title matcher so it does not match the native executable.<II>dev icon for startup and native Dock/taskbar updates. The dev identifier overrides the shared Dock-icon preference without writing to it; the installed app retains its chosen icon. Desktop assets are reproducible from the SVG source.ORG2 Devname andorg2ai.org2.devidentifier, separate deep-link schemes, and service ports 13946/17987. Direct binary launches derive the same defaults from the embedded identifier; production build configuration remains unchanged.~/.orgii/sessions.db. Keep related session artifacts, settings, projects, and provider history under the same primary data root so both apps can use existing sessions. Numbered test instances remain isolated; explicit environment overrides remain supported.These changes support one workflow: launching development alongside the installed app with the same existing sessions and login and usable startup styling.
Potential risks
.orgii-devdata remains untouched and is not merged. Reverting this patch restores the previous launch configuration without deleting primary data; use an explicitORGII_HOMEfor isolated development. Dev and bundled versions must remain schema-compatible.<II>even when the shared Dock-icon preference changes. Native PNG decoding and asset previews were verified; the live Dock/taskbar was not visually inspected.Verification
On the isolated development branch (the latest
developchanges were fetched and checked for conflicts):node --test scripts/dev/tauri-dev-processes.test.cjs scripts/tauri/instance-profile.test.cjs scripts/tauri/run-with-features.test.cjs— 19 passed.pnpm test src/config/runtimeInstance.test.ts src/features/Org2Cloud/config.test.ts src/api/http/auth/sharedAuthStorage.test.ts src/features/Org2Cloud/org2CloudAuthAtom.test.ts src/app/root/__tests__/useMobileRelayCloudAuthSync.test.ts src/util/core/init/themeInit.test.ts src/util/ui/theme/__tests__/swapThemeCss.test.ts src/app/root/__tests__/macosWindowStartupSurface.test.ts— 95 passed.cargo test --manifest-path src-tauri/Cargo.toml --test dev_shared_sessions -- --nocapture— 8 passed, including two-process persistence/read-back and numbered-instance isolation.pnpm run typecheck:fast— passed.pnpm exec eslint src/config/runtimeInstance.ts src/config/runtimeInstance.test.ts src/api/http/auth/sharedAuthStorage.ts src/api/http/auth/sharedAuthStorage.test.ts src/util/core/init/themeInit.ts src/util/core/init/themeInit.test.ts src/util/ui/theme/swapThemeCss.ts --max-warnings 0— passed.pnpm run check:test-placementandgit diff --check— passed.node /tmp/orgii-dev-style-qa-pr/guard.cjs— four fresh headless WebKit profiles passed: light, dark, failed dark CSS, and stalled dark CSS; each settled with one stylesheet, working layout, and defined theme tokens. The temporary harness/dependency is not added to the repository.cargo clippy --lib --message-format=short -p database -p org2, and commit-message validation.During implementation,
cargo test --manifest-path src-tauri/Cargo.toml --lib infrastructure::dev_bundled_auth::tests -- --nocapturepassed 4 tests (existing linker unwind-size warning).pnpm run tauri:dev --no-cache-guardreached backend readiness beside the installed app, with separate single-instance sockets and backend ports 13946/13847; this native check preceded the shared-data-root follow-up.node --test scripts/dev/startup-watchdog.test.cjspassed 7 and failed 2 unrelated source-shape assertions that still search the pre-refactor Rust crate root for lifecycle handlers.Full native lifecycle/performance, simultaneous active-session stress, and cross-process token-refresh coverage remain incomplete; no runtime performance improvement is claimed.
Dev icon verification
The final mark is
<II>, with smaller brackets (about 25% smaller) around the unchanged II mark. The bracketed mark passed 8 native icon tests; the subsequent bracket-size refinement regenerated assets and was visually inspected. The artwork-only commit hooks passed; no runtime source changed in this revision.node scripts/tauri/dev-icons.mjs— generated desktop PNG/ICNS/ICO assets; inspected 32px, 128px, and 512px previews.cargo test --manifest-path src-tauri/Cargo.toml -p app_window --lib dock_icon::tests -- --nocapture— 8 passed, including macOS native decoding and identity/preference selection.node --test scripts/dev/tauri-dev-processes.test.cjs scripts/tauri/run-with-features.test.cjs— 14 passed.git diff --check— passed. Icon commit hooks: passed (Prettier, scoped Rust Clippy, and commit-message validation); TypeScript check skipped because this follow-up changes no TypeScript runtime code.macOS dev process-name verification
cargo test --manifest-path src-tauri/Cargo.toml --lib app::dev_process_name::tests -- --nocapture— 4 passed, including an actual re-exec with PID/argv/environment/cwd preservation and a rebuilt-inode replacement test. The existing linker unwind-size warning remains.node --test scripts/dev/cleanup-orphans.test.cjs scripts/dev/tauri-dev-processes.test.cjs scripts/tauri/run-with-features.test.cjs— 15 passed. Cleanup uses fake process enumeration and kill commands; no user process is signaled by this regression test.pnpm run check:test-placementandgit diff --check— passed.Screenshots
Fresh headless WebKit at 1280×800, signed out, without native Tauri IPC:
Development icon
Artwork refinement: bracket geometry and stroke reduced, desktop assets regenerated with
node scripts/tauri/dev-icons.mjs, and the 128px preview inspected.git diff --checkpassed; runtime code is unchanged.