From 78cce0eb107721e6b3be37788dc08d58f1d69859 Mon Sep 17 00:00:00 2001 From: Markos Gogoulos Date: Thu, 29 Jan 2026 16:01:34 +0200 Subject: [PATCH] wtv --- lti/views.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lti/views.py b/lti/views.py index d0fcea54..34714733 100644 --- a/lti/views.py +++ b/lti/views.py @@ -272,14 +272,18 @@ class LaunchView(View): except LtiException as e: # noqa error_message = str(e) - - # Special handling for "State not found" errors - attempt retry - if "State not found" in error_message or "state not found" in error_message.lower(): - logger.warning("[LTI LAUNCH] State not found error detected, attempting recovery") - return self.handle_state_not_found(request, platform) - - # Other LTI exceptions - fail normally traceback.print_exc() + + # Log state errors but don't retry - retry causes Moodle launch data expiration issues + if "State not found" in error_message or "state not found" in error_message.lower(): + logger.error("[LTI LAUNCH] State not found - this indicates session persistence issues") + error_message = ( + "Session authentication failed. This usually resolves by refreshing the page. " + "If the issue persists, try:\n" + "1. Clearing browser cookies\n" + "2. Disabling browser tracking protection for this site\n" + "3. Using a different browser" + ) except Exception as e: # noqa traceback.print_exc()