SidewalkWebpage icon indicating copy to clipboard operation
SidewalkWebpage copied to clipboard

Explore post request on page unload sometimes failing

Open misaugstad opened this issue 2 years ago • 1 comments

Brief description of problem/feature

@justyeethan sent me some screenshots and error messages. It seems like the page unload POST request isn't working on their local dev environment. We tried to get this to work back in the day in PR #1740. It sounds like it's not working all the time though.

Here's what the error message looks like. The gist is that the request.identity object is giving us None instead of the user. But he said that over the normal course of auditing, this isn't an issue. It's only causing a problem on page unload.

! @82a3m9ab3 - Internal server error, for (POST) [/taskBeacon] ->

play.api.Application$$anon$1: Execution exception[[NoSuchElementException: None.get]]
	at play.api.Application$class.handleError(Application.scala:296) ~[play_2.10-2.3.10.jar:2.3.10]
	at play.api.DefaultApplication.handleError(Application.scala:402) [play_2.10-2.3.10.jar:2.3.10]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.10-2.3.10.jar:2.3.10]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.10-2.3.10.jar:2.3.10]
	at scala.Option.map(Option.scala:145) [scala-library-2.10.7.jar:na]
Caused by: java.util.NoSuchElementException: None.get
	at scala.None$.get(Option.scala:313) ~[scala-library-2.10.7.jar:na]
	at scala.None$.get(Option.scala:311) ~[scala-library-2.10.7.jar:na]
	at controllers.TaskController.updateMissionTable(TaskController.scala:145) ~[classes/:na]
	at controllers.TaskController$$anonfun$9.apply(TaskController.scala:268) ~[classes/:na]
	at controllers.TaskController$$anonfun$9.apply(TaskController.scala:219) ~[classes/:na]

In his specific situation it was happening when choosing to switch over to the Validate page from the mission complete map.

@justyeethan can you post your OS, browser, and version of each? Can you also check if this happens if you click a link to go to a different page from anywhere else in the mission? What if you click on a link in the navbar instead of the button on the mission complete screen, but it's when you would have clicked on the button on the mission complete screen?

We should try to narrow down when this happens! And we should check if it happens on the Validate page as well, since we are doing the same thing there.

misaugstad avatar Jul 21 '23 22:07 misaugstad

@1kechen start by seeing if you can reproduce the issue!

misaugstad avatar Aug 13 '23 18:08 misaugstad