Harden output cache and debug state integration
This commit is contained in:
@@ -491,10 +491,19 @@ func debugSourceChunkEnvelope(chunk source.Chunk) debugSourceChunk {
|
||||
}
|
||||
|
||||
func cloneSourceUnitsForDebug(units []source.SourceUnit) []source.SourceUnit {
|
||||
cloned, err := cloneSourceUnits(units)
|
||||
if err != nil {
|
||||
if len(units) == 0 {
|
||||
return nil
|
||||
}
|
||||
cloned := make([]source.SourceUnit, len(units))
|
||||
for i, unit := range units {
|
||||
cloned[i] = source.SourceUnit{
|
||||
ID: unit.ID,
|
||||
Kind: unit.Kind,
|
||||
Text: string(redactSecretBytes([]byte(unit.Text))),
|
||||
Ref: unit.Ref,
|
||||
Metadata: redactSensitiveMap(unit.Metadata),
|
||||
}
|
||||
}
|
||||
return cloned
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user