Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MessageManager.addMessage to only add unique messages (backport #1042) #1124

Merged
merged 3 commits into from
Nov 20, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Nov 19, 2024

Changes

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.


This is an automatic backport of pull request #1042 done by [Mergify](https://mergify.com).

* Update MessageManager.addMesage to ignore messages that are already active.

* rush change

* NextVersion

(cherry picked from commit f41afd1)

# Conflicts:
#	docs/changehistory/NextVersion.md
@mergify mergify bot requested a review from a team as a code owner November 19, 2024 15:41
@mergify mergify bot added the conflicts label Nov 19, 2024
Copy link
Contributor Author

mergify bot commented Nov 19, 2024

Cherry-pick of f41afd1 has failed:

On branch mergify/bp/release/4.17.x/pr-1042
Your branch is up to date with 'origin/release/4.17.x'.

You are currently cherry-picking commit f41afd19b.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   common/changes/@itwin/appui-react/add-message-once_2024-09-23-12-30.json
	modified:   ui/appui-react/src/appui-react/messages/MessageManager.tsx
	modified:   ui/appui-react/src/test/messages/MessageManager.test.tsx

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   docs/changehistory/NextVersion.md

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@GerardasB GerardasB enabled auto-merge (squash) November 20, 2024 09:47
@mergify mergify bot requested a review from a team November 20, 2024 09:48
@GerardasB GerardasB merged commit 7b517ea into release/4.17.x Nov 20, 2024
17 checks passed
@GerardasB GerardasB deleted the mergify/bp/release/4.17.x/pr-1042 branch November 20, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant