The app and browser are running normally. As a matter of fact, I was able to refresh the page with new content by manually refreshing the browser. So why would a UIDetachedException get thrown if the session is still active?
public class WodView extends VerticalLayout implements AfterNavigationObserver {
private UI ui;
@Override
protected void onAttach(AttachEvent attachEvent) {
ui = attachEvent.getUI();
}
public void refresh(ZonedDateTime zonedDateTime) {
try {
ui.access(() -> {
ui.getSession().lock();
init(zonedDateTime);
ui.getSession().unlock();
ui.push();
});
} catch (UIDetachedException e) {
System.out.println("UI is detached");
}
}