Fixes the clearing of the mapping function between users and subscription ids when subscriptions end
This commit is contained in:
+3
-4
@@ -70,6 +70,7 @@ abstract class PerUniqueIdEoseManager<T>(
|
|||||||
subId: String,
|
subId: String,
|
||||||
) {
|
) {
|
||||||
orchestrator.dismissSubscription(subId)
|
orchestrator.dismissSubscription(subId)
|
||||||
|
userSubscriptionMap.remove(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun findOrCreateSubFor(key: T): Subscription {
|
fun findOrCreateSubFor(key: T): Subscription {
|
||||||
@@ -94,10 +95,8 @@ abstract class PerUniqueIdEoseManager<T>(
|
|||||||
updated.add(mainKey)
|
updated.add(mainKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
userSubscriptionMap.forEach {
|
userSubscriptionMap.filter { it.key !in updated }.forEach {
|
||||||
if (it.key !in updated) {
|
endSub(it.key, it.value)
|
||||||
endSub(it.key, it.value)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-6
@@ -68,6 +68,7 @@ abstract class PerUserAndFollowListEoseManager<T>(
|
|||||||
subId: String,
|
subId: String,
|
||||||
) {
|
) {
|
||||||
orchestrator.dismissSubscription(subId)
|
orchestrator.dismissSubscription(subId)
|
||||||
|
userSubscriptionMap.remove(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun findOrCreateSubFor(key: T): Subscription {
|
fun findOrCreateSubFor(key: T): Subscription {
|
||||||
@@ -87,15 +88,13 @@ abstract class PerUserAndFollowListEoseManager<T>(
|
|||||||
|
|
||||||
uniqueSubscribedAccounts.forEach {
|
uniqueSubscribedAccounts.forEach {
|
||||||
val user = user(it)
|
val user = user(it)
|
||||||
findOrCreateSubFor(it).relayBasedFilters = updateFilter(it, since(it))?.ifEmpty { null }
|
val sub = findOrCreateSubFor(it)
|
||||||
|
sub.relayBasedFilters = updateFilter(it, since(it))?.ifEmpty { null }
|
||||||
updated.add(user)
|
updated.add(user)
|
||||||
}
|
}
|
||||||
|
|
||||||
userSubscriptionMap.forEach {
|
userSubscriptionMap.filter { it.key !in updated }.forEach {
|
||||||
if (it.key !in updated) {
|
endSub(it.key, it.value)
|
||||||
endSub(it.key, it.value)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-4
@@ -67,6 +67,7 @@ abstract class PerUserEoseManager<T>(
|
|||||||
subId: String,
|
subId: String,
|
||||||
) {
|
) {
|
||||||
orchestrator.dismissSubscription(subId)
|
orchestrator.dismissSubscription(subId)
|
||||||
|
userSubscriptionMap.remove(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun findOrCreateSubFor(key: T): Subscription {
|
fun findOrCreateSubFor(key: T): Subscription {
|
||||||
@@ -91,10 +92,8 @@ abstract class PerUserEoseManager<T>(
|
|||||||
updated.add(user)
|
updated.add(user)
|
||||||
}
|
}
|
||||||
|
|
||||||
userSubscriptionMap.forEach {
|
userSubscriptionMap.filter { it.key !in updated }.forEach {
|
||||||
if (it.key !in updated) {
|
endSub(it.key, it.value)
|
||||||
endSub(it.key, it.value)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user