Noticed while attempting to integrate into mapeo mobile, but when our message timeout expires, it cancels the Piscina task and attempts to delete the style if the worker never sent its first message to main thread. However, upon cancellation, the Piscina task also attempts to delete the style. This causes an undesirable unhandled error.
Now we defer the style deletion to the cancelled Piscina task and remove that logic from the message timeout handler (or maybe it should it be the other way around?). Ideally a test would be added simulating the worker timeout, but not entirely sure how to create that situation via a test, so left a comment for now.
Noticed while attempting to integrate into mapeo mobile, but when our message timeout expires, it cancels the Piscina task and attempts to delete the style if the worker never sent its first message to main thread. However, upon cancellation, the Piscina task also attempts to delete the style. This causes an undesirable unhandled error.
Now we defer the style deletion to the cancelled Piscina task and remove that logic from the message timeout handler (or maybe it should it be the other way around?). Ideally a test would be added simulating the worker timeout, but not entirely sure how to create that situation via a test, so left a comment for now.