ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

Aborted transitions propagate error to Ember.RSVP.on('error',...)

Open olivia opened this issue 9 years ago • 42 comments

As seen in this example, aborted transitions (through redirection or manual abortion) propagates a TransitionAborted error to the RSVP error handler while in 1.x it does not. Was this an intentional change or is the error an erroneous error?

olivia avatar Oct 20 '15 17:10 olivia

@ofbriggs my best guess is that this commit - https://github.com/emberjs/ember.js/commit/94e1035a0eb66cc4d2a6624ff2557a331524f663 about 28 days ago addresses the behavior around TransitionAborted perhaps @chancancode or @rwjblue can answer this question.

pixelhandler avatar Oct 23 '15 16:10 pixelhandler

I doubt that my commit changed that particular behavior, but I personally agree that it seems better not to propagate this to RSVP, although I am not sure what exactly has changed.

I might be looking into something related next week (routes instrumentation), so if no one else have figured it out by then I might uncover why as part of that work.

chancancode avatar Oct 23 '15 16:10 chancancode

It seems like some internals are not handling the rejection, this should be considered a bug.

If the rejection is handled in the same turn, it does not propagate to on('error

stefanpenner avatar Oct 26 '15 15:10 stefanpenner

Any update on this? I experience it in Ember 2.2.0 too.

bkCDL avatar Nov 20 '15 20:11 bkCDL

For now I'm just hardcoding the name of the error as a workaround.

export default function onServerError(cb) {
  Ember.RSVP.on('error', (reason) => {
    // An aborted transition propogates an error to RSVP
    if(reason.name !== 'TransitionAborted') {
      cb(reason);
    }
  });
}

jbryson3 avatar Jan 28 '16 03:01 jbryson3

Any progress on this? We're experiencing this on Ember 2.3 as well.

stianpr avatar Feb 25 '16 13:02 stianpr

+1

remkoboschker avatar Mar 15 '16 13:03 remkoboschker

~~We experienced this same issue with our error tracking platform Sentry and solved it with a workaround seen in this commit. Maybe it helps someone :)~~

Edit: The Repository is no longer public.

stravid avatar Mar 15 '16 14:03 stravid

+1

gertjanwytynck avatar Mar 16 '16 19:03 gertjanwytynck

+1

bugduino avatar Jul 26 '16 10:07 bugduino

+1

jemware avatar Jul 27 '16 17:07 jemware

Thanks @stravid, this is exactly what I needed. Months of this bug and I finally found this thread and your workaround after much Google-fu. 🙇

devinus avatar Aug 06 '16 10:08 devinus

Thanks for the kind words @devinus, I will try to write a little blog post so in the future not so much Google-fu is needed :)

stravid avatar Aug 09 '16 09:08 stravid

Thanks @stravid, but it still not a solution, maybe we can add more args on the error callback to check if the model's request fail.

victor95pc avatar Oct 25 '16 15:10 victor95pc

I just merged a fix in ember-cli-sentry https://github.com/damiencaselli/ember-cli-sentry/pull/67

tchak avatar Feb 28 '17 12:02 tchak

Experienced it in Ember 2.5 (we are in the process to update Ember version). For future reference, I recommend the use of ember-cli-sentry ^.

Before we found the origin of the error we even had to upgrade our sentry subscription due the amount of false alarms...plus one afternoon/evening...

bichotll avatar May 16 '17 10:05 bichotll

I also lose some time to figure out this was a false positive error.

using transitionTo inside redirect is documented in the guide and in the API: https://emberjs.com/api/ember/2.18/classes/Route/methods/redirect?anchor=redirect

Nevertheless it still produces an error: https://ember-twiddle.com/41c21d19e962b4981c967e46228452bb

It would save the time of a lot of emberjs new comers

cbou avatar Jan 29 '18 18:01 cbou

@chancancode or @rwjblue Planning any changes to this behaviour? We are seeing this when we have a guard in a beforeModel() that transitions to a different route. We are still seeing it on Ember 2.16

dtropp avatar Mar 27 '18 07:03 dtropp

@Boubalou @bichotll @binoculars @bkCDL @bugduino @cbou @chancancode @devinus @dschmidt @dtropp @gertjanwytynck @jbryson3 @jemware @olivia @remkoboschker @stefanpenner @stianpr @stravid @tchak @victor95pc is this still an issue, perhaps we should close, what do you think?

pixelhandler avatar Sep 28 '18 18:09 pixelhandler

I barely use Ember nowadays, but I suppose you could try to reproduce it by forking this and updating the Ember version? http://emberjs.jsbin.com/wiruqobiqe/1/edit?output

bichotll avatar Sep 28 '18 18:09 bichotll

Same as @bichotll, I ended up doing backend works lately and not much into Ember anymore. I will let you guys decide whatever is good for this. :)

Boubalou avatar Sep 28 '18 18:09 Boubalou

I do not have the chance to test it

bugduino avatar Sep 30 '18 12:09 bugduino

I stoped using Ember, so I cant confirm it still a issue.

victor95pc avatar Sep 30 '18 14:09 victor95pc

It seems it still an issue : https://ember-twiddle.com/fe0e87339fd079e212d5713f5288ce58

mpirio avatar Oct 23 '18 15:10 mpirio

Yes, it is still an issue (tested with ember-3.5.0).

fpauser avatar Oct 29 '18 12:10 fpauser

Still seeing this in 3.8

saleswhale-vincent avatar May 06 '19 03:05 saleswhale-vincent

Reproduction on 3.10.0: https://github.com/robgarden/ember-transition-aborted-reproduction

robgarden avatar May 22 '19 10:05 robgarden

+1 on 2.18.2

markyky avatar Jul 04 '19 10:07 markyky

For browser errors this seems like it is more of an issue of noise. However, with Fastboot this becomes a bit more difficult, since the throw will stop everything. I haven't been able to find a way to catch that particular error, and I suspect the issue is that the exception is being thrown inside of a promise error handler.

Out of curiosity, what is the value in that particular throw? I'm wondering if it could either be removed, or if the error handler could be moved so that it could be overridden.

thec0keman avatar Jul 10 '19 16:07 thec0keman

@Boubalou @bichotll @binoculars @bkCDL @bugduino @cbou @chancancode @devinus @dschmidt @dtropp @gertjanwytynck @jbryson3 @jemware @olivia @remkoboschker @stefanpenner @stianpr @stravid @tchak @victor95pc is this still an issue, perhaps we should close, what do you think?

@pixelhandler it's still an issue - I can reproduce it on Ember 3.8.3. I think we should consider removing inactive label, especially @robgarden provided repo for reproduction.

lucasm-iRonin avatar Aug 05 '19 05:08 lucasm-iRonin