-
Notifications
You must be signed in to change notification settings - Fork 35
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
✨ Show search results when searching by email: prefix #136
Conversation
Your Render PR Server URL is https://ozone-staging-pr-136.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cpov2bdds78s73a2rsfg. |
Your Render PR Server URL is https://ozone-sandbox-pr-136.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cpov2c5ds78s73a2rso0. |
}) | ||
|
||
await Promise.allSettled( | ||
data.accounts.map(async (account) => { |
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.
This is kinda resource intensive since we're essentially firing like 25 api reqs to getRepo
but this isn't expected to be a commonly used feature so we should be fine with some overhead.
await Promise.allSettled( | ||
data.accounts.map(async (account) => { |
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.
Without handling the result of allSettled()
this will swallow errors, including unexpected ones. Another option is to use Promise.all() here
and handle expected error conditions within each item.
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.
This is intentional, I think we have most info we need to render a partial view from the resultSet so if some requests fail, they will just not show the augmented data from getRepo()
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.
That totally makes sense and I don't think we'd need to change that— my main question is whether we want to swallow all errors versus ignore some acceptable set of errors and log or throw the rest. For example, a logic bug could cause a TypeError
in here and there's no way we'd be able to observe it, could easily go unnoticed.
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.
The rule here might be that we're comfy ignoring all XRPCErrors
, for example. I really appreciate libraries like bounce (though I think this may catered to server-side) which ensure developer/system errors don't get missed when permitting some errors.
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.
Looking good
No description provided.