Async actions are an anti-pattern. While the asynchronous call (here readFileContent() is still in progress, one might navigate away and the component will be destroyed. After the asynchronous call finishes, any later statement trying to access this will then throw an exception.
One solution would be to use an ember-concurrency task instead.
Async actions are an anti-pattern. While the asynchronous call (here `readFileContent()` is still in progress, one might navigate away and the component will be destroyed. After the asynchronous call finishes, any later statement trying to access `this` will then throw an exception.
One solution would be to use an `ember-concurrency` task instead.
raucao
(Migrated from github.com)
reviewed 2023-01-09 03:33:50 +00:00
Thanks! I added a note with a link to your comment for now, since this is kind of an undocumented and hidden feature for someone who knows what they're doing as of now. Mostly just added it so I could easily migrate the existing data, even though it may be useful for other imports in the future. It's basically instant and you wouldn't navigate away while adding a reimbursement, so I think it's OK to leave it as is for now and spend time on more important things.
Thanks! I added a note with a link to your comment for now, since this is kind of an undocumented and hidden feature for someone who knows what they're doing as of now. Mostly just added it so I could easily migrate the existing data, even though it may be useful for other imports in the future. It's basically instant and you wouldn't navigate away while adding a reimbursement, so I think it's OK to leave it as is for now and spend time on more important things.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Looking good. Just left one improvement suggestion.
@@ -89,0 +98,4 @@}} else {console.warn("Expenses in file must be a list of items:");console.debug(content);Async actions are an anti-pattern. While the asynchronous call (here
readFileContent()is still in progress, one might navigate away and the component will be destroyed. After the asynchronous call finishes, any later statement trying to accessthiswill then throw an exception.One solution would be to use an
ember-concurrencytask instead.@@ -89,0 +98,4 @@}} else {console.warn("Expenses in file must be a list of items:");console.debug(content);Thanks! I added a note with a link to your comment for now, since this is kind of an undocumented and hidden feature for someone who knows what they're doing as of now. Mostly just added it so I could easily migrate the existing data, even though it may be useful for other imports in the future. It's basically instant and you wouldn't navigate away while adding a reimbursement, so I think it's OK to leave it as is for now and spend time on more important things.