Fix runtime safety and state consistency issues#5037
Open
HeresHavi wants to merge 10 commits into
Open
Conversation
Ensures queued tasks finish safely when the scheduler shuts down.
Prevents empty and incomplete resource paths from causing invalid string access.
Keeps existing backups when creating or renaming a new backup fails.
Sends predictable zero-filled compatibility data instead of reading beyond an empty string.
Prevents long file and function names from corrupting resource-start packets.
Ignores server-browser replies that come from a different address or port than requested.
Rejects malformed or excessively large compressed scripts before allocating memory.
Prevents background cache saves from racing with live server-list changes.
Keeps account changes pending when the database save cannot be queued or later fails.
Finds the affected account in memory because the database may still be unavailable while handling a failed save.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed nine runtime safety and persistence issues across the client, server, and shared task scheduler.
The changes cover:
Each fix is kept in a focused commit for easier review.
Motivation
These problems mostly appeared during shutdown, malformed input, temporary database failures, filesystem errors, or background cache updates. Normal behavior could appear fine while the failure path dropped work, accepted the wrong response, or left saved data in an inconsistent state.
For example, a temporary database lock could cause an account update to be lost instead of retried. A failed backup rename could also be treated as success and allow older working backups to be removed.
Test plan
Runtime
database is locked, then confirmed it retried automatically and persisted the updated password.Builds and Tests
Debug | Win32: Clean client and server component builds passed, 305 client tests passed.Release | Win32: Clean client and server component builds passed, 305 client tests passed.Debug | x64: Server build passed.Release | x64: Server build passed.clang-format.Checklist