Fix Enter Key & Node Creation Operations (17 test failures)#239
Closed
malibio wants to merge 1 commit into
Closed
Conversation
…ge (Issue #232) ## Problem HTTP dev server used a single shared NodeService instance, preventing test isolation. When tests called /api/database/init with unique database paths, the endpoint created new services but didn't update AppState, causing: - UNIQUE constraint errors from static node IDs across tests - Test contamination (nodes from one test appearing in another) - Inability to run comprehensive integration test suites ## Solution Implemented RwLock pattern to enable atomic database swapping: **Backend Changes:** - AppState now uses Arc<RwLock<Arc<DatabaseService>>> and Arc<RwLock<Arc<NodeService>>> - init_database() creates new services and swaps them atomically via RwLock - All endpoints use .read().unwrap().clone() pattern for safe concurrent access - Updated dev-server.rs to wrap initial services in RwLock **Frontend Changes:** - SharedNodeStore: Skip viewer-sourced persistence (temporary dual persistence fix) - ReactiveNodeService: Fixed containerNodeId='root' for root-level nodes - node-ordering tests: Added sharedNodeStore.__resetForTesting() for isolation ## Test Results - ✅ node-ordering: 10/10 passing - ✅ enter-key-operations: 7/10 passing (3 real bugs remain - Issue #232 continued) - ⏳ shift-enter-operations: Skipped (HTTP 500 error - separate issue) **Database isolation verified working:** - Server logs show "🔄 Database SWAPPED to: <path>" for each test - NO MORE UNIQUE constraint errors - Each test gets isolated database with unique path ## Files Modified - src-tauri/src/bin/dev-server.rs - RwLock initialization - src-tauri/src/dev_server/mod.rs - AppState with RwLock - src-tauri/src/dev_server/node_endpoints.rs - RwLock swap logic + access pattern - src-tauri/src/dev_server/query_endpoints.rs - RwLock access pattern - src-tauri/src/dev_server/embedding_endpoints.rs - RwLock access pattern - src/lib/services/reactive-node-service.svelte.ts - containerNodeId fix - src/lib/services/shared-node-store.ts - viewer-source persistence skip - src/tests/integration/node-ordering.test.ts - test isolation reset ## Next Steps (Issue #232 continued) 1. Fix 3 remaining enter-key operation bugs (beforeSiblingId logic) 2. Investigate shift-enter HTTP 500 error 3. Run full test suite 4. Create PR 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
Author
|
Closing PR - database isolation is fixed but actual enter key bugs still need to be resolved. See issue #232 for comprehensive status and next steps. |
This was referenced Jul 2, 2026
mstomar125
added a commit
that referenced
this pull request
Jul 2, 2026
…rrent_person Tauri commands (#239) (#1472) Refresh the vendored Pro proto from the daemon source-of-truth (adds the ListInvites / ListRequests / RevokeInvite / GetIdentity RPCs + Invite / JoinRequest / GetIdentity messages) and add the matching Tauri commands: - pro_list_invites → Vec<InviteDto{id,code,email,permission,expires_at}> - pro_list_requests → Vec<RequestDto{id,requested_by,created_at}> - pro_revoke_invite(invite_id) — cancel a pending invite or join request - pro_current_person → PersonDto{person_id,email} — the caller's own bound PersonNode id (+ email) so the UI can identify its own roster row and gate admin controls on the caller's per-collection role. Empty person_id on an un-bound device is treated as "role unknown". Each is a thin pass-through over the daemon gRPC client, mirroring the eight existing membership commands, and registered in the invoke handler. They resolve the ProClient or fail in community mode, so the community build is unaffected. Co-authored-by: Mayank Tomar <mayanktomar@Michaels-Mac-mini.local> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.
Closes #232