Skip to content
Snippets Groups Projects
Commit f17ac79d authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Fix for local response store

parent 462574b0
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
Pipeline #28094 failed
......@@ -69,7 +69,11 @@ Feed::Feed(nlohmann::json &config, ftl::net::Universe*net) :
// Send only reponse channels on a per frame basis
if (f.mode() == ftl::data::FrameMode::RESPONSE) {
if (streams_.find(f.frameset()) != streams_.end()) {
sender_->post(f, c);
} else {
f.forceStore();
}
}
return true;
});
......
......@@ -300,6 +300,12 @@ class Frame {
/** Copy persistent changes to session. To be called before dispatch. */
void store();
/**
* Should only be used by Feed class. Ignores storage rules and saves
* to session anyway.
*/
void forceStore();
inline auto begin() const { return data_.begin(); }
inline auto end() const { return data_.end(); }
......
......@@ -275,6 +275,10 @@ void Frame::store() {
void Frame::_primaryStore() {
if (mode_ == FrameMode::RESPONSE) return;
forceStore();
}
void Frame::forceStore() {
if (!parent_) return;
//UNIQUE_LOCK(parent_->mutex(), lk);
......@@ -287,6 +291,7 @@ void Frame::_primaryStore() {
//pd.encoded = std::move(d.encoded);
pd.status = ChannelStatus::VALID;
//data_.erase(c.first);
d.status = ChannelStatus::INVALID;
}
parent_->change_.trigger(*this, c.first);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment