Just curios. Are you running inertiajs by any chance? It is known for throwing 409 (with good reason)
What is a 409 error and how can I fix it?
I get this error on two requests, one is for getting notifications and the other is for filtering data. When I get this error the whole page reloads which can be a problem since I run the get notification route every minute.
These are the methods where the error happens
public function getNotifications()
{
$user = auth()->user();
return back()->with('notifications', $user->unreadNotifications);
}
//this method calls to 2 other methods as well but this is the return
public function filter(Request $request)
{
ini_set('max_execution_time', 180);
$filtered = $this->search($request);
if (empty($filtered)) {
return back()->with('info', 'No hay resultados!');
}
$items[] = $filtered;
return back()->with('success', $items);
}
These are the routes
Route::get('getNotifications', 'DashController@getNotifications');
Route::post('result/filter', 'ResultController@filter');
This error only happens some times so it's not even consistent, I have no idea what it could be and how I can fix it so that it doesn't keep reloading the website.
How can I do that?
That had me confused as well. It comes from how inertia handles version. If the version changes, it forces a 403 response instead of 200. This will force the browser to make a full reload. This is handy when you update your app and the users don't refresh. That means that their frontend code is out of date (remember that you are running a single page app). Hope that makes sense
Oh and you shouldn't fix it. It works as expected
Please or to participate in this conversation.