[PR #18438] [MERGED] fix: load default settings when sessionStorage is empty #24795

Closed
opened 2026-04-20 05:35:41 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/18438
Author: @acwoo97
Created: 10/20/2025
Status: Merged
Merged: 10/20/2025
Merged by: @tjbck

Base: devHead: fix/load-defaults


📝 Commits (1)

  • 9784eb4 fix: load default settings when sessionStorage is empty

📊 Changes

1 file changed (+2 additions, -0 deletions)

View changed files

📝 src/lib/components/chat/Chat.svelte (+2 -0)

📄 Description

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.

Before submitting, make sure you've checked the following:

  • Target branch: Verified that the pull request targets the dev branch.
  • Description: Added fallback behavior for chat initialization when sessionStorage data is missing.
  • Changelog: Included changelog entry following Keep a Changelog.
  • Documentation: No documentation updates required.
  • Dependencies: No new dependencies added.
  • Testing: Manually tested tab close/reopen and new chat scenarios.
  • Agentic AI Code: This PR was manually written and tested.
  • Code review: Self-review completed.
  • Title Prefix: Verified correct fix prefix.

Changelog Entry

Description

  • Added a call to setDefaults() inside the chat navigation logic (navigateHandler) to properly initialize the chat state when no previous session data exists in sessionStorage.

Added

  • N/A

Changed

  • Modified navigateHandler to include an else condition that triggers setDefaults() when sessionStorage does not contain chat input data.

Deprecated

  • N/A

Removed

  • N/A

Fixed

  • Fixed an issue where reopening a tab or starting a new session without sessionStorage data caused chat parameters (e.g., model settings, filters) not to load properly.

Security

  • N/A

Breaking Changes

  • None

Additional Information

  • When a user closes and reopens a tab, sessionStorage is cleared, which previously resulted in missing chat configuration (e.g., model, tools, filters).
  • This update ensures that in such cases, default settings are reloaded automatically through setDefaults().

Screenshots or Videos

(Optional)
N/A


Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/18438 **Author:** [@acwoo97](https://github.com/acwoo97) **Created:** 10/20/2025 **Status:** ✅ Merged **Merged:** 10/20/2025 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `fix/load-defaults` --- ### 📝 Commits (1) - [`9784eb4`](https://github.com/open-webui/open-webui/commit/9784eb4c0b2b82539d50fc60a0af3e5140404461) fix: load default settings when sessionStorage is empty ### 📊 Changes **1 file changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/components/chat/Chat.svelte` (+2 -0) </details> ### 📄 Description # Pull Request Checklist ### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request. **Before submitting, make sure you've checked the following:** - [x] **Target branch:** Verified that the pull request targets the `dev` branch. - [x] **Description:** Added fallback behavior for chat initialization when `sessionStorage` data is missing. - [x] **Changelog:** Included changelog entry following [Keep a Changelog](https://keepachangelog.com/). - [ ] **Documentation:** No documentation updates required. - [ ] **Dependencies:** No new dependencies added. - [x] **Testing:** Manually tested tab close/reopen and new chat scenarios. - [x] **Agentic AI Code:** This PR was manually written and tested. - [x] **Code review:** Self-review completed. - [x] **Title Prefix:** Verified correct `fix` prefix. --- # Changelog Entry ### Description - Added a call to `setDefaults()` inside the chat navigation logic (`navigateHandler`) to properly initialize the chat state when no previous session data exists in `sessionStorage`. ### Added - N/A ### Changed - Modified `navigateHandler` to include an `else` condition that triggers `setDefaults()` when `sessionStorage` does not contain chat input data. ### Deprecated - N/A ### Removed - N/A ### Fixed - Fixed an issue where reopening a tab or starting a new session without `sessionStorage` data caused chat parameters (e.g., model settings, filters) not to load properly. ### Security - N/A ### Breaking Changes - None --- ### Additional Information - When a user closes and reopens a tab, `sessionStorage` is cleared, which previously resulted in missing chat configuration (e.g., model, tools, filters). - This update ensures that in such cases, default settings are reloaded automatically through `setDefaults()`. ### Screenshots or Videos *(Optional)* N/A --- ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 05:35:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#24795