Skip to content

Commit

Permalink
Merge pull request #2223 from OneSignal/fix/canStartExecute
Browse files Browse the repository at this point in the history
[Fix] Check subscription Id before executing delete and update subscription operations
  • Loading branch information
shepherd-l authored Nov 27, 2024
2 parents 3b7e5d6 + 9831006 commit 7c15a59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DeleteSubscriptionOperation() : Operation(SubscriptionOperationExecutor.DE
override val createComparisonKey: String get() = "$appId.User.$onesignalId"
override val modifyComparisonKey: String get() = "$appId.User.$onesignalId.Subscription.$subscriptionId"
override val groupComparisonType: GroupComparisonType = GroupComparisonType.NONE
override val canStartExecute: Boolean get() = !IDManager.isLocalId(onesignalId) && !IDManager.isLocalId(onesignalId)
override val canStartExecute: Boolean get() = !IDManager.isLocalId(onesignalId) && !IDManager.isLocalId(subscriptionId)
override val applyToRecordId: String get() = subscriptionId

constructor(appId: String, onesignalId: String, subscriptionId: String) : this() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class UpdateSubscriptionOperation() : Operation(SubscriptionOperationExecutor.UP
override val createComparisonKey: String get() = "$appId.User.$onesignalId"
override val modifyComparisonKey: String get() = "$appId.User.$onesignalId.Subscription.$subscriptionId"
override val groupComparisonType: GroupComparisonType = GroupComparisonType.ALTER
override val canStartExecute: Boolean get() = !IDManager.isLocalId(onesignalId) && !IDManager.isLocalId(onesignalId)
override val canStartExecute: Boolean get() = !IDManager.isLocalId(onesignalId) && !IDManager.isLocalId(subscriptionId)
override val applyToRecordId: String get() = subscriptionId

constructor(appId: String, onesignalId: String, subscriptionId: String, type: SubscriptionType, enabled: Boolean, address: String, status: SubscriptionStatus) : this() {
Expand Down

0 comments on commit 7c15a59

Please sign in to comment.