aboutsummaryrefslogtreecommitdiffstats
path: root/l/src/macro.lisp
diff options
context:
space:
mode:
authorTeddy Wing2021-02-08 23:56:36 +0100
committerTeddy Wing2021-02-08 23:56:36 +0100
commitd9ff4ccbd3b42ffee3660c611bc005faec13b90f (patch)
tree209b0f251d385a75ea8248a6862d1fdd1a9ab038 /l/src/macro.lisp
parent0e5b812eaedbf72e76bb041ac7a1fbff769b3f25 (diff)
downloadextreload-d9ff4ccbd3b42ffee3660c611bc005faec13b90f.tar.bz2
Sort of found working reload current tab implementation
Tried using manually-incremented `*reloaded-count*` but that didn't quite work as I didn't have the right conditions to start the reload. Then tried setting up the condition such that we reload when the response comes back from the extension reload message. We can tell this when we get a `result` response that includes a `sessionId` field. To execute the reload a single time, store the most recent session ID, and compare against that. Using conditions on both the reloaded count (which needs to be changed to handle multiple copies of the same extension) and the last session ID in the message contents, we have enough to set up the reload in the tab. Added the `sleep` call back in because otherwise I got this error: reloading NOW Response: (OBJ (id . 2) (result OBJ (sessionId . 106D182E44C641B22EC65E9F6458B245))) #<WAIT-GROUP :counter 2> Response: (OBJ (id . 1) (result OBJ (result OBJ (type . object) (subtype . error) (className . TypeError) (description . TypeError: Cannot read property 'reload' of undefined at <anonymous>:1:16) (objectId . 8548451452974044825.19.1)) (exceptionDetails OBJ (exceptionId . 2) (text . Uncaught) (lineNumber . 0) (columnNumber . 15) (scriptId . 147) (exception OBJ (type . object) (subtype . error) (className . TypeError) (description . TypeError: Cannot read property 'reload' of undefined at <anonymous>:1:16) (objectId . 8548451452974044825.19.2)))) (sessionId . 106D182E44C641B22EC65E9F6458B245)) #<WAIT-GROUP :counter 1> Response: (OBJ (id . 2) (result OBJ (result OBJ (type . object) (subtype . error) (className . TypeError) (description . TypeError: Cannot read property 'reload' of undefined at <anonymous>:1:13) (objectId . 8548451452974044825.19.3)) (exceptionDetails OBJ (exceptionId . 3) (text . Uncaught) (lineNumber . 0) (columnNumber . 12) (scriptId . 156) (exception OBJ (type . object) (subtype . error) (className . TypeError) (description . TypeError: Cannot read property 'reload' of undefined at <anonymous>:1:13) (objectId . 8548451452974044825.19.4)))) (sessionId . 106D182E44C641B22EC65E9F6458B245)) That tells us that the tab reload message was sent to the extension's background page before it had a chance to fully reload. We thus need to wait until the extension is fully reloaded before being able to send the tab reload message. Don't like the sleep call here. Would be nice to have a more robust solution that didn't wait an arbitrary amount of time. Maybe we can keep sending the tab reload message until we get a response that's not an error.
Diffstat (limited to 'l/src/macro.lisp')
0 files changed, 0 insertions, 0 deletions