Add script to extract and gather analytics event names.
// FREEBIE
This commit is contained in:
parent
f1807cd709
commit
465711c2cb
|
@ -125,7 +125,7 @@ EXTERNAL SOURCES:
|
|||
:branch: signal-master
|
||||
:git: https://github.com/WhisperSystems/JSQMessagesViewController.git
|
||||
SignalServiceKit:
|
||||
:path: "."
|
||||
:path: .
|
||||
SocketRocket:
|
||||
:git: https://github.com/facebook/SocketRocket.git
|
||||
|
||||
|
|
|
@ -874,7 +874,7 @@ protocol CallServiceObserver: class {
|
|||
call.callRecord = callRecord
|
||||
|
||||
let message = DataChannelMessage.forConnected(callId: call.signalingId)
|
||||
peerConnectionClient.sendDataChannelMessage(data: message.asData(), description:"connected")
|
||||
peerConnectionClient.sendDataChannelMessage(data: message.asData(), description:"connected", isCritical:true)
|
||||
|
||||
handleConnectedCall(call)
|
||||
}
|
||||
|
@ -994,7 +994,7 @@ protocol CallServiceObserver: class {
|
|||
|
||||
// If the call is connected, we can send the hangup via the data channel.
|
||||
let message = DataChannelMessage.forHangup(callId: call.signalingId)
|
||||
peerConnectionClient.sendDataChannelMessage(data: message.asData(), description:"hangup")
|
||||
peerConnectionClient.sendDataChannelMessage(data: message.asData(), description:"hangup", isCritical:true)
|
||||
|
||||
// If the call hasn't started yet, we don't have a data channel to communicate the hang up. Use Signal Service Message.
|
||||
let hangupMessage = OWSCallHangupMessage(callId: call.signalingId)
|
||||
|
|
|
@ -504,7 +504,7 @@ class PeerConnectionClient: NSObject, RTCPeerConnectionDelegate, RTCDataChannelD
|
|||
|
||||
// MARK: - Data Channel
|
||||
|
||||
public func sendDataChannelMessage(data: Data, description: String) {
|
||||
public func sendDataChannelMessage(data: Data, description: String, isCritical: Bool = false) {
|
||||
AssertIsOnMainThread()
|
||||
|
||||
PeerConnectionClient.signalingQueue.async {
|
||||
|
@ -527,6 +527,9 @@ class PeerConnectionClient: NSObject, RTCPeerConnectionDelegate, RTCDataChannelD
|
|||
Logger.debug("\(self.TAG) sendDataChannelMessage succeeded: \(description)")
|
||||
} else {
|
||||
Logger.warn("\(self.TAG) sendDataChannelMessage failed: \(description)")
|
||||
if isCritical {
|
||||
OWSProdError(OWSAnalyticsEvents.peerConnectionClientErrorSendDataChannelMessageFailed(), file:#file, function:#function, line:#line)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -218,34 +218,6 @@ def update_event_names(header_file_path, source_file_path):
|
|||
# event_names = sorted(set(event_names))
|
||||
code_generation_marker = '#pragma mark - Code Generation Marker'
|
||||
|
||||
# Header
|
||||
filepath = header_file_path
|
||||
with open(filepath, 'rt') as f:
|
||||
text = f.read()
|
||||
|
||||
code_generation_start = text.find(code_generation_marker)
|
||||
code_generation_end = text.rfind(code_generation_marker)
|
||||
if code_generation_start < 0:
|
||||
print 'Could not find marker in file:', file
|
||||
sys.exit(1)
|
||||
if code_generation_end < 0 or code_generation_end == code_generation_start:
|
||||
print 'Could not find marker in file:', file
|
||||
sys.exit(1)
|
||||
|
||||
generated = code_generation_marker
|
||||
for event_name in sorted(set(event_names)):
|
||||
# Example:
|
||||
# + (NSString *)call_service_call_already_set;
|
||||
objc_name = objc_name_for_event_name(event_name)
|
||||
text_for_event = '+ (NSString *)%s;' % (objc_name,)
|
||||
generated = generated + '\n\n' + text_for_event
|
||||
generated = generated + '\n\n' + code_generation_marker
|
||||
print 'generated', generated
|
||||
new_text = text[:code_generation_start] + generated + text[code_generation_end + len(code_generation_marker):]
|
||||
print 'text', new_text
|
||||
with open(filepath, 'wt') as f:
|
||||
f.write(new_text)
|
||||
|
||||
# Source
|
||||
filepath = source_file_path
|
||||
with open(filepath, 'rt') as f:
|
||||
|
@ -331,6 +303,36 @@ def update_event_names(header_file_path, source_file_path):
|
|||
f.write(new_text)
|
||||
|
||||
|
||||
# Header
|
||||
filepath = header_file_path
|
||||
with open(filepath, 'rt') as f:
|
||||
text = f.read()
|
||||
|
||||
code_generation_start = text.find(code_generation_marker)
|
||||
code_generation_end = text.rfind(code_generation_marker)
|
||||
if code_generation_start < 0:
|
||||
print 'Could not find marker in file:', file
|
||||
sys.exit(1)
|
||||
if code_generation_end < 0 or code_generation_end == code_generation_start:
|
||||
print 'Could not find marker in file:', file
|
||||
sys.exit(1)
|
||||
|
||||
generated = code_generation_marker
|
||||
for event_name in all_event_names:
|
||||
# Example:
|
||||
# + (NSString *)call_service_call_already_set;
|
||||
objc_name = objc_name_for_event_name(event_name)
|
||||
text_for_event = '+ (NSString *)%s;' % (objc_name,)
|
||||
generated = generated + '\n\n' + text_for_event
|
||||
generated = generated + '\n\n' + code_generation_marker
|
||||
print 'generated', generated
|
||||
new_text = text[:code_generation_start] + generated + text[code_generation_end + len(code_generation_marker):]
|
||||
print 'text', new_text
|
||||
with open(filepath, 'wt') as f:
|
||||
f.write(new_text)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# print 'git_repo_path', git_repo_path
|
||||
|
||||
|
|
|
@ -22,6 +22,28 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
+ (NSString *)appLaunch;
|
||||
|
||||
+ (NSString *)appLaunchComplete;
|
||||
|
||||
+ (NSString *)callServiceCallAlreadySet;
|
||||
|
||||
+ (NSString *)callServiceCallIdMismatch;
|
||||
|
||||
+ (NSString *)callServiceCallMismatch;
|
||||
|
||||
+ (NSString *)callServiceCallMissing;
|
||||
|
||||
+ (NSString *)callServiceCallUnexpectedlyIdle;
|
||||
|
||||
+ (NSString *)callServiceCouldNotCreatePeerConnectionClientPromise;
|
||||
|
||||
+ (NSString *)callServiceCouldNotCreateReadyToSendIceUpdatesPromise;
|
||||
|
||||
+ (NSString *)callServiceMissingFulfillReadyToSendIceUpdatesPromise;
|
||||
|
||||
+ (NSString *)callServicePeerConnectionAlreadySet;
|
||||
|
||||
+ (NSString *)callServicePeerConnectionMissing;
|
||||
|
||||
+ (NSString *)contactsErrorContactsIntersectionFailed;
|
||||
|
||||
+ (NSString *)errorAttachmentRequestFailed;
|
||||
|
@ -60,6 +82,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
+ (NSString *)messageManagerErrorMessageEnvelopeHasNoContent;
|
||||
|
||||
+ (NSString *)messageManagerErrorOversizeMessage;
|
||||
|
||||
+ (NSString *)messageManagerErrorPrekeyBundleEnvelopeHasNoContent;
|
||||
|
||||
+ (NSString *)messageReceiverErrorLargeMessage;
|
||||
|
@ -98,8 +122,12 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
+ (NSString *)messageSenderErrorUnexpectedKeyBundle;
|
||||
|
||||
+ (NSString *)peerConnectionClientErrorSendDataChannelMessageFailed;
|
||||
|
||||
+ (NSString *)prekeysDeletedOldAcceptedSignedPrekey;
|
||||
|
||||
+ (NSString *)prekeysDeletedOldSignedPrekey;
|
||||
|
||||
+ (NSString *)prekeysDeletedOldUnacceptedSignedPrekey;
|
||||
|
||||
+ (NSString *)registrationBegan;
|
||||
|
|
|
@ -290,6 +290,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
return @"message_sender_error_unexpected_key_bundle";
|
||||
}
|
||||
|
||||
+ (NSString *)peerConnectionClientErrorSendDataChannelMessageFailed
|
||||
{
|
||||
return @"peer_connection_client_error_send_data_channel_message_failed";
|
||||
}
|
||||
|
||||
+ (NSString *)prekeysDeletedOldAcceptedSignedPrekey
|
||||
{
|
||||
return @"prekeys_deleted_old_accepted_signed_prekey";
|
||||
|
|
Loading…
Reference in New Issue