mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 12:06:53 +00:00
Add an experiment to skip envelope expansion
This commit is contained in:
1 parent
69a954e889
commit
0d32ca120d
2 files changed
+37
No files matched your search
@@ -24,6 +24,9 @@ public class EnvelopeUtil {
|
||||
@VisibleForTesting
|
||||
static final String INCLUDE_BINARY_SERVICE_ID_EXPERIMENT_NAME = "envelopeIncludeBinaryServiceIdentifier";
|
||||
|
||||
@VisibleForTesting
|
||||
static final String SKIP_EXPANSION_EXPERIMENT_NAME = "skipEnvelopeExpansion";
|
||||
|
||||
/**
|
||||
* Converts all "compressible" UUID-like fields in the given envelope to more compact binary representations.
|
||||
*
|
||||
@@ -77,6 +80,7 @@ public class EnvelopeUtil {
|
||||
final ExperimentEnrollmentManager experimentEnrollmentManager) {
|
||||
|
||||
final boolean includeBinaryServiceIdentifiers;
|
||||
final boolean skipEnvelopeExpansion;
|
||||
|
||||
if (envelope.hasDestinationServiceIdBinary() || envelope.hasDestinationServiceId()) {
|
||||
final ServiceIdentifier destinationIdentifier = envelope.hasDestinationServiceIdBinary()
|
||||
@@ -85,8 +89,16 @@ public class EnvelopeUtil {
|
||||
|
||||
includeBinaryServiceIdentifiers =
|
||||
experimentEnrollmentManager.isEnrolled(destinationIdentifier.uuid(), INCLUDE_BINARY_SERVICE_ID_EXPERIMENT_NAME);
|
||||
|
||||
skipEnvelopeExpansion =
|
||||
experimentEnrollmentManager.isEnrolled(destinationIdentifier.uuid(), SKIP_EXPANSION_EXPERIMENT_NAME);
|
||||
} else {
|
||||
includeBinaryServiceIdentifiers = false;
|
||||
skipEnvelopeExpansion = false;
|
||||
}
|
||||
|
||||
if (skipEnvelopeExpansion) {
|
||||
return envelope;
|
||||
}
|
||||
|
||||
final MessageProtos.Envelope.Builder builder = envelope.toBuilder();
|
||||
|
||||
Reference in new issue
Block a user