toconnell / kdm-manager

An interactive campaign manager for the game "Monster", by Kingdom Death. Development blog and release notes at https://blog.kdm-manager.com This project has no affiliation with Kingdom Death and is a totally independent, fan-maintained project.
http://kdm-manager.com
Other
26 stars 11 forks source link

Server Explosion #568

Closed darthdoctor347 closed 3 years ago

darthdoctor347 commented 3 years ago
Screen Shot 2021-02-20 at 10 23 53 AM
toconnell commented 3 years ago

Nothing showed up in the production webapp logs for the legacy webapp (another reason why it needs to die...) so I cloned the user down to dev and cannot seem to recreate the issue (for now).

Ultimately, this part of the legacy app is going away when we migrate to the v4 app, but this makes me feel like it should be killed off specifically.

At this point, this ticket is either to a.) fix this problem or b.) kill off this feature of the legacy webapp (which is pointless now that we don't manage sessions that way anymore).

toconnell commented 3 years ago

I made the Solomonic decision to just cut the baby in half and treat all "sessions" in the legacy webapp as non-admin ones and just blow the session away if we have a render failure:

index 08d0d4f..29908fd 100644
--- a/v3/session.py
+++ b/v3/session.py
@@ -55,12 +55,8 @@ def current_view_failure(func):
             tb = traceback.format_exc().replace("    ","&ensp;").replace("\n","<br/>")
             print html.meta.error_500.safe_substitute(msg=err_msg, exception=tb)

-            if not self.User.is_admin():
-                self.logger.warn("[%s] user is not an application admin. Ending session!" % (self.User))
-                self.log_out()
-                self.email_render_error(traceback=tb)
-            else:
-                self.logger.warn("[%s] user is an application admin. Preserving session." % self.User)
+            self.log_out()
+            self.email_render_error(traceback=tb)

             sys.exit(255)

@@ -80,11 +76,9 @@ def process_params_failure(func):
             tb = traceback.format_exc().replace("    ","&ensp;").replace("\n","<br/>")
             print html.meta.error_500.safe_substitute(msg=err_msg, exception=tb, params=str(self.params))

-            if not self.User.is_admin():
-                self.log_out()
-                self.email_render_error(traceback=tb)
-            else:
-                self.logger.warn("[%s] user is an application admin. Preserving session." % self.User)
+            self.log_out()
+            self.email_render_error(traceback=tb)
+
             sys.exit(255)

     return wrapper

This is resolved in the next production release of the Manager.