-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: Replace Promise.allSettled by RSVP.allSettled #4408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/6z5q6lu07 |
This pull request introduces 2 alerts when merging ff70533 into 366d144 - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging 36b5afc into 366d144 - view on LGTM.com new alerts:
|
app/controllers/public/index.js
Outdated
@@ -2,6 +2,7 @@ import classic from 'ember-classic-decorator'; | |||
import { action, computed } from '@ember/object'; | |||
import Controller from '@ember/controller'; | |||
import { htmlSafe } from '@ember/string'; | |||
import { allSettled } from 'rsvp'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the review says, you imported the function but never used it
app/controllers/public/index.js
Outdated
} catch (error) { | ||
console.error('Error while deleting attendees after order failure', error); | ||
} | ||
await RSVP.allSettled(attendees ? attendees.toArray() : []).then(attendee => attendee.destroyRecord(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no RSVP defined and there is no need to change from try catch to then catch
As you can already see, the build is failing |
Codecov Report
@@ Coverage Diff @@
## development #4408 +/- ##
===============================================
+ Coverage 22.28% 22.57% +0.28%
===============================================
Files 469 468 -1
Lines 4950 4962 +12
Branches 6 6
===============================================
+ Hits 1103 1120 +17
+ Misses 3846 3841 -5
Partials 1 1
Continue to review full report at Codecov.
|
Tried to implement it again, sir. Hope this'd solve the issues. |
@@ -48,7 +48,7 @@ export default Mixin.create(MutableArray, CustomFormMixin, { | |||
async saveEventData(propsToSave = []) { | |||
const { event } = this.model; | |||
const data = {}; | |||
const results = await Promise.allSettled(propsToSave.map(property => { | |||
const results = await RSVP.allSettled(propsToSave.map(property => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return type of RSVP.allSettled is different from Promise.allSettled. Please fix the code accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to get around this, sir. Do review it once. Any specific suggestion or resource to guide me through this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve conflicts and I will test the results
Thank you sir. |
Fixes #4401
Short description of what this resolves:
Attempted to add polyfilled function to the relevant files to enhance compatibility across browsers.
Changes proposed in this pull request:
-Replacing Promise.allSettled() function with RSVP.allSettled() function in the app files.
Checklist
development
branch.