Comfy-Org / Comfy-Org/ComfyUI_frontend

test: add QuotaExceededError FSM command for workflow persistence stress testing

Open
#9,868 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
area:testing developer experience
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Summary

Add a `QuotaExceededError` FSM command to the property-based FSM test suite for workflow persistence (`workflowDraftStoreV2.fsm.test.ts`).

## Background

In PR #9370, a property-based FSM test suite was added for workflow persistence. A reviewer noted that the FSM does not currently include a command that triggers `handleQuotaExceeded` (i.e., where `writePayload` returns `false`). Since the bug fix in that PR involves `loadIndex()`/`writePayload()` ordering, and `handleQuotaExceeded` also calls `loadIndex()`, this is a meaningful gap — the FSM only tests the happy path of `saveDraft`.

## Proposed Work

Add a new FSM command (e.g., `QuotaExceededCommand`) that:
- Mocks `localStorage.setItem` to throw `QuotaExceededError` after N saves
- Exercises the `handleQuotaExceeded` code path in `workflowDraftStoreV2.ts`
- Verifies that index/payload consistency invariants still hold under storage pressure
- Shrinks failing sequences to minimal reproductions via fast-check

## References

- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/9370
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/9370#discussion_r2925966986
- Requested by: @christian-byrne

cc @christian-byrne

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-9868-test-add-QuotaExceededError-FSM-command-for-workflow-persistence-stress-testing-3226d73d365081ed96bef76acdb46cb5) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.