fix: downgrade missing userPreferences log from error to warning, deduplicate#1718
Merged
Conversation
…y once When `IModelApp.userPreferences` is not defined, the `IModelAppUserPreferencesStorage` now logs a warning instead of an error, and only logs it once per storage instance to avoid log spam. Closes #1714
Copilot
AI
changed the title
[WIP] Fix useNullValueStorage error when no storage provider is present
fix: downgrade missing userPreferences log from error to warning, deduplicate
Jun 12, 2026
grigasp
approved these changes
Jun 12, 2026
Member
|
@copilot, the change file is missing |
Contributor
Author
Added in commit |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces noise from IModelAppUserPreferencesStorage when IModelApp.userPreferences is not configured by downgrading the log level and deduplicating the message per storage instance, while keeping real runtime failures logged as errors.
Changes:
- Downgrades the “
IModelApp.userPreferencesnot defined” log fromLogger.logErrortoLogger.logWarning. - Deduplicates the missing-preferences warning so it emits only once per
IModelAppUserPreferencesStorageinstance. - Updates/extends unit tests to assert
logWarningand verify single-emission behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/itwin/property-grid/src/property-grid-react/api/PreferencesStorage.ts | Logs missing IModelApp.userPreferences as a one-time warning via a private guard/helper. |
| packages/itwin/property-grid/src/test/api/PreferencesStorage.test.ts | Updates tests to assert logWarning (not logError) and adds single-emission assertions. |
| change/@itwin-property-grid-react-5e8f999c-021a-422a-9a20-37213d3f8f5c.json | Adds a patch change entry documenting the behavior/logging change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
JonasDov
reviewed
Jun 12, 2026
saskliutas
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IModelAppUserPreferencesStoragelogs an error on everyget()/set()call whenIModelApp.userPreferencesis not defined. This is noisy and misleading—it's a configuration gap, not a runtime failure.Changes:
Logger.logError→Logger.logWarningfor the "userPreferences not defined" case#warnedAboutMissingPreferencesguardsave/getthrowing) remain aslogErrorTests updated to assert
logWarningand verify single-emission behavior.