Fixed race condition in asset generation of session "/show".
This commit is contained in:
parent
435517071b
commit
7710c1232e
8 changed files with 48 additions and 51 deletions
|
@ -235,10 +235,6 @@ job_integration_browser_ff_3:
|
|||
- browser-ff
|
||||
script:
|
||||
- export BROWSER_URL=http://$IP:3031
|
||||
- unset MAILBOX_AUTO1
|
||||
- unset MAILBOX_AUTO2
|
||||
- unset MAILBOX_MANUAL1
|
||||
- unset MAILBOX_MANUAL2
|
||||
- script/build/test_db_config.sh production ci_zammad_browser_ff_3
|
||||
- script/build/test_db_config.sh test ci_zammad_browser_ff_3_test
|
||||
- script/build/test_slice_tests.sh 3
|
||||
|
|
|
@ -61,7 +61,7 @@ class ApplicationController < ActionController::Base
|
|||
def current_user
|
||||
return @_current_user if @_current_user
|
||||
return if !session[:user_id]
|
||||
@_current_user = User.find( session[:user_id] )
|
||||
@_current_user = User.lookup(id: session[:user_id])
|
||||
end
|
||||
|
||||
def current_user_set(user)
|
||||
|
@ -159,7 +159,7 @@ class ApplicationController < ActionController::Base
|
|||
# already logged in, early exit
|
||||
if session.id && session[:user_id]
|
||||
|
||||
userdata = User.find(session[:user_id])
|
||||
userdata = User.lookup(id: session[:user_id])
|
||||
current_user_set(userdata)
|
||||
|
||||
return {
|
||||
|
|
|
@ -36,12 +36,13 @@ class SessionsController < ApplicationController
|
|||
# log new session
|
||||
user.activity_stream_log('session started', user.id, true)
|
||||
|
||||
# auto population of default collections
|
||||
collections, assets = SessionHelper.default_collections(user)
|
||||
|
||||
# add session user assets
|
||||
assets = {}
|
||||
assets = user.assets(assets)
|
||||
|
||||
# auto population of default collections
|
||||
collections, assets = SessionHelper.default_collections(user, assets)
|
||||
|
||||
# get models
|
||||
models = SessionHelper.models(user)
|
||||
|
||||
|
@ -91,12 +92,13 @@ class SessionsController < ApplicationController
|
|||
# log device
|
||||
return if !user_device_log(user, 'session')
|
||||
|
||||
# auto population of default collections
|
||||
collections, assets = SessionHelper.default_collections(user)
|
||||
|
||||
# add session user assets
|
||||
assets = {}
|
||||
assets = user.assets(assets)
|
||||
|
||||
# auto population of default collections
|
||||
collections, assets = SessionHelper.default_collections(user, assets)
|
||||
|
||||
# get models
|
||||
models = SessionHelper.models(user)
|
||||
|
||||
|
@ -194,7 +196,7 @@ class SessionsController < ApplicationController
|
|||
return false
|
||||
end
|
||||
|
||||
user = User.lookup( id: params[:id] )
|
||||
user = User.find(params[:id])
|
||||
if !user
|
||||
render(
|
||||
json: {},
|
||||
|
|
|
@ -376,7 +376,7 @@ class TicketsController < ApplicationController
|
|||
user_tickets_closed_ids = []
|
||||
user_ticket_volume_by_year = []
|
||||
if params[:user_id]
|
||||
user = User.find( params[:user_id] )
|
||||
user = User.lookup(id: params[:user_id])
|
||||
condition = {
|
||||
'ticket.state_id' => {
|
||||
operator: 'is',
|
||||
|
|
|
@ -15,7 +15,7 @@ class Chat < ApplicationModel
|
|||
if chat_session.state == 'running'
|
||||
user = nil
|
||||
if chat_session.user_id
|
||||
chat_user = User.find(chat_session.user_id)
|
||||
chat_user = User.lookup(id: chat_session.user_id)
|
||||
url = nil
|
||||
if chat_user.image && chat_user.image != 'none'
|
||||
url = "#{Setting.get('http_type')}://#{Setting.get('fqdn')}/api/v1/users/image/#{chat_user.image}"
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
module SessionHelper
|
||||
def self.default_collections(user)
|
||||
def self.default_collections(user, assets = {})
|
||||
|
||||
# auto population collections, store all here
|
||||
default_collection = {}
|
||||
assets = {}
|
||||
|
||||
# load collections to deliver from external files
|
||||
dir = File.expand_path('../../', __FILE__)
|
||||
|
|
|
@ -6,7 +6,7 @@ class Sessions::Event::ChatSessionClose < Sessions::Event::ChatBase
|
|||
|
||||
realname = 'Anonymous'
|
||||
if @session && @session['id']
|
||||
realname = User.find(@session['id']).fullname
|
||||
realname = User.lookup(id: @session['id']).fullname
|
||||
end
|
||||
|
||||
# check count of participents
|
||||
|
|
|
@ -20,7 +20,7 @@ class Sessions::Event::ChatSessionStart < Sessions::Event::ChatBase
|
|||
chat_session.save
|
||||
|
||||
# send chat_session_init to client
|
||||
chat_user = User.find(chat_session.user_id)
|
||||
chat_user = User.lookup(id: chat_session.user_id)
|
||||
url = nil
|
||||
if chat_user.image && chat_user.image != 'none'
|
||||
url = "#{Setting.get('http_type')}://#{Setting.get('fqdn')}/api/v1/users/image/#{chat_user.image}"
|
||||
|
|
Loading…
Reference in a new issue