TT 7656 slow notes - #611
Merged
Merged
Conversation
…te queue Remove waitForRemoteQueue from getArtifactCategorys so the Note Details picker opens immediately mid-session; wait only after creating a category, and bootstrap special note categories without blocking the read. Co-authored-by: Cursor <cursoragent@cursor.com>
Real issue. The bootstrap marker was set before the fire-and-forget AddOrgNoteCategories write, so a rejected Orbit update left an unhandled rejection and permanently skipped retries for that org on the same hook instance. Fix: attach .catch that deletes curOrg from specialBootstrapOrgs and reports via logError(Severity.error, errorReporter, err). The read path stays non-blocking. Test: retries special note-category bootstrap after a failed Orbit write — first memory.update rejects, second read must call update again and log the error. Red (no catch): unhandled rejection + no retry. Green: 6/6 passing in useArtifactCategory.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation matches the stated objective and includes appropriate regression coverage.
Pull request overview
Improves artifact-category picker responsiveness during Orbit synchronization.
Changes:
- Reads categories directly from the local Orbit cache.
- Bootstraps special note categories asynchronously with retry handling.
- Adds Jest and Cypress regression coverage.
File summaries
| File | Description |
|---|---|
useArtifactCategory.ts |
Removes queue blocking from reads and moves synchronization waiting to creation. |
useArtifactCategory.test.ts |
Tests cache reads, bootstrap retries, and creation waits. |
SelectArtifactCategory.cy.tsx |
Tests picker responsiveness and preserving user input. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Cause: Not a leak and not a cold IndexedDB miss. Categories were already in the Orbit memory cache; getArtifactCategorys was awaiting waitForRemoteQueue, which polls every 1s while the remote queue is busy, so the picker stalled mid-session.
Fix: Read from memory.cache.query only; wait for the remote queue only after addNewArtifactCategory; bootstrap special note categories without blocking the read.
Commits:
8872556 — failing Jest + Cypress tests
7d7f80b — production fix + CT selector hardening
Red/green (from src\renderer):
Jest useArtifactCategory: red on baseline, green with fix
Cypress SelectArtifactCategory.cy.tsx: red (empty field under busy queue), green (~400ms)
Regressions: CategoryEdit, ResourceCategory, useCategoryGraphicEdit, CategoryListEdit.cy.tsx all pass