@@ -287,7 +287,16 @@ impl Container for NetworkContainer {
287
287
source : & SourceId ,
288
288
types : & [ ComputedType ] ,
289
289
) -> ContainerResult < ( ) > {
290
- self . cache . add_computed_types ( source, types)
290
+ // NOTE: We must `add_computed_types` to the cache before we add the chunk, as `added_chunks` is
291
+ // not consulted when retrieving types from the cache, if we fail to add the types to
292
+ // the cache, we will not see them show up in the UI or when matching.
293
+ self . cache . add_computed_types ( source, types) ?;
294
+ let type_chunk = TypeChunk :: new_with_computed ( types) . ok_or (
295
+ ContainerError :: CorruptedData ( "signature chunk failed to validate" ) ,
296
+ ) ?;
297
+ let chunk = Chunk :: new ( ChunkKind :: Type ( type_chunk) , CompressionType :: None ) ;
298
+ self . added_chunks . entry ( * source) . or_default ( ) . push ( chunk) ;
299
+ Ok ( ( ) )
291
300
}
292
301
293
302
fn remove_types ( & mut self , source : & SourceId , guids : & [ TypeGUID ] ) -> ContainerResult < ( ) > {
@@ -300,6 +309,10 @@ impl Container for NetworkContainer {
300
309
source : & SourceId ,
301
310
functions : & [ Function ] ,
302
311
) -> ContainerResult < ( ) > {
312
+ // NOTE: We must `add_functions` to the cache before we add the chunk, as `added_chunks` is
313
+ // not consulted when retrieving functions from the cache, if we fail to add the functions to
314
+ // the cache, we will not see them show up in the UI or when matching.
315
+ self . cache . add_functions ( target, source, functions) ?;
303
316
let signature_chunk = SignatureChunk :: new ( functions) . ok_or (
304
317
ContainerError :: CorruptedData ( "signature chunk failed to validate" ) ,
305
318
) ?;
0 commit comments