From 3e0f5caffe9184be9265fbb1dfcd8944397e343c Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 29 Jan 2019 08:22:35 +0100 Subject: [PATCH] Improved error handling if ticket already got deleted in the meantime. --- lib/sessions/backend/ticket_overview_list.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/sessions/backend/ticket_overview_list.rb b/lib/sessions/backend/ticket_overview_list.rb index ab91f19d0..ba07bdfae 100644 --- a/lib/sessions/backend/ticket_overview_list.rb +++ b/lib/sessions/backend/ticket_overview_list.rb @@ -75,9 +75,9 @@ class Sessions::Backend::TicketOverviewList < Sessions::Backend::Base assets = {} overview = Overview.lookup(id: index[:overview][:id]) meta = { - name: overview.name, - prio: overview.prio, - link: overview.link, + name: overview.name, + prio: overview.prio, + link: overview.link, count: index[:count], } indexes.push meta @@ -86,7 +86,7 @@ class Sessions::Backend::TicketOverviewList < Sessions::Backend::Base @client.log "push overview_index for user #{@user.id}" @client.send( event: 'ticket_overview_index', - data: indexes, + data: indexes, ) end @@ -110,6 +110,7 @@ class Sessions::Backend::TicketOverviewList < Sessions::Backend::Base next if !asset_needed_by_updated_at?('Ticket', ticket_meta[:id], ticket_meta[:updated_at]) ticket = Ticket.lookup(id: ticket_meta[:id]) + next if !ticket assets = asset_push(ticket, assets) end data[:assets] = assets @@ -117,7 +118,7 @@ class Sessions::Backend::TicketOverviewList < Sessions::Backend::Base if !@client result = { event: 'ticket_overview_list', - data: data, + data: data, } results.push result else @@ -126,7 +127,7 @@ class Sessions::Backend::TicketOverviewList < Sessions::Backend::Base # send update to browser @client.send( event: 'ticket_overview_list', - data: data, + data: data, ) end end