Merge pull request #58 from Valorith/copilot/sub-pr-55-another-one

Fix false error log in SaveBuffs due to REPLACE INTO row count semantics
This commit is contained in:
Vayle 2026-03-08 14:42:07 -04:00 committed by GitHub
commit 8adfc97088
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -895,7 +895,7 @@ inline void TestClientBuffPersistence()
Client loader; Client loader;
loader.SetCharacterId(test_character_id); loader.SetCharacterId(test_character_id);
loader.SetName("buff-persistence-load"); loader.SetName("buff-persistence-load");
loader.SetClientVersion(ClientVersion::RoF2); loader.SetClientVersion(EQ::versions::ClientVersion::RoF2);
database.LoadBuffs(&loader); database.LoadBuffs(&loader);
auto loaded_buffs = loader.GetBuffs(); auto loaded_buffs = loader.GetBuffs();

View File

@ -2935,9 +2935,9 @@ void ZoneDatabase::SaveBuffs(Client *client)
if (!v.empty()) { if (!v.empty()) {
const auto saved_count = CharacterBuffsRepository::ReplaceMany(database, v); const auto saved_count = CharacterBuffsRepository::ReplaceMany(database, v);
if (saved_count != static_cast<int>(v.size())) { if (saved_count < static_cast<int>(v.size())) {
LogError( LogError(
"Failed to save all buffs for character [{}] [{}]. Expected [{}] rows, saved [{}]. Verify the `character_buffs` schema is up to date.", "Failed to save all buffs for character [{}] [{}]. Expected at least [{}] rows saved, got [{}]. Verify the `character_buffs` schema is up to date.",
client->GetCleanName(), client->GetCleanName(),
client->CharacterID(), client->CharacterID(),
v.size(), v.size(),