Fix issue with multiple Cancellations for same target ID.

PiperOrigin-RevId: 726234081
This commit is contained in:
Francis Tsui
2025-02-12 16:08:37 -08:00
committed by Copybara-Service
parent 2587c6abad
commit 1d3b17821b
8 changed files with 19 additions and 35 deletions
+3 -1
View File
@@ -119,7 +119,8 @@ class ShareSession {
return attachment_container_;
}
void CancelPayloads();
// Returns false if session is already cancelled, otherwise returns true.
bool CancelPayloads();
const absl::flat_hash_map<int64_t, int64_t>& attachment_payload_map() const {
return attachment_payload_map_;
@@ -215,6 +216,7 @@ class ShareSession {
AttachmentContainer attachment_container_;
absl::flat_hash_map<int64_t, int64_t> attachment_payload_map_;
PayloadTracker::PayloadUpdateQueue* payload_updates_queue_ = nullptr;
bool is_cancelled_ = false;
};
} // namespace nearby::sharing