This PR fixes MessageManager.addMessage() to ignore already active messages displayed to the user (for all message types, like Toast or Sticky). This API is used by various tools indirectly via IModelApp.notifications.outputMessage when AppNotificationManager is set up. This change should prevent the same message from being displayed multiple times unnecessarily.
Ideally, tools and other consumers should throttle the messages manually i.e. in mouse wheel scroll handlers.
In the future, an option argument can be added if there is a use case where multiple equal messages need to be added.
Testing
Additional unit tests were added and tested via the test app.
* [#1124 Fix `MessageManager.addMessage` to only add unique messages (backport #1042)](https://github.com/iTwin/appui/pull/1124) has been created for branch `release/4.17.x` but encountered conflicts
Changes
This PR fixes
MessageManager.addMessage()
to ignore already active messages displayed to the user (for all message types, likeToast
orSticky
). This API is used by various tools indirectly viaIModelApp.notifications.outputMessage
whenAppNotificationManager
is set up. This change should prevent the same message from being displayed multiple times unnecessarily.Ideally, tools and other consumers should throttle the messages manually i.e. in mouse wheel scroll handlers. In the future, an option argument can be added if there is a use case where multiple equal messages need to be added.
Testing
Additional unit tests were added and tested via the test app.