@@ -287,7 +287,16 @@ impl Container for NetworkContainer {
287287 source : & SourceId ,
288288 types : & [ ComputedType ] ,
289289 ) -> 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 ( ( ) )
291300 }
292301
293302 fn remove_types ( & mut self , source : & SourceId , guids : & [ TypeGUID ] ) -> ContainerResult < ( ) > {
@@ -300,6 +309,10 @@ impl Container for NetworkContainer {
300309 source : & SourceId ,
301310 functions : & [ Function ] ,
302311 ) -> 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) ?;
303316 let signature_chunk = SignatureChunk :: new ( functions) . ok_or (
304317 ContainerError :: CorruptedData ( "signature chunk failed to validate" ) ,
305318 ) ?;
0 commit comments