Difference between aria-live="assertive" and aria-live="polite"
Solution 1:
The behavior of live regions depends on the browser and screen reader being used, but you're on the right track.
According to the WAI-ARIA spec:
The values of this attribute are expressed in degrees of importance. When regions are specified as polite, assistive technologies will notify users of updates but generally do not interrupt the current task, and updates take low priority. When regions are specified as assertive, assistive technologies will immediately notify the user, and could potentially clear the speech queue of previous updates.
Usage notes from the WAI-ARIA authoring practices 1.1:
aria-live="polite"
Any updates made to this region should only be announced if the user is not currently doing anything. live="polite" should be used in most situations involving live regions that present new information to users, such as updating news headlines. -
aria-live="assertive"
Any updates made to this region are important enough to be announced to the user as soon as possible, but it is not necessary to immediately interrupt the user. live="assertive" must be used if there is information that a user must know about right away, for example, warning messages in a form that does validation on the fly.
Regarding clearing the queue (also from the spec):
User agents or assistive technologies MAY choose to clear queued changes when an assertive change occurs.