102102 return error[BSGKeyReason] ?: @" " ;
103103}
104104
105+ id BSGLoadConfigValue (NSDictionary *report, NSString *valueName) {
106+ NSString *keypath = [NSString stringWithFormat: @" user.config.%@ " , valueName];
107+ NSString *fallbackKeypath = [NSString stringWithFormat: @" user.config.config.%@ " , valueName];
108+
109+ return [report valueForKeyPath: keypath]
110+ ?: [report valueForKeyPath: fallbackKeypath]; // some custom values are nested
111+ }
112+
105113NSString *BSGParseContext (NSDictionary *report, NSDictionary *metaData) {
106114 id context = [report valueForKeyPath: @" user.overrides.context" ];
107115 if ([context isKindOfClass: [NSString class ]])
108116 return context;
109117 context = metaData[BSGKeyContext];
110118 if ([context isKindOfClass: [NSString class ]])
111119 return context;
112- context = [ report valueForKeyPath: @" user.config. context" ] ;
120+ context = BSGLoadConfigValue ( report, @" context" ) ;
113121 if ([context isKindOfClass: [NSString class ]])
114122 return context;
115123 return nil ;
132140
133141NSString *BSGParseReleaseStage (NSDictionary *report) {
134142 return [report valueForKeyPath: @" user.overrides.releaseStage" ]
135- ?: [ report valueForKeyPath: @" user.config. releaseStage" ] ;
143+ ?: BSGLoadConfigValue ( report, @" releaseStage" ) ;
136144}
137145
138146BSGSeverity BSGParseSeverity (NSString *severity) {
@@ -253,8 +261,7 @@ - (instancetype)initWithKSReport:(NSDictionary *)report
253261 }
254262 } else {
255263 FallbackReportData *fallback = [[FallbackReportData alloc ] initWithMetadata: metadata];
256- _notifyReleaseStages =
257- [report valueForKeyPath: @" user.config.notifyReleaseStages" ];
264+ _notifyReleaseStages = BSGLoadConfigValue (report, @" notifyReleaseStages" );
258265 _releaseStage = BSGParseReleaseStage (report);
259266 _incomplete = report.count == 0 ;
260267 _threads = [report valueForKeyPath: @" crash.threads" ];
@@ -276,7 +283,10 @@ - (instancetype)initWithKSReport:(NSDictionary *)report
276283 _deviceState = BSGParseDeviceState (report);
277284 _device = BSGParseDevice (report);
278285 _app = BSGParseApp (report);
279- _appState = BSGParseAppState (report[BSGKeySystem], [report valueForKeyPath: @" user.config.appVersion" ]);
286+ _appState = BSGParseAppState (report[BSGKeySystem],
287+ BSGLoadConfigValue (report, @" appVersion" ),
288+ _releaseStage, // Already loaded from config
289+ BSGLoadConfigValue (report, @" codeBundleId" ));
280290 _groupingHash = BSGParseGroupingHash (report, _metaData);
281291 _overrides = [report valueForKeyPath: @" user.overrides" ];
282292 _customException = BSGParseCustomException (report, [_errorClass copy ],
0 commit comments