Skip to content

Browsers will throw a QuotaExceededError if the cache is full, Result in Crash/Halt#39

Merged
Zahnentferner merged 1 commit intoStabilityNexus:mainfrom
aniket866:add-safe-local-storage-saving
Mar 2, 2026
Merged

Browsers will throw a QuotaExceededError if the cache is full, Result in Crash/Halt#39
Zahnentferner merged 1 commit intoStabilityNexus:mainfrom
aniket866:add-safe-local-storage-saving

Conversation

@aniket866
Copy link
Contributor

@aniket866 aniket866 commented Feb 24, 2026

Addressed Issues:

#38

Bug Description

  • Where: create/page.tsx -> saveTransaction method

  • Issue: Unsafely pushes to localStorage without a try-catch block.

  • Fix: Wrap the localStorage.setItem in a try-catch block.

  • Why: Browsers will throw a QuotaExceededError if the cache is full, crashing the frontend script and halting execution.

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions.
  • If applicable, I have made corresponding changes or additions to the documentation.
  • If applicable, I have made corresponding changes or additions to tests.
  • My changes generate no new warnings or errors.
  • I have joined the Stability Nexus's Discord server and I will share a link to this PR with the project maintainers there.
  • I have read the Contribution Guidelines.
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.

AI Usage Disclosure

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: TODO

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

@Zahnentferner Please check this out

Summary by CodeRabbit

  • Bug Fixes
    • Implemented comprehensive error handling for transaction saves, ensuring graceful failure instead of silent errors
    • Users receive specific feedback when storage capacity is exceeded, making it clear why transactions cannot be saved
    • Added error notifications for other save-related issues to improve transparency and user experience
    • Overall stability improved by catching and handling potential save failures appropriately

@aniket866 aniket866 changed the title add-safe-local-storage-saving Browsers will throw a QuotaExceededError if the cache is full, Result in Crash/Halt Feb 24, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 05a195f and bd6b15d.

📒 Files selected for processing (1)
  • web/src/app/create/page.tsx

📝 Walkthrough

Walkthrough

The saveTransaction function in the create page now includes error handling via try-catch block. The original transaction save logic is preserved in the try block, while the catch block handles localStorage quota and security exceptions, providing differentiated toast feedback based on the error type.

Changes

Cohort / File(s) Summary
Error Handling Enhancement
web/src/app/create/page.tsx
Added try-catch wrapper around saveTransaction to handle localStorage quota and security exceptions. Success path remains unchanged. Quota errors display a specific storage-full message; other exceptions show generic error toast.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

Poem

🐰 With a hop and a bound, through storage we go,
When the cache runs dry, now the user will know!
A try and a catch keep our errors at bay,
Toast messages gleaming to brighten the day! 🍞✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main bug fix: handling QuotaExceededError when localStorage is full, which is the core issue addressed in the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@Zahnentferner Zahnentferner merged commit 387d954 into StabilityNexus:main Mar 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants