Skip to content

[backport cloud/1.36] feat: Stale-while-revalidate pattern for AssetBrowserModal#7889

Merged
luke-mino-altherr merged 1 commit intocloud/1.36from
backport-7880-to-cloud-1.36
Jan 8, 2026
Merged

[backport cloud/1.36] feat: Stale-while-revalidate pattern for AssetBrowserModal#7889
luke-mino-altherr merged 1 commit intocloud/1.36from
backport-7880-to-cloud-1.36

Conversation

@comfy-pr-bot
Copy link
Member

@comfy-pr-bot comfy-pr-bot commented Jan 8, 2026

Backport of #7880 to cloud/1.36

Automatically created by backport workflow.

┆Issue is synchronized with this Notion page by Unito

## Summary

Implements stale-while-revalidate pattern for AssetBrowserModal to show
cached assets immediately while refreshing in background.

## Changes

### AssetBrowserModal.vue
- Reads assets directly from store cache via computed properties
- Shows loading spinner only when loading AND no cached data exists
- Simplified refresh logic: single `refreshAssets()` call on mount

### assetsStore.ts
- Added `updateModelsForTag(tag)` for tag-based fetching
- Added `updateModelsForKey()` internal helper to unify node type and
tag fetching
- Cache key convention: node types as-is, tags prefixed with `tag:`
- Added `isEqual` check before cache updates to prevent unnecessary
re-renders

### useModelUpload.ts
- Simplified signature from `UseAsyncStateReturn<...>['execute']` to `()
=> Promise<unknown> | void`

## UX Improvement

| Scenario | Before | After |
|----------|--------|-------|
| First open | Spinner → Assets | Spinner → Assets |
| Re-open same type | Spinner → Assets | Instant + silent refresh |
| Re-open after download | Spinner → Assets | Cached + auto-update |

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7880-feat-Stale-while-revalidate-pattern-for-AssetBrowserModal-2e16d73d365081ba93f4d6e0415ebfae)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@comfy-pr-bot comfy-pr-bot added the backport Backporting a PR onto a release candidate label Jan 8, 2026
@comfy-pr-bot comfy-pr-bot requested a review from a team as a code owner January 8, 2026 00:30
@comfy-pr-bot comfy-pr-bot added the backport Backporting a PR onto a release candidate label Jan 8, 2026
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 8, 2026
@github-actions
Copy link

github-actions bot commented Jan 8, 2026

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 01/08/2026, 12:31:57 AM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

🎭 Playwright Test Results

⚠️ Tests passed with flaky tests

⏰ Completed at: 01/08/2026, 12:41:15 AM UTC

📈 Summary

  • Total Tests: 513
  • Passed: 504 ✅
  • Failed: 0
  • Flaky: 1 ⚠️
  • Skipped: 8 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 492 / ❌ 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

🎉 Click on the links above to view detailed test results for each browser configuration.

@luke-mino-altherr luke-mino-altherr merged commit f1b874e into cloud/1.36 Jan 8, 2026
37 checks passed
@luke-mino-altherr luke-mino-altherr deleted the backport-7880-to-cloud-1.36 branch January 8, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Backporting a PR onto a release candidate 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