You need to review a small PR in the notification window preparation module. After the change, users report that actions in the window sometimes open the wrong section, and the history of recent notifications starts to “move” between independent windows.
build_action_handlers(names) must return a list of functions."open:<name>" for its own name from the input list.NotificationWindow.push(message) must add a message to the history of a specific instance.NotificationWindow.snapshot() must return a new list with the current history of the instance.NotificationWindow instances must not share history with each other.python:from app import build_action_handlers, NotificationWindow
handlers = build_action_handlers(["billing", "support", "profile"])
print([h() for h in handlers])
left = NotificationWindow("left")
right = NotificationWindow("right")
left.push("invoice-ready")
print(left.snapshot())
print(right.snapshot())
right.push("ticket-updated")
print(left.snapshot())
print(right.snapshot())
open:billingopen:supportopen:profileleft.push("invoice-ready"), the right history should remain empty.right.push("ticket-updated"), each window should contain only its own messages.CPython 3.12pythonapp.pyUse line comments to explain the problem, its impact, the fix and how to test it.