Skip to content

Comments

fix: load default settings when sessionStorage is empty#18438

Merged
tjbck merged 1 commit intoopen-webui:devfrom
acwoo97:fix/load-defaults
Oct 20, 2025
Merged

fix: load default settings when sessionStorage is empty#18438
tjbck merged 1 commit intoopen-webui:devfrom
acwoo97:fix/load-defaults

Conversation

@acwoo97
Copy link
Contributor

@acwoo97 acwoo97 commented Oct 20, 2025

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.

@tjbck
Copy link
Contributor

tjbck commented Oct 20, 2025

Thanks!

@tjbck tjbck merged commit 375d29b into open-webui:dev Oct 20, 2025
1 of 2 checks 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