Repository: nvaccess/nvda

Issue:
NVDA and notification text repeating multiple times
Hello.

I am running the Creator's Update with NVDA 2017.1. Sometimes, the text of a Windows Notification, such as Autoplay etc. repeats more than once. This happens sometimes when I am in and out of the start menu.


Discussion:
Uh oh, @MichaelDCurran, I can also reproduce this, any ideas or things we can try? Thanks.

 

From: fisher729 [mailto:notifications@github.com] 
Sent: Monday, May 1, 2017 10:49 PM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [nvaccess/nvda] NVDA and notification text repeating multiple times (#7128)

 

Hello.

I am running the Creator's Update with NVDA 2017.1. Sometimes, the text of a Windows Notification, such as Autoplay etc. repeats more than once. This happens sometimes when I am in and out of the start menu.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <https://github.com/nvaccess/nvda/issues/7128> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkFf7ShyTUAwlz3QWam9qzvcdqz73ks5r1sPlgaJpZM4NNvFR> .


Yes, I've noticed this as well, specially if I'm in an UWP app (e.g. Edge). I'm running NVDA version next-14006,9031bf7a and Windows 10 Creators Update.
Can you please outline the steps you use to reproduce this?
Using the Creator's update, with NVDA 2017.1
1. Open the Start menu and type in the search box, or interact with a UWP app.
2. Trigger a notification (plug in a flash drive etc.)
3. You will notice that the text of the notification is repeated twice
or thrice, if not, do it multiple times.

On 5/2/17, Reef Turner <notifications@github.com> wrote:
> Can you please outline the steps you use to reproduce this?
>
> --
> You are receiving this because you authored the thread.
> Reply to this email directly or view it on GitHub:
> https://github.com/nvaccess/nvda/issues/7128#issuecomment-298536330

Go download clip clear (If you have ahk
https://files.derekriemer.com/clipClear.ahk or if not
https://files.derekriemer.com/clipClear.exe). Run it. Now, press shift+win+c
It'll produce a toast
The sad thing is I hear multiple dings on my machine, and I'm not certain
this is a bug in NVDA. Here's an event trace from accevent yesterday of
this. it didn't seem to fire a ton of extraneous events, although I didn't
spend too much time on it.
https://files.derekriemer.com/toastevent.txt

On Tue, May 2, 2017 at 7:34 AM, fisher729 <notifications@github.com> wrote:

> Using the Creator's update, with NVDA 2017.1
> 1. Open the Start menu and type in the search box, or interact with a UWP
> app.
> 2. Trigger a notification (plug in a flash drive etc.)
> 3. You will notice that the text of the notification is repeated twice
> or thrice, if not, do it multiple times.
>
> On 5/2/17, Reef Turner <notifications@github.com> wrote:
> > Can you please outline the steps you use to reproduce this?
> >
> > --
> > You are receiving this because you authored the thread.
> > Reply to this email directly or view it on GitHub:
> > https://github.com/nvaccess/nvda/issues/7128#issuecomment-298536330
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/nvaccess/nvda/issues/7128#issuecomment-298636922>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AFGivT9JDiHmMqPpKOnvPbjU9BpvEWEiks5r1zDXgaJpZM4NNvFR>
> .
>



-- 

Derek Riemer: Improving the world one byte at a time!

   - University of Colorado Boulder Department of computer science, 4th
   year undergraduate student.
   - Accessibility enthusiast.
   - Proud user of the NVDA screen reader.
   - Open source enthusiast.
   - Skier.

Personal website <http://derekriemer.com>

Hello, i notice this issue also it does it with many different types of things like dropbox and outlook just to name a few. 
Hi,

Tracking events (with a modified WinTenApps add-on) shows that, somehow, UIA window opened event is fired multiple times when viewed from NVDA side of things but accevent says it was fired only once.

To those affected by this: can we try with NVDA 2016.4 and 2017.1 to see if we can isolate this further? Thanks.
Do you see this issue immediately after starting NVDA or only after some
time? If the latter, it's possible that there's something weird going on in
the UIA client library that only triggers after some condition. That would
mean you won't see this in AccEvent unless you monitor all events for quite
a while. So, that might be worth a try.

Hi, from reports I’ve seen and from my own tests, it begins after using NVDA for a while. This wasn’t the case in Anniversary Update, so looks like something has changed in Creators Update. Thanks.

 

From: James Teh [mailto:notifications@github.com] 
Sent: Monday, June 5, 2017 10:04 PM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Joseph Lee <joseph.lee22590@gmail.com>; Comment <comment@noreply.github.com>
Subject: Re: [nvaccess/nvda] NVDA and notification text repeating multiple times (#7128)

 

Do you see this issue immediately after starting NVDA or only after some
time? If the latter, it's possible that there's something weird going on in
the UIA client library that only triggers after some condition. That would
mean you won't see this in AccEvent unless you monitor all events for quite
a while. So, that might be worth a try.



—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <https://github.com/nvaccess/nvda/issues/7128#issuecomment-306382744> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkCSs34TLNQ2n62Lo9YvuyVU8Ybjzks5sBN22gaJpZM4NNvFR> .


I get it after sometime

Sent from my iPhone

> On Jun 6, 2017, at 1:19 AM, Joseph Lee <notifications@github.com> wrote:
> 
> Hi, from reports I’ve seen and from my own tests, it begins after using NVDA for a while. This wasn’t the case in Anniversary Update, so looks like something has changed in Creators Update. Thanks.
> 
> 
> 
> From: James Teh [mailto:notifications@github.com] 
> Sent: Monday, June 5, 2017 10:04 PM
> To: nvaccess/nvda <nvda@noreply.github.com>
> Cc: Joseph Lee <joseph.lee22590@gmail.com>; Comment <comment@noreply.github.com>
> Subject: Re: [nvaccess/nvda] NVDA and notification text repeating multiple times (#7128)
> 
> 
> 
> Do you see this issue immediately after starting NVDA or only after some
> time? If the latter, it's possible that there's something weird going on in
> the UIA client library that only triggers after some condition. That would
> mean you won't see this in AccEvent unless you monitor all events for quite
> a while. So, that might be worth a try.
> 
> 
> 
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub <https://github.com/nvaccess/nvda/issues/7128#issuecomment-306382744> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkCSs34TLNQ2n62Lo9YvuyVU8Ybjzks5sBN22gaJpZM4NNvFR> .
> 
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub, or mute the thread.
> 

Hello. Any updates on this? It is affecting many more users now, since a lot more persons are now on the Creator's update. Any idea when this will be fixed? I turned off reporting help balloons because of this issue, but would love to turn it back on.
We believe this to be a bug in UI Automation Core, but we'll be stuck with it for a while even if Microsoft eventually fix it, so p2 to work around it in NVDA.
Hi, workaround to be made available in Windows 10 App Essentials 17.07.1 by letting window open event handler consult the last toast message it keeps in its pocket. Thanks.

 

From: James Teh [mailto:notifications@github.com] 
Sent: Monday, July 10, 2017 5:27 PM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Joseph Lee <joseph.lee22590@gmail.com>; Comment <comment@noreply.github.com>
Subject: Re: [nvaccess/nvda] NVDA and notification text repeating multiple times (#7128)

 

We believe this to be a bug in UI Automation Core, but we'll be stuck with it for a while even if Microsoft eventually fix it, so p2 to work around it in NVDA.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <https://github.com/nvaccess/nvda/issues/7128#issuecomment-314287651> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkMFj5x4rF4GQB3aGIhZKlk0itPaRks5sMsFkgaJpZM4NNvFR> .


A PR would be much appreciated if you can.



Resolving patch:
diff --git a/source/NVDAObjects/UIA/__init__.py b/source/NVDAObjects/UIA/__init__.py
--- a/source/NVDAObjects/UIA/__init__.py
+++ b/source/NVDAObjects/UIA/__init__.py
@@ -29,6 +29,7 @@
 from NVDAObjects import NVDAObjectTextInfo, InvalidNVDAObject
 from NVDAObjects.behaviors import ProgressBar, EditableTextWithoutAutoSelectDetection, Dialog, Notification, EditableTextWithSuggestions
 import braille
+import time
 
 class UIATextInfo(textInfos.TextInfo):
 
@@ -1452,6 +1453,20 @@ class Toast_win10(Notification, UIA):
 		event_UIA_window_windowOpen=Notification.event_alert
 	else:
 		event_UIA_toolTipOpened=Notification.event_alert
+	# #7128: in Creators Update (build 15063 and later), due to possible UIA Core problem, toasts are announced repeatedly if UWP apps were used for a while.
+	# Therefore, have a private toast message consultant (toast timestamp and UIA element runtime ID) handy.
+	_lastToastTimestamp = None
+	_lastToastRuntimeID = None
+
+	def event_UIA_window_windowOpen(self):
+		if sys.getwindowsversion().build >= 15063:
+			toastTimestamp = time.time()
+			toastRuntimeID = self.UIAElement.getRuntimeID()
+			if toastRuntimeID == self._lastToastRuntimeID and toastTimestamp-self._lastToastTimestamp < 1.0:
+				return
+			self.__class__._lastToastTimestamp = toastTimestamp
+			self.__class__._lastToastRuntimeID = toastRuntimeID
+		Notification.event_alert(self)
 
 #WpfTextView fires name state changes once a second, plus when IUIAutomationTextRange::GetAttributeValue is called.
 #This causes major lags when using this control with Braille in NVDA. (#2759) 


Test patch: