@@ -129,7 +129,6 @@ export class OFREPWebProvider implements Provider {
129
129
) : ResolutionDetails < T > {
130
130
return this . _resolve ( flagKey , 'object' , defaultValue ) ;
131
131
}
132
- /* eslint-enable @typescript-eslint/no-unused-vars */
133
132
134
133
/**
135
134
* onContextChange is called when the context changes, it will re-evaluate the flags with the new context
@@ -204,10 +203,6 @@ export class OFREPWebProvider implements Provider {
204
203
const bulkSuccessResp = response . value ;
205
204
const newCache : FlagCache = { } ;
206
205
207
- if ( 'metadata' in bulkSuccessResp && typeof bulkSuccessResp . flags === 'object' ) {
208
- this . _flagSetMetadataCache = bulkSuccessResp . metadata || { } ;
209
- }
210
-
211
206
if ( 'flags' in bulkSuccessResp && typeof bulkSuccessResp . flags === 'object' ) {
212
207
bulkSuccessResp . flags ?. forEach ( ( evalResp : EvaluationResponse ) => {
213
208
if ( isEvaluationFailureResponse ( evalResp ) ) {
@@ -230,6 +225,7 @@ export class OFREPWebProvider implements Provider {
230
225
const listUpdatedFlags = this . _getListUpdatedFlags ( this . _flagCache , newCache ) ;
231
226
this . _flagCache = newCache ;
232
227
this . _etag = response . httpResponse ?. headers . get ( 'etag' ) ;
228
+ this . _flagSetMetadataCache = typeof bulkSuccessResp . metadata === 'object' ? bulkSuccessResp . metadata : { } ;
233
229
return { status : BulkEvaluationStatus . SUCCESS_WITH_CHANGES , flags : listUpdatedFlags } ;
234
230
} else {
235
231
throw new Error ( 'No flags in OFREP bulk evaluation response' ) ;
0 commit comments