Take the read-back back out of the persist; a write verdict belongs only where evidence crosses the plugin boundary
Its false gated six undo points, so an unverified byte-equality assumption could have silently removed Ctrl-Z for a bank mutation that landed.
This commit is contained in:
@@ -183,23 +183,10 @@ bool ReaSamplerSession::saveToActiveProject() {
|
||||
|
||||
MarkProjectDirty(static_cast<ReaProject*>(proj));
|
||||
|
||||
// Prove the ONE key a caller's answer hinges on. Each SetProjExtState above returns the
|
||||
// size of the whole extname's state, which the six writes here keep non-zero between
|
||||
// them, so no single one of those returns can speak for `banks`
|
||||
// (wire::extStateWriteLanded owns the reasoning). The sibling keys stay unobserved and
|
||||
// no caller claims otherwise; `banks` is the one whose absence would make a landed
|
||||
// capture vanish on reload.
|
||||
const wire::GrowingExtStateRead back = wire::readProjExtStateGrowing(
|
||||
[&](char* buf, int cap) {
|
||||
return GetProjExtState(static_cast<ReaProject*>(proj), projExtNamespace(),
|
||||
kProjExtBanksKey, buf, cap);
|
||||
});
|
||||
if (back.status == wire::GrowingExtStateRead::Status::Overflow)
|
||||
return false; // could not check -> do not claim; never folded in as an absence
|
||||
return wire::extStateWriteLanded(
|
||||
banksJson, back.status == wire::GrowingExtStateRead::Status::Complete
|
||||
? std::optional<std::string>(back.value)
|
||||
: std::nullopt);
|
||||
// The writes were ISSUED into a saved active project — all this call can observe, and
|
||||
// deliberately all it claims. Do not "prove" them with a read-back; session.h states
|
||||
// what a false has to keep meaning to its callers, and why.
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ReaSamplerSession::writeAssignmentRequest(const std::string& wire) {
|
||||
|
||||
Reference in New Issue
Block a user