If a user is logged in, begins an Add-Link task, and then is logged out (via another tab, session expiration, whatever) they'll see something like this:
and that generates history / logs like this:
In onVisualEditorApiVisualEditorEditPreSave(), after we have verified that we have data from the link recommendation plugin, we should check that the user is logged in. If the user is not logged in, we should return an error message. The error message should be: "We could not save your edit because you are no longer logged in. Please log in and try again.", with "log in" linking to Special:UserLogin.
It is okay if the user loses their in-progress edit when this happens, since this case will be rare.