mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-30 23:16:13 +00:00
Remove feature flags that are no longer remote capable.
This commit is contained in:
@@ -149,7 +149,7 @@ public final class FeatureFlags {
|
||||
SignalStore.remoteConfigValues().setPendingConfig(mapToJson(result.getDisk()));
|
||||
REMOTE_VALUES.clear();
|
||||
REMOTE_VALUES.putAll(result.getMemory());
|
||||
triggerFlagChangeListeners(result.getChanges());
|
||||
triggerFlagChangeListeners(result.getMemoryChanges());
|
||||
|
||||
SignalStore.remoteConfigValues().setLastFetchTime(System.currentTimeMillis());
|
||||
|
||||
@@ -271,6 +271,17 @@ public final class FeatureFlags {
|
||||
}
|
||||
});
|
||||
|
||||
Stream.of(allKeys)
|
||||
.filterNot(remoteCapable::contains)
|
||||
.filterNot(key -> sticky.contains(key) && localDisk.get(key) == Boolean.TRUE)
|
||||
.forEach(key -> {
|
||||
newDisk.remove(key);
|
||||
|
||||
if (hotSwap.contains(key)) {
|
||||
newMemory.remove(key);
|
||||
}
|
||||
});
|
||||
|
||||
return new UpdateResult(newMemory, newDisk, computeChanges(localMemory, newMemory));
|
||||
}
|
||||
|
||||
@@ -367,12 +378,12 @@ public final class FeatureFlags {
|
||||
static final class UpdateResult {
|
||||
private final Map<String, Boolean> memory;
|
||||
private final Map<String, Boolean> disk;
|
||||
private final Map<String, Change> changes;
|
||||
private final Map<String, Change> memoryChanges;
|
||||
|
||||
UpdateResult(@NonNull Map<String, Boolean> memory, @NonNull Map<String, Boolean> disk, @NonNull Map<String, Change> changes) {
|
||||
this.memory = memory;
|
||||
this.disk = disk;
|
||||
this.changes = changes;
|
||||
UpdateResult(@NonNull Map<String, Boolean> memory, @NonNull Map<String, Boolean> disk, @NonNull Map<String, Change> memoryChanges) {
|
||||
this.memory = memory;
|
||||
this.disk = disk;
|
||||
this.memoryChanges = memoryChanges;
|
||||
}
|
||||
|
||||
public @NonNull Map<String, Boolean> getMemory() {
|
||||
@@ -383,8 +394,8 @@ public final class FeatureFlags {
|
||||
return disk;
|
||||
}
|
||||
|
||||
public @NonNull Map<String, Change> getChanges() {
|
||||
return changes;
|
||||
public @NonNull Map<String, Change> getMemoryChanges() {
|
||||
return memoryChanges;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user