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,
|
||||
) {
|
||||
orchestrator.dismissSubscription(subId)
|
||||
userSubscriptionMap.remove(key)
|
||||
}
|
||||
|
||||
fun findOrCreateSubFor(key: T): Subscription {
|
||||
@@ -94,10 +95,8 @@ abstract class PerUniqueIdEoseManager<T>(
|
||||
updated.add(mainKey)
|
||||
}
|
||||
|
||||
userSubscriptionMap.forEach {
|
||||
if (it.key !in updated) {
|
||||
endSub(it.key, it.value)
|
||||
}
|
||||
userSubscriptionMap.filter { it.key !in updated }.forEach {
|
||||
endSub(it.key, it.value)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-6
@@ -68,6 +68,7 @@ abstract class PerUserAndFollowListEoseManager<T>(
|
||||
subId: String,
|
||||
) {
|
||||
orchestrator.dismissSubscription(subId)
|
||||
userSubscriptionMap.remove(key)
|
||||
}
|
||||
|
||||
fun findOrCreateSubFor(key: T): Subscription {
|
||||
@@ -87,15 +88,13 @@ abstract class PerUserAndFollowListEoseManager<T>(
|
||||
|
||||
uniqueSubscribedAccounts.forEach {
|
||||
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)
|
||||
}
|
||||
|
||||
userSubscriptionMap.forEach {
|
||||
if (it.key !in updated) {
|
||||
endSub(it.key, it.value)
|
||||
}
|
||||
userSubscriptionMap.filter { it.key !in updated }.forEach {
|
||||
endSub(it.key, it.value)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-4
@@ -67,6 +67,7 @@ abstract class PerUserEoseManager<T>(
|
||||
subId: String,
|
||||
) {
|
||||
orchestrator.dismissSubscription(subId)
|
||||
userSubscriptionMap.remove(key)
|
||||
}
|
||||
|
||||
fun findOrCreateSubFor(key: T): Subscription {
|
||||
@@ -91,10 +92,8 @@ abstract class PerUserEoseManager<T>(
|
||||
updated.add(user)
|
||||
}
|
||||
|
||||
userSubscriptionMap.forEach {
|
||||
if (it.key !in updated) {
|
||||
endSub(it.key, it.value)
|
||||
}
|
||||
userSubscriptionMap.filter { it.key !in updated }.forEach {
|
||||
endSub(it.key, it.value)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user