Skip to content

Commit 5f48b4f

Browse files
authored
bug: Only attempt to create a new state if the old is not set (#1025)
Closes PUSH-571
1 parent 796674d commit 5f48b4f

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

Cargo.lock

Lines changed: 32 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

autopush-common/src/reliability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ impl PushReliability {
270270
// Create the initial state key.
271271
// Do not place this inside of the transaction. We monitor the state key and the transaction will
272272
// fail because the value will change before the transaction completes. Yes, really.
273-
if new == ReliabilityState::Received {
273+
if new == ReliabilityState::Received && old.is_none() {
274274
trace!(
275275
"🔍 Creating new record {state_key} ex {:?}",
276276
expr.unwrap_or(MIN_EXPIRATION)

0 commit comments

Comments
 (0)