Fixes the clearing of the mapping function between users and subscription ids when subscriptions end
This commit is contained in:
+2
-3
@@ -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,12 +95,10 @@ 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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
abstract fun updateFilter(
|
abstract fun updateFilter(
|
||||||
key: T,
|
key: T,
|
||||||
|
|||||||
+4
-5
@@ -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,17 +88,15 @@ 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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
abstract fun updateFilter(
|
abstract fun updateFilter(
|
||||||
key: T,
|
key: T,
|
||||||
|
|||||||
+2
-3
@@ -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,12 +92,10 @@ 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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
abstract fun updateFilter(
|
abstract fun updateFilter(
|
||||||
key: T,
|
key: T,
|
||||||
|
|||||||
Reference in New Issue
Block a user