Skip to content

Commit

Permalink
Merge branch 'master' of github.com:freescout-helpdesk/freescout into…
Browse files Browse the repository at this point in the history
… dist
  • Loading branch information
freescout-help-desk committed Nov 30, 2024
2 parents bfbfeb2 + 3562298 commit b564d20
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 31 deletions.
2 changes: 1 addition & 1 deletion app/Console/Commands/FetchEmails.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public function fetch($mailbox)
$last_error = $client->getLastError();
}
} catch (\Exception $e) {
$last_error = $e->getMessage();
$last_error = $e->getMessage().'; File: '.$e->getFile().' ('.$e->getLine().')'.')';
}

if ($last_error && stristr($last_error, 'The specified charset is not supported')) {
Expand Down
4 changes: 3 additions & 1 deletion app/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ public function isIndirect()
public function updateCounters()
{
if (config('app.update_folder_counters_in_background')) {
\App\Jobs\UpdateFolderCounters::dispatch($this);
if(!\Illuminate\Support\Facades\Cache::has("folder_update_lock_{$this->id}")) {
\App\Jobs\UpdateFolderCounters::dispatch($this);
}
} else {
$this->updateCountersNow();
}
Expand Down
38 changes: 21 additions & 17 deletions app/Jobs/UpdateFolderCounters.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

namespace App\Jobs;

use App\Conversation;
use App\ConversationFolder;
use App\Folder;
use Illuminate\Support\Facades\Cache;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
Expand All @@ -15,28 +14,33 @@ class UpdateFolderCounters implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

/**
* @var Folder
*/
private $folder;

/**
* Create a new job instance.
*
* @return void
*/
// Cache lock key
private $lockKey;

public function __construct(Folder $folder)
{
$this->folder = $folder;
$this->lockKey = "folder_update_lock_{$folder->id}";
}

/**
* Execute the job.
*
* @return void
*/
public function handle()
{
$this->folder->updateCountersNow();
// Check if another job is processing this folder
if (Cache::has($this->lockKey)) {
return; // Exit if already processing
}

// Set lock with a timeout of 5 minutes (adjust as needed)
Cache::put($this->lockKey, true, now()->addMinutes(5));

try {
// Perform the folder update logic
$this->folder->updateCountersNow();
} finally {
// Release the lock after processing
Cache::forget($this->lockKey);
}
}
}
}
4 changes: 2 additions & 2 deletions app/Misc/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,8 @@ public static function isAutoResponder($headers_str)
'x-autoresponder' => '',
'auto-submitted' => '', // this can be auto-replied, auto-generated, etc.
'delivered-to' => ['autoresponder'],
'precedence' => ['auto_reply', 'bulk', 'junk'],
'x-precedence' => ['auto_reply', 'bulk', 'junk'],
'precedence' => ['auto_reply', 'bulk', 'junk', 'list'],
'x-precedence' => ['auto_reply', 'bulk', 'junk', 'list'],
];
$headers = explode("\n", $headers_str ?? '');

Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
| or any other location as required by the application or its packages.
*/

'version' => '1.8.158',
'version' => '1.8.159',

/*
|--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion overrides/nesbot/carbon/src/Carbon/Carbon.php
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ public static function createFromFormat($format, $time, $tz = null)
/**
* Set last errors.
*
* @param array $lastErrors
* @param array|bool $lastErrors
*
* @return void
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ public function fetch($items, $from, $to = null, $uid = IMAP::ST_UID) {
if (count($items) == 1) {
if ($tokens[2][0] == $items[0]) {
$data = $tokens[2][1];
} elseif ($uid && $tokens[2][2] == $items[0]) {
} elseif ($uid === IMAP::ST_UID && isset($tokens[2][2]) && $tokens[2][2] == $items[0]) {
$data = $tokens[2][3];
} else {
$expectedResponse = 0;
Expand Down
8 changes: 5 additions & 3 deletions public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1007,10 +1007,12 @@ a h4 {
This is needed to avoid an issue with the SPAN tag being added
https://github.com/freescout-help-desk/freescout/issues/4354
*/
.note-editor .note-editable * {
background-color: inherit;
.note-editor .note-editable span,
.note-editor .note-editable div {
/*background-color: inherit;*/
font-size: inherit;
font-weight: inherit;
/* https://github.com/freescout-help-desk/freescout/issues/4367 */
/*font-weight: inherit;*/
}
.note-editor.note-frame {
border-color: #dee4e9 !important;
Expand Down
4 changes: 2 additions & 2 deletions resources/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@
"User's Name": "Nombre del usuario",
"Username": "Nombre de usuario",
"Users": "Usuarios",
"Users are allowed to delete conversations": "Los usuarios no tienen permitido borrar conversaciónes",
"Users are allowed to delete conversations": "Los usuarios tienen permitido borrar conversaciónes",
"Users are allowed to edit notes\/replies": "Los usuarios tienen permiso para editar notas\/respuestas",
"Users are allowed to edit\/delete saved replies": "Los usuarios tienen permiso para editar\/borrar respuestas guardadas",
"Users are allowed to manage custom folders": "Los usuarios pueden administrar carpetas personalizadas",
Expand Down Expand Up @@ -803,4 +803,4 @@
"via": "vía",
"you": "",
"yourself": "tú mismo"
}
}
4 changes: 2 additions & 2 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
{!! \Helper::cspMetaTag() !!}

<title>@if ($__env->yieldContent('title_full'))@yield('title_full') @elseif ($__env->yieldContent('title'))@yield('title') - {{ config('app.name', 'FreeScout') }} @else{{ config('app.name', 'FreeScout') }}@endif</title>
@php $app_name = \Eventy::filter('layout.title.name', config('app.name', 'FreeScout')); @endphp
<title>@if ($__env->yieldContent('title_full'))@yield('title_full') @elseif ($__env->yieldContent('title'))@yield('title') - {{ $app_name }} @else{{ $app_name }}@endif</title>

<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('apple-touch-icon.png') }}">
<link rel="shortcut icon" type="image/x-icon" href="@filter('layout.favicon', URL::asset('favicon.ico'))">
Expand Down
10 changes: 10 additions & 0 deletions tools/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,16 @@ fi


printf "\nClearing cache:\n"

# First clear cache manually to avoid such issues:
# https://github.com/freescout-help-desk/freescout/issues/4366
rm -f $PROJECT_ROOT/bootstrap/cache/config.php
rm -rf $PROJECT_ROOT/storage/framework/cache/data/*
rm -f $PROJECT_ROOT/storage/framework/views/*
rm -f $PROJECT_ROOT/storage/framework/sessions/*
rm -f $PROJECT_ROOT/public/js/builds/*
rm -f $PROJECT_ROOT/public/css/builds/*

php artisan freescout:clear-cache
#php artisan package:discover

Expand Down

0 comments on commit b564d20

Please sign in to comment.