Composer Messages Exception

Steps to repro:

  1. On a vanilla instance with a new user, start to compose your first message.

  2. The education.new_topic composer message will appear. Dismiss it.

  3. Write until the draft process is triggered and the draft saves.

  4. Refresh the page. The composer will re-open with your draft.

  5. An exception will be thrown. _findMessages attempts to add the welcome message to queuedForTyping, which is null at the time it is assigned.

The issue is with the sequence of reseting queuedForTyping and initialising the async find for composer messages, see the console.log in the screenshot.

One simple fix is to move the queuedForTyping assignment inside the then block of the composer-messages lookup, however I think there’s still race conditions with that solution. Nevertheless, that’s all I have time for right now…


PR seems to work fine, so I am merging it in.