Skip to content

Tweaks for bulk group creation flow and better error handling#1722

Merged
jmgasper merged 1 commit intodevelopfrom
bulk-group
Feb 2, 2026
Merged

Tweaks for bulk group creation flow and better error handling#1722
jmgasper merged 1 commit intodevelopfrom
bulk-group

Conversation

@jmgasper
Copy link
Collaborator

@jmgasper jmgasper commented Feb 2, 2026

No description provided.

@jmgasper jmgasper merged commit 2d4712a into develop Feb 2, 2026
4 checks passed
@@ -1,3 +1,4 @@
import _ from 'lodash'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ performance]
The use of lodash for deep property access (e.g., _.get) is convenient, but consider if it's necessary to import the entire library for this functionality. If lodash is not extensively used elsewhere, it might be more efficient to use optional chaining and nullish coalescing operators available in modern JavaScript.

return validationResults
} catch (error) {
const errorDetails = (error && (error.message || error.toString())) || 'Unknown error'
const errorDetails = getApiErrorMessage(error, 'Unable to validate members.')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
The getApiErrorMessage function is used to extract error details, which is a good practice for consistent error handling. However, ensure that this function is thoroughly tested, especially with various error object structures, to avoid unexpected behavior in production.

return createdGroup
} catch (error) {
const errorDetails = (error && (error.message || error.toString())) || 'Unknown error'
const errorDetails = getApiErrorMessage(error, 'Unable to create group.')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Similar to the bulkSearchMembers function, ensure that the getApiErrorMessage function is robust against different error object structures to prevent misleading error messages from being displayed to the user.

})

this.props.bulkSearchUsers(parsedHandlesEmails)
this.props.bulkSearchUsers(parsedHandlesEmails).catch(() => null)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
Swallowing errors by using .catch(() => null) can make debugging difficult and might hide issues that need attention. Consider logging the error or handling it in a way that provides more visibility into what went wrong.

selfRegister,
privateGroup
)
).catch(() => null)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
Using .catch(() => null) to ignore errors can lead to silent failures. It's advisable to at least log the error or handle it in a way that allows for easier debugging and maintenance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant