mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-24 03:58:49 +03:00
Fixed error where an invalid event would cause the entire application to halt, this just ignores it.
This commit is contained in:
parent
a1fed44b50
commit
b5d5d1c393
1 changed files with 11 additions and 2 deletions
|
@ -34,6 +34,7 @@
|
||||||
#include "UserSettingsPage.h"
|
#include "UserSettingsPage.h"
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
#include "encryption/Olm.h"
|
#include "encryption/Olm.h"
|
||||||
|
#include <typeinfo>
|
||||||
|
|
||||||
//! Should be changed when a breaking change occurs in the cache format.
|
//! Should be changed when a breaking change occurs in the cache format.
|
||||||
//! This will reset client's data.
|
//! This will reset client's data.
|
||||||
|
@ -1848,6 +1849,7 @@ isMessage(const mtx::events::RoomEvent<mtx::events::voip::CallHangUp> &)
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Cache::saveState(const mtx::responses::Sync &res)
|
Cache::saveState(const mtx::responses::Sync &res)
|
||||||
{
|
{
|
||||||
|
@ -1876,11 +1878,18 @@ Cache::saveState(const mtx::responses::Sync &res)
|
||||||
}
|
}
|
||||||
|
|
||||||
auto j = nlohmann::json(event);
|
auto j = nlohmann::json(event);
|
||||||
|
try {
|
||||||
accountDataDb.put(txn, j["type"].get<std::string>(), j.dump());
|
accountDataDb.put(txn, j["type"].get<std::string>(), j.dump());
|
||||||
|
}
|
||||||
|
catch (const lmdb::error &e) {
|
||||||
|
nhlog::db()->warn("failed to save state after sync: {}, skipping event", e.what());
|
||||||
|
return;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
ev);
|
ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
auto userKeyCacheDb = getUserKeysDb(txn);
|
auto userKeyCacheDb = getUserKeysDb(txn);
|
||||||
|
|
||||||
std::set<std::string> spaces_with_updates;
|
std::set<std::string> spaces_with_updates;
|
||||||
|
|
Loading…
Reference in a new issue