If you're flat in your account, your initial sell is a sell short.
If a buy order executes, your sell becomes sell long.
Partial fills would reduce the sell short side and add a sell long side.
This could result in priority being maintained.
This is all handled according to exchange...