What was broken Updating a plugin crashed
After downloading the new version, updatePlugin() called refreshRows(), which resets the Sushi connection, and then refresh() on the old model instance. An update from the panel or the console died with query() on null and left the plugin uninstalled.
How we fixed it The record is loaded again
The code loads the plugin again with Plugin::findOrFail(), as the plugin jobs in the project already do, and the API returns the fresh object. A new test of a successful update failed with the same error before the fix.
#2598
What was broken A server without its primary allocation vanished
The panel let you remove a server's primary allocation, the IP address and port assigned to it, even the last one. The port mappings for the Wings daemon then arrived as an empty list [] instead of an object, so Wings skipped the server on boot and the panel showed it as missing.
How we fixed it The primary moves to a remaining allocation
A new Server::releaseAllocations() method releases allocations and moves the primary to a remaining one, in one transaction with a row lock. The admin panel, the server panel and the client API all use it, and the last two no longer allow removing the final allocation. A migration repairs servers that pointed at a released allocation.
#2635