machty / ember-concurrency

ember-concurrency is an Ember Addon that enables you to write concise, worry-free, cancelable, restartable, asynchronous tasks.
http://ember-concurrency.com
MIT License
690 stars 157 forks source link

yield never returns or errors #342

Closed adc-mhaugen closed 4 years ago

adc-mhaugen commented 4 years ago

Just updated to Ember 3.15.1, and I have some ember-concurrency code that is not working as before:

    handleAction: task(function* (action, post) {
        const p = this.requestTo(action, post);

        try {
            const response = yield p;
            yield this.handleResponse(action, response);
        } catch (res) {
            error(res);
        }

It works for most requests, but in one case it fails. I can see that p is a promise, and I know that the requestTo method returned the correct payload, but when we yield for it we never get to the next line (handleResponse). We also don't get to the catch, and no errors are thrown. The strange part is that it only fails for a production ember build, it works fine when building for development. I disabled ember-cli-uglify, but we definitely compile for a different set of browsers. I can't think of what would be different, unless maybe it's a babel transpilation issue?

adc-mhaugen commented 4 years ago

Sorry, this is not an issue with ember-concurrency, it's an issue with my bad code. Sorry to bother you.