Skip to content

refactor: change asset cache from nodeType-keyed to category-keyed#8433

Merged
DrJKL merged 4 commits intomainfrom
refactor/asset-cache-category-keyed
Jan 30, 2026
Merged

refactor: change asset cache from nodeType-keyed to category-keyed#8433
DrJKL merged 4 commits intomainfrom
refactor/asset-cache-category-keyed

Conversation

@christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented Jan 29, 2026

Summary

Refactors the model assets cache in assetsStore.ts to be keyed by category (e.g., 'checkpoints', 'loras') instead of nodeType (e.g., 'CheckpointLoaderSimple').

Changes

  • Rename modelStateByKey to modelStateByCategory
  • Add resolveCategory() helper to translate nodeType to category for cache lookup
  • Multiple node types sharing the same category now share one cache entry
  • Add invalidateCategory() method for cache invalidation
  • Maintain backwards-compatible public API accepting nodeType
  • Update tests for new category-keyed behavior

Benefits

  1. Deduplication: Same category = same cache entry = single API call
  2. Simple invalidation: Delete asset with tag 'checkpoints' then invalidate cache
  3. Cleaner mental model: Store to View reactive flow works naturally

Testing

  • All existing tests pass with updates
  • Added new tests for category-keyed cache sharing, invalidateCategory, and unknown node type handling

Part of Stack

This is PR 1 of 2 in a stacked PR series:

  1. This PR: Refactor asset cache to category-keyed (architectural improvement)
  2. PR 2 #8434: Fix deletion invalidation

┆Issue is synchronized with this Notion page by Unito

- Rename modelStateByKey to modelStateByCategory
- Add resolveCategory() to translate nodeType -> category for cache lookup
- Multiple node types sharing the same category now share one cache entry
- Add invalidateCategory() method for cache invalidation
- Maintain backwards-compatible public API accepting nodeType
- Update tests for new category-keyed behavior

This architectural change enables simple cache invalidation by category
(e.g., 'checkpoints', 'loras') which will be used for deletion invalidation.

Amp-Thread-ID: https://ampcode.com/threads/T-019c08a2-6a9f-770f-994c-ad79d515f6a1
Co-authored-by: Amp <amp@ampcode.com>
@christian-byrne christian-byrne requested a review from a team as a code owner January 29, 2026 21:05
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 29, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Refactors asset caching from per-key (node type/tag) to category-based caches in assetsStore.ts, adds resolveCategory and invalidateCategory, updates public API signatures, and expands tests in src/stores/assetsStore.test.ts to validate category-based caching, invalidation, and concurrency semantics.

Changes

Cohort / File(s) Summary
Test Suite
src/stores/assetsStore.test.ts
Adds a comprehensive mock of useModelToNodeStore() (getAllNodeProviders, getCategoryForNodeType, etc.) and new tests covering category-keyed cache sharing, unknown node-type handling, concurrency (duplicate requests short-circuiting), invalidateCategory behavior (including tag-based invalidation), and cloud/non-cloud adjustments.
Assets store refactor
src/stores/assetsStore.ts
Replaces per-key caches with category-based maps (modelStateByCategory, pendingRequestByCategory), adds resolveCategory(), implements updateModelsForCategory(), routes updateModelsForNodeType/updateModelsForTag through category logic, updates optimistic/error paths to use category keys, and exposes invalidateCategory() in the public API.
Model-to-node store typings
src/stores/modelToNodeStore.ts
useModelToNodeStore() now exposes getAllNodeProviders(category), getCategoryForNodeType(nodeType), getNodeProvider, and registerDefaults (used by assets store to resolve categories and providers).

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant AssetsStore as assetsStore
  participant ModelToNode as modelToNodeStore
  participant AssetSvc as AssetService

  Client->>AssetsStore: getAssets(key)
  AssetsStore->>ModelToNode: getCategoryForNodeType(key) / resolveCategory(key)
  alt category resolved
    AssetsStore->>AssetsStore: check modelStateByCategory[category]
    alt cache hit
      AssetsStore-->>Client: return cached assets
    else cache miss
      AssetsStore->>AssetSvc: fetch assets (category, pagination)
      AssetSvc-->>AssetsStore: assets[]
      AssetsStore->>AssetsStore: update modelStateByCategory[category]
      AssetsStore-->>Client: return assets
    end
  else unknown key
    AssetsStore-->>Client: return []
  end
Loading

Possibly related PRs

Suggested reviewers

  • luke-mino-altherr
  • shinshin86
  • KarryCharon
  • Yorha4D
  • AustinMroz
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/asset-cache-category-keyed

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Jan 29, 2026

🎭 Playwright Tests: ⚠️ Passed with flaky tests

Results: 505 passed, 0 failed, 1 flaky, 8 skipped (Total: 514)

❌ Failed Tests

📊 Browser Reports
  • chromium: View Report (✅ 493 / ❌ 0 / ⚠️ 1 / ⏭️ 8)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 9 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

@github-actions
Copy link

github-actions bot commented Jan 29, 2026

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 01/29/2026, 10:53:31 PM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@github-actions
Copy link

github-actions bot commented Jan 29, 2026

Bundle Size Report

Summary

  • Raw size: 22.1 MB baseline 22.1 MB — 🔴 +1.33 kB
  • Gzip: 4.61 MB baseline 4.6 MB — 🔴 +170 B
  • Brotli: 3.42 MB baseline 3.42 MB — 🔴 +44 B
  • Bundles: 173 current • 173 baseline • 81 added / 81 removed

Category Glance
Data & Services 🔴 +1.53 kB (2.71 MB) · Other 🟢 -198 B (7.1 MB) · Panels & Settings 🟢 -8 B (471 kB) · Vendor & Third-Party ⚪ 0 B (10.7 MB) · Graph Workspace ⚪ 0 B (974 kB) · Views & Navigation ⚪ 0 B (80.7 kB) · + 5 more

Per-category breakdown
App Entry Points — 26 kB (baseline 26 kB) • ⚪ 0 B

Main entry bundles and manifests

File Before After Δ Raw Δ Gzip Δ Brotli
assets/index-DF1PnLuz.js (removed) 26 kB 🟢 -26 kB 🟢 -7.51 kB 🟢 -6.61 kB
assets/index-Dh8YknyX.js (new) 26 kB 🔴 +26 kB 🔴 +7.5 kB 🔴 +6.59 kB

Status: 1 added / 1 removed

Graph Workspace — 974 kB (baseline 974 kB) • ⚪ 0 B

Graph editor runtime, canvas, workflow orchestration

File Before After Δ Raw Δ Gzip Δ Brotli
assets/GraphView-DbM8Ydo8.js (removed) 974 kB 🟢 -974 kB 🟢 -197 kB 🟢 -148 kB
assets/GraphView-xpYIjeSL.js (new) 974 kB 🔴 +974 kB 🔴 +197 kB 🔴 +149 kB

Status: 1 added / 1 removed

Views & Navigation — 80.7 kB (baseline 80.7 kB) • ⚪ 0 B

Top-level views, pages, and routed surfaces

File Before After Δ Raw Δ Gzip Δ Brotli
assets/CloudSurveyView-BHmxaFEJ.js (new) 17.1 kB 🔴 +17.1 kB 🔴 +3.6 kB 🔴 +3.05 kB
assets/CloudSurveyView-D6JQyl1x.js (removed) 17.1 kB 🟢 -17.1 kB 🟢 -3.6 kB 🟢 -3.05 kB
assets/CloudLoginView-CesL3dj0.js (removed) 11.8 kB 🟢 -11.8 kB 🟢 -3.09 kB 🟢 -2.72 kB
assets/CloudLoginView-kl-2v0l-.js (new) 11.8 kB 🔴 +11.8 kB 🔴 +3.09 kB 🔴 +2.72 kB
assets/UserCheckView-DTkH_dT8.js (new) 10.5 kB 🔴 +10.5 kB 🔴 +2.44 kB 🔴 +2.13 kB
assets/UserCheckView-K8qHM-rC.js (removed) 10.5 kB 🟢 -10.5 kB 🟢 -2.45 kB 🟢 -2.13 kB
assets/CloudLayoutView-CwL5x-jX.js (removed) 8.54 kB 🟢 -8.54 kB 🟢 -2.24 kB 🟢 -1.96 kB
assets/CloudLayoutView-DpvAPdfo.js (new) 8.54 kB 🔴 +8.54 kB 🔴 +2.24 kB 🔴 +1.96 kB
assets/CloudSignupView-Dg__9RHS.js (new) 8.18 kB 🔴 +8.18 kB 🔴 +2.33 kB 🔴 +2.02 kB
assets/CloudSignupView-Dq3DoVdu.js (removed) 8.18 kB 🟢 -8.18 kB 🟢 -2.33 kB 🟢 -2.02 kB
assets/CloudForgotPasswordView-5LQ63-gH.js (removed) 6.26 kB 🟢 -6.26 kB 🟢 -1.93 kB 🟢 -1.69 kB
assets/CloudForgotPasswordView-C-O87VLR.js (new) 6.26 kB 🔴 +6.26 kB 🔴 +1.93 kB 🔴 +1.69 kB
assets/UserSelectView-Bbnwi7WO.js (removed) 5.28 kB 🟢 -5.28 kB 🟢 -1.76 kB 🟢 -1.58 kB
assets/UserSelectView-DzEIXIum.js (new) 5.28 kB 🔴 +5.28 kB 🔴 +1.76 kB 🔴 +1.57 kB
assets/CloudSubscriptionRedirectView-D21SsJeE.js (removed) 5.27 kB 🟢 -5.27 kB 🟢 -1.73 kB 🟢 -1.54 kB
assets/CloudSubscriptionRedirectView-DeUr9Zx5.js (new) 5.27 kB 🔴 +5.27 kB 🔴 +1.73 kB 🔴 +1.54 kB
assets/CloudAuthTimeoutView-CI_aWn4c.js (new) 5.24 kB 🔴 +5.24 kB 🔴 +1.71 kB 🔴 +1.49 kB
assets/CloudAuthTimeoutView-CIs6xJvA.js (removed) 5.24 kB 🟢 -5.24 kB 🟢 -1.71 kB 🟢 -1.49 kB
assets/CloudSorryContactSupportView-n5f-fGMz.js 1.97 kB 1.97 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/layout-V93lMUpe.js 500 B 500 B ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 9 added / 9 removed

Panels & Settings — 471 kB (baseline 471 kB) • 🟢 -8 B

Configuration panels, inspectors, and settings screens

File Before After Δ Raw Δ Gzip Δ Brotli
assets/WorkspacePanel-CBDWrvtF.js (removed) 29.8 kB 🟢 -29.8 kB 🟢 -5.89 kB 🟢 -5.14 kB
assets/WorkspacePanel-CVbQhO3_.js (new) 29.8 kB 🔴 +29.8 kB 🔴 +5.89 kB 🔴 +5.14 kB
assets/LegacyCreditsPanel-Bmq8vnx0.js (removed) 23.8 kB 🟢 -23.8 kB 🟢 -5.94 kB 🟢 -5.22 kB
assets/LegacyCreditsPanel-Cfg2y-xa.js (new) 23.8 kB 🔴 +23.8 kB 🔴 +5.94 kB 🔴 +5.23 kB
assets/SubscriptionPanel-2FTx-OmQ.js (new) 21 kB 🔴 +21 kB 🔴 +5.05 kB 🔴 +4.44 kB
assets/SubscriptionPanel-7FxZuiFJ.js (removed) 21 kB 🟢 -21 kB 🟢 -5.04 kB 🟢 -4.44 kB
assets/KeybindingPanel-BfpivoJA.js (new) 14.2 kB 🔴 +14.2 kB 🔴 +3.74 kB 🔴 +3.31 kB
assets/KeybindingPanel-W4MjuR_8.js (removed) 14.2 kB 🟢 -14.2 kB 🟢 -3.74 kB 🟢 -3.31 kB
assets/AboutPanel-BhSyj82V.js (removed) 10.8 kB 🟢 -10.8 kB 🟢 -2.68 kB 🟢 -2.42 kB
assets/AboutPanel-jraYLylH.js (new) 10.8 kB 🔴 +10.8 kB 🔴 +2.68 kB 🔴 +2.42 kB
assets/ExtensionPanel-CFJqBN3Y.js (removed) 10.2 kB 🟢 -10.2 kB 🟢 -2.71 kB 🟢 -2.4 kB
assets/ExtensionPanel-CjY6by7N.js (new) 10.2 kB 🔴 +10.2 kB 🔴 +2.71 kB 🔴 +2.41 kB
assets/ServerConfigPanel-CvIOJFDR.js (new) 7.23 kB 🔴 +7.23 kB 🔴 +2.17 kB 🔴 +1.94 kB
assets/ServerConfigPanel-nk_wXHvr.js (removed) 7.23 kB 🟢 -7.23 kB 🟢 -2.17 kB 🟢 -1.94 kB
assets/UserPanel-BtUL3E43.js (removed) 6.58 kB 🟢 -6.58 kB 🟢 -1.9 kB 🟢 -1.68 kB
assets/UserPanel-BWdClfnU.js (new) 6.58 kB 🔴 +6.58 kB 🔴 +1.9 kB 🔴 +1.68 kB
assets/refreshRemoteConfig-hhL8BuTo.js (new) 1.31 kB 🔴 +1.31 kB 🔴 +572 B 🔴 +498 B
assets/refreshRemoteConfig-XPqYH6rL.js (removed) 1.31 kB 🟢 -1.31 kB 🟢 -574 B 🟢 -500 B
assets/config-_c4aC-Rr.js (removed) 1.16 kB 🟢 -1.16 kB 🟢 -610 B 🟢 -535 B
assets/config-WLGihHTv.js (new) 1.15 kB 🔴 +1.15 kB 🔴 +605 B 🔴 +533 B
assets/cloudRemoteConfig-BAt0AO7o.js (new) 1.11 kB 🔴 +1.11 kB 🔴 +510 B 🔴 +452 B
assets/cloudRemoteConfig-BMnV2Oem.js (removed) 1.11 kB 🟢 -1.11 kB 🟢 -511 B 🟢 -448 B
assets/refreshRemoteConfig-B6tctsPI.js (removed) 169 B 🟢 -169 B 🟢 -108 B 🟢 -105 B
assets/refreshRemoteConfig-D5-tphmK.js (new) 169 B 🔴 +169 B 🔴 +108 B 🔴 +104 B
assets/remoteConfig-B0mlVvm7.js 788 B 788 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-2UNjEj6k.js 32.9 kB 32.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-B2OMGvh7.js 31.2 kB 31.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BcujOfpn.js 29.6 kB 29.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BI09_t23.js 29.4 kB 29.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BKamuseh.js 25.8 kB 25.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BlTun9tZ.js 26.4 kB 26.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CZ62uO3e.js 30.2 kB 30.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DaK-NByz.js 35.2 kB 35.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DaS3cSXp.js 39.4 kB 39.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DWbMuaAa.js 32 kB 32 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-S7pA60Hj.js 30.4 kB 30.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 12 added / 12 removed

User & Accounts — 3.94 kB (baseline 3.94 kB) • ⚪ 0 B

Authentication, profile, and account management bundles

File Before After Δ Raw Δ Gzip Δ Brotli
assets/auth-BaT7_bsm.js (new) 3.54 kB 🔴 +3.54 kB 🔴 +1.24 kB 🔴 +1.07 kB
assets/auth-DlFumTGu.js (removed) 3.54 kB 🟢 -3.54 kB 🟢 -1.24 kB 🟢 -1.05 kB
assets/firebaseAuthStore-BH_hPdyt.js (new) 217 B 🔴 +217 B 🔴 +138 B 🔴 +122 B
assets/firebaseAuthStore-D4z2aaYO.js (removed) 217 B 🟢 -217 B 🟢 -138 B 🟢 -120 B
assets/auth-94gFWDoz.js (new) 178 B 🔴 +178 B 🔴 +141 B 🔴 +130 B
assets/auth-CQl9aVJs.js (removed) 178 B 🟢 -178 B 🟢 -142 B 🟢 -132 B

Status: 3 added / 3 removed

Editors & Dialogs — 2.89 kB (baseline 2.89 kB) • ⚪ 0 B

Modals, dialogs, drawers, and in-app editors

File Before After Δ Raw Δ Gzip Δ Brotli
assets/useSubscriptionDialog-B1qSbLXx.js (removed) 2.71 kB 🟢 -2.71 kB 🟢 -1.29 kB 🟢 -1.15 kB
assets/useSubscriptionDialog-BWFs4cwS.js (new) 2.71 kB 🔴 +2.71 kB 🔴 +1.29 kB 🔴 +1.14 kB
assets/useSubscriptionDialog-BDgrkGJc.js (removed) 179 B 🟢 -179 B 🟢 -110 B 🟢 -96 B
assets/useSubscriptionDialog-gueoaOlj.js (new) 179 B 🔴 +179 B 🔴 +110 B 🔴 +96 B

Status: 2 added / 2 removed

UI Components — 33.7 kB (baseline 33.7 kB) • ⚪ 0 B

Reusable component library chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/ComfyQueueButton-CCHBjaym.js (removed) 9.52 kB 🟢 -9.52 kB 🟢 -2.68 kB 🟢 -2.41 kB
assets/ComfyQueueButton-D6gsxdN0.js (new) 9.52 kB 🔴 +9.52 kB 🔴 +2.68 kB 🔴 +2.41 kB
assets/SubscribeButton-CbICuqob.js (removed) 4.63 kB 🟢 -4.63 kB 🟢 -1.57 kB 🟢 -1.39 kB
assets/SubscribeButton-CCdEMMry.js (new) 4.63 kB 🔴 +4.63 kB 🔴 +1.57 kB 🔴 +1.39 kB
assets/cloudFeedbackTopbarButton-BbKTzIce.js (new) 1.24 kB 🔴 +1.24 kB 🔴 +676 B 🔴 +566 B
assets/cloudFeedbackTopbarButton-ByddwiAD.js (removed) 1.24 kB 🟢 -1.24 kB 🟢 -673 B 🟢 -569 B
assets/ComfyQueueButton-B9kzAUm4.js (removed) 181 B 🟢 -181 B 🟢 -118 B 🟢 -111 B
assets/ComfyQueueButton-C-E2CJc3.js (new) 181 B 🔴 +181 B 🔴 +118 B 🔴 +108 B
assets/Button-Bb_i0j7c.js 3.82 kB 3.82 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/CloudBadge-BNjL4ma_.js 1.85 kB 1.85 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/TopbarBadge-qACg_vGT.js 8.36 kB 8.36 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/UserAvatar-D80lITos.js 1.73 kB 1.73 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetButton-DSv9NFvF.js 2.41 kB 2.41 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 4 added / 4 removed

Data & Services — 2.71 MB (baseline 2.7 MB) • 🔴 +1.53 kB

Stores, services, APIs, and repositories

File Before After Δ Raw Δ Gzip Δ Brotli
assets/dialogService-DsvM8FxH.js (new) 2.01 MB 🔴 +2.01 MB 🔴 +424 kB 🔴 +324 kB
assets/dialogService-DP0R0c7e.js (removed) 2 MB 🟢 -2 MB 🟢 -424 kB 🟢 -324 kB
assets/api-DRfMIn7W.js (new) 674 kB 🔴 +674 kB 🔴 +149 kB 🔴 +118 kB
assets/api-BdHT5Gha.js (removed) 674 kB 🟢 -674 kB 🟢 -149 kB 🟢 -118 kB
assets/releaseStore-C6q51IXN.js (new) 8.91 kB 🔴 +8.91 kB 🔴 +2.4 kB 🔴 +2.12 kB
assets/releaseStore-Dk3h6_QN.js (removed) 8.91 kB 🟢 -8.91 kB 🟢 -2.4 kB 🟢 -2.12 kB
assets/keybindingService-C7ZAW0pb.js (new) 6.78 kB 🔴 +6.78 kB 🔴 +1.75 kB 🔴 +1.52 kB
assets/keybindingService-DlzAZGLf.js (removed) 6.78 kB 🟢 -6.78 kB 🟢 -1.74 kB 🟢 -1.52 kB
assets/bootstrapStore-APmgMP_u.js (removed) 2.69 kB 🟢 -2.69 kB 🟢 -1.03 kB 🟢 -976 B
assets/bootstrapStore-BuyUcooS.js (new) 2.69 kB 🔴 +2.69 kB 🔴 +1.03 kB 🔴 +963 B
assets/userStore-Bd8GPm6X.js (new) 2.16 kB 🔴 +2.16 kB 🔴 +811 B 🔴 +726 B
assets/userStore-Df4qGwiz.js (removed) 2.16 kB 🟢 -2.16 kB 🟢 -811 B 🟢 -725 B
assets/audioService-BhoYLdz7.js (new) 2.03 kB 🔴 +2.03 kB 🔴 +931 B 🔴 +812 B
assets/audioService-CB6eBoZ4.js (removed) 2.03 kB 🟢 -2.03 kB 🟢 -931 B 🟢 -811 B
assets/releaseStore-BEj4DKlW.js (removed) 140 B 🟢 -140 B 🟢 -106 B 🟢 -107 B
assets/releaseStore-CLqkUIyG.js (new) 140 B 🔴 +140 B 🔴 +106 B 🔴 +107 B
assets/serverConfigStore-DOoqLe5c.js 2.64 kB 2.64 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 8 added / 8 removed

Utilities & Hooks — 25.3 kB (baseline 25.3 kB) • ⚪ 0 B

Helpers, composables, and utility bundles

File Before After Δ Raw Δ Gzip Δ Brotli
assets/useErrorHandling-BRFpmc1O.js (new) 5.21 kB 🔴 +5.21 kB 🔴 +1.53 kB 🔴 +1.35 kB
assets/useErrorHandling-Dt9Gdv12.js (removed) 5.21 kB 🟢 -5.21 kB 🟢 -1.53 kB 🟢 -1.35 kB
assets/useWorkspaceUI-CDW67PEs.js (new) 3.42 kB 🔴 +3.42 kB 🔴 +977 B 🔴 +835 B
assets/useWorkspaceUI-CtHv_AcS.js (removed) 3.42 kB 🟢 -3.42 kB 🟢 -975 B 🟢 -842 B
assets/useSubscriptionActions-BqRo-YN9.js (new) 2.22 kB 🔴 +2.22 kB 🔴 +871 B 🔴 +767 B
assets/useSubscriptionActions-W3IXhMYs.js (removed) 2.22 kB 🟢 -2.22 kB 🟢 -872 B 🟢 -765 B
assets/subscriptionCheckoutUtil-D1XN55Vc.js (removed) 2.03 kB 🟢 -2.03 kB 🟢 -872 B 🟢 -764 B
assets/subscriptionCheckoutUtil-DEcz31NN.js (new) 2.03 kB 🔴 +2.03 kB 🔴 +873 B 🔴 +763 B
assets/useSubscriptionCredits-CBpizfb8.js (new) 1.39 kB 🔴 +1.39 kB 🔴 +592 B 🔴 +518 B
assets/useSubscriptionCredits-CeNYqc5P.js (removed) 1.39 kB 🟢 -1.39 kB 🟢 -595 B 🟢 -523 B
assets/audioUtils-CmbeEWg8.js (removed) 970 B 🟢 -970 B 🟢 -547 B 🟢 -489 B
assets/audioUtils-D19r1eWH.js (new) 970 B 🔴 +970 B 🔴 +545 B 🔴 +457 B
assets/useCurrentUser-CCpNn7r4.js (new) 145 B 🔴 +145 B 🔴 +114 B 🔴 +99 B
assets/useCurrentUser-ZLdhKKc0.js (removed) 145 B 🟢 -145 B 🟢 -114 B 🟢 -103 B
assets/_plugin-vue_export-helper-DuK_Fly3.js 467 B 467 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/colorUtil-GMAsfHxw.js 7.2 kB 7.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/markdownRendererUtil-ivqHoiOs.js 1.78 kB 1.78 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/tailwindUtil-CJjrIEVR.js 488 B 488 B ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 7 added / 7 removed

Vendor & Third-Party — 10.7 MB (baseline 10.7 MB) • ⚪ 0 B

External libraries and shared vendor chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/vendor-chart-DHGfk3hn.js 408 kB 408 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-other-jpGqhHNG.js 4.1 MB 4.1 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-primevue-4Jj8eU28.js 3.04 MB 3.04 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-reka-ui-aCG649nF.js 263 kB 263 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-three-CERwhPwK.js 1.83 MB 1.83 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-tiptap-BxrEVL6s.js 650 kB 650 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-vue-Dwii0E-t.js 13.6 kB 13.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-xterm-IX6P8SWv.js 398 kB 398 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
Other — 7.1 MB (baseline 7.1 MB) • 🟢 -198 B

Bundles that do not match a named category

File Before After Δ Raw Δ Gzip Δ Brotli
assets/core-DkHQ8u-H.js (removed) 180 kB 🟢 -180 kB 🟢 -43.3 kB 🟢 -36.2 kB
assets/core-DbEUyAky.js (new) 180 kB 🔴 +180 kB 🔴 +43.3 kB 🔴 +36.2 kB
assets/WidgetSelect-CwdhtEHs.js (new) 52.2 kB 🔴 +52.2 kB 🔴 +11.5 kB 🔴 +10 kB
assets/WidgetSelect-CZYBn9GW.js (removed) 52.2 kB 🟢 -52.2 kB 🟢 -11.5 kB 🟢 -10 kB
assets/Load3DControls-5l4Dyd65.js (removed) 35.9 kB 🟢 -35.9 kB 🟢 -5.87 kB 🟢 -5.08 kB
assets/Load3DControls-Bd1XHO8j.js (new) 35.9 kB 🔴 +35.9 kB 🔴 +5.87 kB 🔴 +5.08 kB
assets/SubscriptionRequiredDialogContent--94-HThu.js (removed) 28.7 kB 🟢 -28.7 kB 🟢 -6.78 kB 🟢 -5.92 kB
assets/SubscriptionRequiredDialogContent-Bd5Aem3-.js (new) 28.7 kB 🔴 +28.7 kB 🔴 +6.78 kB 🔴 +5.92 kB
assets/CurrentUserPopoverWorkspace-DWq1ZSri.js (removed) 22.2 kB 🟢 -22.2 kB 🟢 -4.99 kB 🟢 -4.42 kB
assets/CurrentUserPopoverWorkspace-xOsjIUnW.js (new) 22.2 kB 🔴 +22.2 kB 🔴 +4.99 kB 🔴 +4.42 kB
assets/Load3D-BKPTqk_H.js (removed) 19.2 kB 🟢 -19.2 kB 🟢 -4.37 kB 🟢 -3.84 kB
assets/Load3D-BYQXb2of.js (new) 19.2 kB 🔴 +19.2 kB 🔴 +4.37 kB 🔴 +3.86 kB
assets/WidgetInputNumber-DaE_zBOX.js (new) 18.3 kB 🔴 +18.3 kB 🔴 +4.53 kB 🔴 +4.03 kB
assets/WidgetInputNumber-DJlddSVQ.js (removed) 18.3 kB 🟢 -18.3 kB 🟢 -4.53 kB 🟢 -4.03 kB
assets/WidgetRecordAudio-DH_0Cndu.js (removed) 18.3 kB 🟢 -18.3 kB 🟢 -4.97 kB 🟢 -4.43 kB
assets/WidgetRecordAudio-uxELlH00.js (new) 18.3 kB 🔴 +18.3 kB 🔴 +4.97 kB 🔴 +4.44 kB
assets/SubscriptionPanelContentWorkspace-BL8Uf38H.js (removed) 18.2 kB 🟢 -18.2 kB 🟢 -4.48 kB 🟢 -3.89 kB
assets/SubscriptionPanelContentWorkspace-v2KEuqQi.js (new) 18.2 kB 🔴 +18.2 kB 🔴 +4.48 kB 🔴 +3.9 kB
assets/WidgetImageCrop-B8Rd21LI.js (removed) 17.1 kB 🟢 -17.1 kB 🟢 -4.14 kB 🟢 -3.63 kB
assets/WidgetImageCrop-BwUsZTGv.js (new) 17.1 kB 🔴 +17.1 kB 🔴 +4.14 kB 🔴 +3.62 kB
assets/PanelTemplate-CbT_Zal5.js (new) 16.2 kB 🔴 +16.2 kB 🔴 +5.46 kB 🔴 +4.8 kB
assets/PanelTemplate-D6qAE1R4.js (removed) 16.2 kB 🟢 -16.2 kB 🟢 -5.46 kB 🟢 -4.8 kB
assets/AudioPreviewPlayer-A1sOTNDY.js (new) 10.8 kB 🔴 +10.8 kB 🔴 +2.98 kB 🔴 +2.66 kB
assets/AudioPreviewPlayer-ChfKVlkC.js (removed) 10.8 kB 🟢 -10.8 kB 🟢 -2.97 kB 🟢 -2.65 kB
assets/InviteMemberDialogContent-aFSLTnZh.js (removed) 8.36 kB 🟢 -8.36 kB 🟢 -2.5 kB 🟢 -2.17 kB
assets/InviteMemberDialogContent-DQ18c8tQ.js (new) 8.36 kB 🔴 +8.36 kB 🔴 +2.5 kB 🔴 +2.17 kB
assets/WidgetWithControl-BxmlGRMK.js (new) 8.07 kB 🔴 +8.07 kB 🔴 +2.68 kB 🔴 +2.41 kB
assets/WidgetWithControl-DXKlTP0t.js (removed) 8.07 kB 🟢 -8.07 kB 🟢 -2.68 kB 🟢 -2.41 kB
assets/CreateWorkspaceDialogContent-ClNVYpHy.js (removed) 5.93 kB 🟢 -5.93 kB 🟢 -1.92 kB 🟢 -1.68 kB
assets/CreateWorkspaceDialogContent-CoJ9xG4h.js (new) 5.93 kB 🔴 +5.93 kB 🔴 +1.92 kB 🔴 +1.68 kB
assets/EditWorkspaceDialogContent-BLaZsT4Z.js (new) 5.7 kB 🔴 +5.7 kB 🔴 +1.88 kB 🔴 +1.64 kB
assets/EditWorkspaceDialogContent-CrtmYET-.js (removed) 5.7 kB 🟢 -5.7 kB 🟢 -1.88 kB 🟢 -1.64 kB
assets/ValueControlPopover-BllOYyWM.js (new) 5.17 kB 🔴 +5.17 kB 🔴 +1.68 kB 🔴 +1.5 kB
assets/ValueControlPopover-mhmdhVXW.js (removed) 5.17 kB 🟢 -5.17 kB 🟢 -1.68 kB 🟢 -1.49 kB
assets/DeleteWorkspaceDialogContent-DfjiGqLm.js (new) 4.59 kB 🔴 +4.59 kB 🔴 +1.56 kB 🔴 +1.35 kB
assets/DeleteWorkspaceDialogContent-DZy0SOHt.js (removed) 4.59 kB 🟢 -4.59 kB 🟢 -1.56 kB 🟢 -1.35 kB
assets/LeaveWorkspaceDialogContent-BoHon5df.js (removed) 4.41 kB 🟢 -4.41 kB 🟢 -1.5 kB 🟢 -1.31 kB
assets/LeaveWorkspaceDialogContent-BZleouvG.js (new) 4.41 kB 🔴 +4.41 kB 🔴 +1.5 kB 🔴 +1.31 kB
assets/RemoveMemberDialogContent-B_50coTb.js (removed) 4.38 kB 🟢 -4.38 kB 🟢 -1.45 kB 🟢 -1.27 kB
assets/RemoveMemberDialogContent-Dx95ZyPE.js (new) 4.38 kB 🔴 +4.38 kB 🔴 +1.45 kB 🔴 +1.27 kB
assets/RevokeInviteDialogContent-BNvl76dh.js (new) 4.29 kB 🔴 +4.29 kB 🔴 +1.47 kB 🔴 +1.29 kB
assets/RevokeInviteDialogContent-oOyKcy_w.js (removed) 4.29 kB 🟢 -4.29 kB 🟢 -1.47 kB 🟢 -1.29 kB
assets/GlobalToast-CRiSSZGv.js (new) 3.05 kB 🔴 +3.05 kB 🔴 +1.1 kB 🔴 +944 B
assets/GlobalToast-XsC4ER92.js (removed) 3.05 kB 🟢 -3.05 kB 🟢 -1.1 kB 🟢 -944 B
assets/SubscribeToRun-JJ_4sl1K.js (new) 2.96 kB 🔴 +2.96 kB 🔴 +1.15 kB 🔴 +1.01 kB
assets/SubscribeToRun-tjMU1mPH.js (removed) 2.96 kB 🟢 -2.96 kB 🟢 -1.15 kB 🟢 -1.02 kB
assets/cloudSessionCookie-BuHXMdoj.js (removed) 2.94 kB 🟢 -2.94 kB 🟢 -929 B 🟢 -800 B
assets/cloudSessionCookie-u6RiB6VH.js (new) 2.94 kB 🔴 +2.94 kB 🔴 +928 B 🔴 +797 B
assets/BaseViewTemplate-BdZg-Uvk.js (new) 2.42 kB 🔴 +2.42 kB 🔴 +1.04 kB 🔴 +949 B
assets/BaseViewTemplate-CgHWblIY.js (removed) 2.42 kB 🟢 -2.42 kB 🟢 -1.04 kB 🟢 -945 B
assets/CloudRunButtonWrapper-C86Kb2k1.js (new) 1.79 kB 🔴 +1.79 kB 🔴 +645 B 🔴 +563 B
assets/CloudRunButtonWrapper-CjtALtUy.js (removed) 1.79 kB 🟢 -1.79 kB 🟢 -643 B 🟢 -562 B
assets/cloudBadges-BCkC0nnk.js (removed) 1.08 kB 🟢 -1.08 kB 🟢 -537 B 🟢 -475 B
assets/cloudBadges-CMFTDYMR.js (new) 1.08 kB 🔴 +1.08 kB 🔴 +537 B 🔴 +475 B
assets/graphHasMissingNodes-DJsC-FOc.js (new) 1.06 kB 🔴 +1.06 kB 🔴 +461 B 🔴 +411 B
assets/graphHasMissingNodes-ZWZCepou.js (removed) 1.06 kB 🟢 -1.06 kB 🟢 -462 B 🟢 -408 B
assets/cloudSubscription-CnnI4UlC.js (new) 976 B 🔴 +976 B 🔴 +462 B 🔴 +399 B
assets/cloudSubscription-CT9EAW9R.js (removed) 976 B 🟢 -976 B 🟢 -465 B 🟢 -396 B
assets/nightlyBadges-BjuAgJRL.js (new) 595 B 🔴 +595 B 🔴 +355 B 🔴 +310 B
assets/nightlyBadges-tkNiAxP-.js (removed) 595 B 🟢 -595 B 🟢 -356 B 🟢 -307 B
assets/SubscriptionPanelContentWorkspace-2FuLiBjZ.js (new) 266 B 🔴 +266 B 🔴 +136 B 🔴 +118 B
assets/SubscriptionPanelContentWorkspace-Cwt2s7Tf.js (removed) 266 B 🟢 -266 B 🟢 -136 B 🟢 -116 B
assets/WidgetInputNumber-DhXuFh1L.js (new) 186 B 🔴 +186 B 🔴 +119 B 🔴 +107 B
assets/WidgetInputNumber-DxeEXT3R.js (removed) 186 B 🟢 -186 B 🟢 -119 B 🟢 -109 B
assets/WidgetLegacy-CyQg8hLf.js (removed) 164 B 🟢 -164 B 🟢 -125 B 🟢 -116 B
assets/WidgetLegacy-rvtxU42O.js (new) 164 B 🔴 +164 B 🔴 +125 B 🔴 +109 B
assets/Load3D-9Op0OMLD.js (removed) 131 B 🟢 -131 B 🟢 -107 B 🟢 -105 B
assets/Load3D-NGAy_V2y.js (new) 131 B 🔴 +131 B 🔴 +107 B 🔴 +108 B
assets/auto-DWs2ctGL.js 1.73 kB 1.73 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BEw5ErI4.js 18.5 kB 18.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BGeHkplA.js 17.9 kB 17.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BV0l36Iz.js 17.2 kB 17.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-C_Y3D6Cn.js 17.8 kB 17.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-C6piRza5.js 19.3 kB 19.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-Cf8Zq1td.js 18.8 kB 18.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CiziP3Xs.js 18 kB 18 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-D1595tOr.js 19.3 kB 19.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DXauvccL.js 20.6 kB 20.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-P5QCEfZc.js 18 kB 18 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-WbYP_D61.js 17 kB 17 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/i18n-COrIg4fJ.js 188 B 188 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/i18n-Cp-AD5FJ.js 499 kB 499 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/LazyImage-DHwPdKGO.js 14.1 kB 14.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BHtk4Fg_.js 174 kB 174 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BMSlgLcp.js 155 kB 155 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BQCWi9e4.js 112 kB 112 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BWJjz1qs.js 130 kB 130 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CJicmTR7.js 113 kB 113 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CNOkBy-u.js 126 kB 126 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CySb1R5_.js 151 kB 151 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DMUPIFMF.js 133 kB 133 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DpsGU4si.js 126 kB 126 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Dz6IPJXM.js 144 kB 144 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-lrEzMywH.js 128 kB 128 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/Media3DTop-DUmUhXD6.js 2.38 kB 2.38 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaAudioTop-CD66_Mw_.js 2 kB 2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaImageTop-Bqe7yvm_.js 2.34 kB 2.34 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaVideoTop-De3MzVmp.js 2.82 kB 2.82 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/mixpanel.module-CC2-PIpB.js 143 B 143 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-A7pvB7zM.js 370 kB 370 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-BIVjUijC.js 345 kB 345 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-Chkn0HaI.js 343 kB 343 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CK_6GHao.js 452 kB 452 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CToVAwnT.js 373 kB 373 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-DDabdWgx.js 417 kB 417 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-DgvJyE3d.js 386 kB 386 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-DjxaeFt_.js 416 kB 416 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-DslnWEGg.js 377 kB 377 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-EPAM3kwk.js 373 kB 373 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-NrulhNyH.js 366 kB 366 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/OBJLoader2WorkerModule-DTMpvldF.js 109 kB 109 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/previousFullPath-CmezY7As.js 838 B 838 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/rolldown-runtime-cVp-94Rc.js 1.96 kB 1.96 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/Slider-D4lsf6Ob.js 4.21 kB 4.21 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/widget-BJiJuR5i.js 518 B 518 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetBoundingBox-CUtab2CB.js 4.71 kB 4.71 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetBoundingBox-D79nBMxa.js 186 B 186 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetChart-CiXfBVBH.js 2.79 kB 2.79 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetColorPicker-BxNqMlFv.js 3.71 kB 3.71 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetGalleria-DDD96zwa.js 4.57 kB 4.57 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetImageCompare-A6pZMGtc.js 3.79 kB 3.79 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetInputText-DSMUKRnt.js 2.58 kB 2.58 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetLayoutField-MDImyvc3.js 2.7 kB 2.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetMarkdown-a8bZhyc5.js 3.49 kB 3.49 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/widgetPropFilter-ERx8czR8.js 1.31 kB 1.31 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetTextarea-CV3BoahN.js 3.87 kB 3.87 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetToggleSwitch-ZdaYkxkD.js 3.26 kB 3.26 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/widgetTypes-KPj-zM0O.js 573 B 573 B ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 34 added / 34 removed

@github-actions
Copy link

🔧 Auto-fixes Applied

This PR has been automatically updated to fix linting and formatting issues.

⚠️ Important: Your local branch is now behind. Run git pull before making additional changes to avoid conflicts.

Changes made:

  • ESLint auto-fixes
  • Oxfmt formatting

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/stores/assetsStore.test.ts (1)

584-592: Test uses unmapped node type, potentially not testing intended cache behavior.

'TestLoader' is not in the mock's nodeToCategory mapping, so getCategoryForNodeType returns undefined, causing getAssets to return the EMPTY_ASSETS constant. The test passes because the same constant reference is returned both times, but this doesn't validate the array cache behavior for populated data.

Consider using a mapped node type like 'CheckpointLoaderSimple' after populating the cache:

Proposed fix
     it('should return cached array on subsequent getAssets calls', () => {
       const store = useAssetsStore()
-      const nodeType = 'TestLoader'
+      const nodeType = 'CheckpointLoaderSimple'
+      const assets = [createMockAsset('cache-test-1')]
+
+      vi.mocked(assetService.getAssetsForNodeType).mockResolvedValue(assets)
+      await store.updateModelsForNodeType(nodeType)
 
       const firstCall = store.getAssets(nodeType)
       const secondCall = store.getAssets(nodeType)
 
       expect(secondCall).toBe(firstCall)
+      expect(firstCall).toHaveLength(1)
     })

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/stores/assetsStore.ts`:
- Around line 383-397: The updateModelsForCategory function can be invoked
concurrently for the same category causing redundant parallel work; add an
explicit guard using the pendingRequestByCategory map to prevent concurrent
execution: when updateModelsForCategory starts, check
pendingRequestByCategory.get(category) and if a pending state/promise exists
either return the existing pending promise or set a dedicated lock token (e.g.,
store the state/promise) so subsequent calls short-circuit; ensure you
update/remove that entry consistently when the work completes or is superseded
(references: updateModelsForCategory, pendingRequestByCategory,
modelStateByCategory, and the existing isStale logic) so behavior remains
correct and maintainable.
- Around line 509-516: When cacheKey is provided but resolveCategory(cacheKey)
returns undefined, the code currently builds categoriesToCheck = [undefined] and
then skips it in the loop; change this to return early instead: after computing
const category = cacheKey ? resolveCategory(cacheKey) : undefined, if cacheKey
&& !category then return (or exit the surrounding function) to avoid creating
categoriesToCheck and running the loop; update any callers/tests if needed. This
touches the symbols: cacheKey, resolveCategory, categoriesToCheck, and
modelStateByCategory.

- Add early return in updateAssetInCache when cacheKey resolves to undefined
- Fix test to use mapped node type to properly validate array cache behavior

Amp-Thread-ID: https://ampcode.com/threads/T-019c0bac-2144-73cb-a8d5-45146d0c2db9
Co-authored-by: Amp <amp@ampcode.com>
@DrJKL DrJKL added the preview label Jan 29, 2026
Short-circuit concurrent calls for the same category to prevent redundant
parallel work. The pendingRequestByCategory map now tracks all in-progress
requests (not just those with existing data), allowing subsequent calls to
return immediately instead of starting duplicate fetches.

Amp-Thread-ID: https://ampcode.com/threads/T-019c0bac-2144-73cb-a8d5-45146d0c2db9
Co-authored-by: Amp <amp@ampcode.com>
@DrJKL DrJKL merged commit d9ea36a into main Jan 30, 2026
27 checks passed
@DrJKL DrJKL deleted the refactor/asset-cache-category-keyed branch January 30, 2026 00:03
christian-byrne added a commit that referenced this pull request Jan 30, 2026
…8433)

Refactors the model assets cache in `assetsStore.ts` to be keyed by
category (e.g., 'checkpoints', 'loras') instead of nodeType (e.g.,
'CheckpointLoaderSimple').

- Rename `modelStateByKey` to `modelStateByCategory`
- Add `resolveCategory()` helper to translate nodeType to category for
cache lookup
- Multiple node types sharing the same category now share one cache
entry
- Add `invalidateCategory()` method for cache invalidation
- Maintain backwards-compatible public API accepting nodeType
- Update tests for new category-keyed behavior

1. **Deduplication**: Same category = same cache entry = single API call
2. **Simple invalidation**: Delete asset with tag 'checkpoints' then
invalidate cache
3. **Cleaner mental model**: Store to View reactive flow works naturally

- All existing tests pass with updates
- Added new tests for category-keyed cache sharing, invalidateCategory,
and unknown node type handling

This is **PR 1 of 2** in a stacked PR series:
1. **This PR**: Refactor asset cache to category-keyed (architectural
improvement)
2. **[PR 2
deletion invalidation

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8433-refactor-change-asset-cache-from-nodeType-keyed-to-category-keyed-2f76d73d365081999b7fda12c9706ab5)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Subagent 5 <subagent@example.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: GitHub Action <action@github.com>
snomiao pushed a commit that referenced this pull request Jan 30, 2026
…8433)

## Summary

Refactors the model assets cache in `assetsStore.ts` to be keyed by
category (e.g., 'checkpoints', 'loras') instead of nodeType (e.g.,
'CheckpointLoaderSimple').

## Changes

- Rename `modelStateByKey` to `modelStateByCategory`
- Add `resolveCategory()` helper to translate nodeType to category for
cache lookup
- Multiple node types sharing the same category now share one cache
entry
- Add `invalidateCategory()` method for cache invalidation
- Maintain backwards-compatible public API accepting nodeType
- Update tests for new category-keyed behavior

## Benefits

1. **Deduplication**: Same category = same cache entry = single API call
2. **Simple invalidation**: Delete asset with tag 'checkpoints' then
invalidate cache
3. **Cleaner mental model**: Store to View reactive flow works naturally

## Testing

- All existing tests pass with updates
- Added new tests for category-keyed cache sharing, invalidateCategory,
and unknown node type handling

## Part of Stack

This is **PR 1 of 2** in a stacked PR series:
1. **This PR**: Refactor asset cache to category-keyed (architectural
improvement)
2. **[PR 2
#8434](#8434: Fix
deletion invalidation

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8433-refactor-change-asset-cache-from-nodeType-keyed-to-category-keyed-2f76d73d365081999b7fda12c9706ab5)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Subagent 5 <subagent@example.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: GitHub Action <action@github.com>
DrJKL pushed a commit that referenced this pull request Jan 31, 2026
…8433)

## Summary

Refactors the model assets cache in `assetsStore.ts` to be keyed by
category (e.g., 'checkpoints', 'loras') instead of nodeType (e.g.,
'CheckpointLoaderSimple').

## Changes

- Rename `modelStateByKey` to `modelStateByCategory`
- Add `resolveCategory()` helper to translate nodeType to category for
cache lookup
- Multiple node types sharing the same category now share one cache
entry
- Add `invalidateCategory()` method for cache invalidation
- Maintain backwards-compatible public API accepting nodeType
- Update tests for new category-keyed behavior

## Benefits

1. **Deduplication**: Same category = same cache entry = single API call
2. **Simple invalidation**: Delete asset with tag 'checkpoints' then
invalidate cache
3. **Cleaner mental model**: Store to View reactive flow works naturally

## Testing

- All existing tests pass with updates
- Added new tests for category-keyed cache sharing, invalidateCategory,
and unknown node type handling

## Part of Stack

This is **PR 1 of 2** in a stacked PR series:
1. **This PR**: Refactor asset cache to category-keyed (architectural
improvement)
2. **[PR 2
#8434](#8434: Fix
deletion invalidation

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8433-refactor-change-asset-cache-from-nodeType-keyed-to-category-keyed-2f76d73d365081999b7fda12c9706ab5)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Subagent 5 <subagent@example.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: GitHub Action <action@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants