Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "UserSettingsPage.h"
#include "Utils.h"
#include "encryption/Olm.h"
#include <typeinfo>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This include seems unnecessary?


//! Should be changed when a breaking change occurs in the cache format.
//! This will reset client's data.
Expand Down Expand Up @@ -1876,7 +1877,13 @@ Cache::saveState(const mtx::responses::Sync &res)
}

auto j = nlohmann::json(event);
accountDataDb.put(txn, j["type"].get<std::string>(), j.dump());
try {
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);
}
Expand Down