Skip to content

Improve query history localStorage recovery handling#930

Open
shivambind269-ai wants to merge 1 commit into
imDarshanGK:mainfrom
shivambind269-ai:fix-history-persistence
Open

Improve query history localStorage recovery handling#930
shivambind269-ai wants to merge 1 commit into
imDarshanGK:mainfrom
shivambind269-ai:fix-history-persistence

Conversation

@shivambind269-ai

Copy link
Copy Markdown

Summary

This PR improves the reliability of Query History persistence by adding safe recovery logic when loading history from localStorage.

Changes Made

  • Added error handling around JSON.parse() when reading qyx_history.
  • Prevents application issues when localStorage contains malformed or corrupted data.
  • Falls back to an empty history array when parsing fails.
  • Preserves existing history persistence behavior and 50-entry limit.

Why This Change?

Although Query History is already stored in localStorage, corrupted or invalid JSON data can cause parsing failures during initialization. This change makes the history loading process more robust and improves user experience.

Testing

  • Verified application loads normally with valid history data.
  • Verified application does not crash when invalid JSON is present in qyx_history.
  • Verified history falls back safely to an empty state when parsing fails.

Fixes #718

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.

[Bug] [Frontend] Query History does not persist after browser refresh

1 participant