Hi all,
I recently upgraded my project's Lift dependency to 3.2, and am quite happy with the new Comet Rehydration feature, but I've run into an odd situation and am hoping for some advice.
The scenario is as follows:
My app has three main states; normal operation, needs install, needs update. If either of the two "needs" states are active, there's a redirect to the respective install/update page, both of which have a comet component for triggering and watching the progress of said install/update.
If I have one of the pages in my app open, then I restart the webapp into the "needs update" state, the comet on the page I had open will try to "rehydrate" itself. To my knowledge, the rehydration process involves reloading the current page in an iframe, then stealing the comet logic out of it. But due to the redirect logic, reloading that page instead loads my update page, and I get undesired comet content in a normal page.
My first thought is to add a JS call to the update/install comet, along the lines of `if(currentPage != updatePage) redirectToUpdatePage()`, so that when the normal page's comet rehydrates and gets the updater comet, it'll still be redirected as intended.
But I'm hoping there's a way to deal with this situation that is (or can be) built in to Lift itself. Perhaps some kind of check in the rehydration process to guard against a redirect response? If not a built-in solution, if there are any better ideas that my initial JS-based redirect, I'd be glad to hear them.
Thanks,
~Dylan