Implement unsafe icon cache diagnostics (T-611)

This commit is contained in:
ila
2026-07-18 15:18:29 +08:00
parent 6455fec811
commit 320b83d929
22 changed files with 697 additions and 31 deletions
+5 -4
View File
@@ -33,7 +33,7 @@ type AppShell struct {
iconReferences map[string]string
iconRequests map[string]application.IconEventIdentity
iconApplied map[string]application.IconEventIdentity
iconFailures map[string]application.IconFailureCode
iconFailures map[string]iconFailureState
lastRendered int
detailRendered bool
}
@@ -54,7 +54,7 @@ func NewAppShell(
iconReferences: make(map[string]string),
iconRequests: make(map[string]application.IconEventIdentity),
iconApplied: make(map[string]application.IconEventIdentity),
iconFailures: make(map[string]application.IconFailureCode),
iconFailures: make(map[string]iconFailureState),
}
shell.search.SingleLine = true
shell.SetItems(items)
@@ -82,7 +82,7 @@ func (shell *AppShell) SetItems(items []application.CatalogListItem) {
nextReferences := make(map[string]string, len(items))
nextRequests := make(map[string]application.IconEventIdentity, len(items))
nextApplied := make(map[string]application.IconEventIdentity, len(items))
nextFailures := make(map[string]application.IconFailureCode, len(items))
nextFailures := make(map[string]iconFailureState, len(items))
for _, item := range items {
controls := shell.rows[item.ID]
if controls == nil {
@@ -101,7 +101,8 @@ func (shell *AppShell) SetItems(items []application.CatalogListItem) {
if applied, exists := shell.iconApplied[item.ID]; exists && applied.Reference == reference {
nextApplied[item.ID] = applied
}
if failure, exists := shell.iconFailures[item.ID]; exists {
if failure, exists := shell.iconFailures[item.ID]; exists &&
failure.Identity.Reference == reference {
nextFailures[item.ID] = failure
}
}