-
Notifications
You must be signed in to change notification settings - Fork 3k
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
"A room with this name already exists" message appears on Create New Room page #14010
Comments
Triggered auto assignment to @NicMendonca ( |
Job added to Upwork: https://www.upwork.com/jobs/~01226a954977211217 |
Triggered auto assignment to Contributor Plus for review of internal employee PR - @thesahindia ( |
I can take a look at this one. |
@yuwenmemon I have found root case of this issue during testing. If you want I can post here. I'm asking bcz this issue is Internal and not allowed for external contributors. |
App/src/libs/ValidationUtils.js Lines 386 to 391 in dee9ac5
undefined === undefined is the root cause.I think we should add some more filters like this: return _.some(
reports,
- report => report && report.policyID === policyID
- && report.reportName === roomName,
+ report => report && !_.isEmpty(report.policyID) && report.policyID === policyID
+ && !_.isEmpty(report.reportName) && report.reportName === roomName,
); |
What I have found is we have added ReportFooter with loading state view. /src/pages/home/ReportScreen.js
We are not passing report in this case. Due to report not exist ReportFooter will use default prop and it will pass down to ReportActionCompose
On component mount inside ReportActionCompose updateComponent function will trigger and it will call Now in this case new incorrect report record will created with report_0: { hasDraft: false } It will impact condition of check room name already exist or not
app has incorrect report record report_0: { hasDraft: false } so it will check report exist true, |
I think we should add validation as @0xmiroslav stated , we also have change this block to App/src/pages/workspace/WorkspaceNewRoomPage.js Lines 84 to 92 in dee9ac5
// We error if the user doesn't enter a room name or left blank
+ // We error if the room name already exists.
if (!values.roomName || values.roomName === CONST.POLICY.ROOM_PREFIX) {
errors.roomName = this.props.translate('newRoomPage.pleaseEnterRoomName');
- }
-
- // We error if the room name already exists.
- if (ValidationUtils.isExistingRoomName(values.roomName, this.props.reports, values.policyID)) {
+ } else if (ValidationUtils.isExistingRoomName(values.roomName, this.props.reports, values.policyID)) {
errors.roomName = this.props.translate('newRoomPage.roomAlreadyExistsError');
}
and for validation here I think this is enough function isExistingRoomName(roomName, reports, policyID) {
- return _.some(
+ return roomName && _.some(
reports,
report => report && report.policyID === policyID
&& report.reportName === roomName, |
Is this issue open for external? @yuwenmemon |
Changes + if (values.policyID && ValidationUtils.isExistingRoomName(values.roomName, this.props.reports, values.policyID)) {
errors.roomName = this.props.translate('newRoomPage.roomAlreadyExistsError');
} Result Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2023-01-05.at.17.08.44.mp4 |
This was fixed with: #13994 Also yes FYI @dhairyasenjaliya @fedirjh @0xmiroslav @jatinsonijs I appreciate the input but do please understand that this issue was tagged Internal and not marked either External or Help Wanted. |
@yuwenmemon though this is internal, I think I am eligible for reporting compensation |
I believe that's correct @0xmiroslav but I will defer to @NicMendonca on that point. |
@yuwenmemon I think this has not been fixed yet , now with this #13994 It will always skip the first validation , I still think that validation to same input field should go through an
I think we can also add this rule to FORMS docs. |
@fedirjh that's a good observation. I'll make that change, and we can work with @NicMendonca to ensure you get a bug reporting bonus. |
@NicMendonca Thank you, accepted! |
@fedirjh paid the reporting bonus - thanks! |
@NicMendonca I am also eligible for reporting bonus here |
@NicMendonca @0xmiroslav is correct 👍 |
@0xmiroslav can you please accept the job offer? |
accepted. thank you |
@NicMendonca FYI: you hired me for $1000 but I am eligible for only $250 |
Ah, Thank you, I've created a new milestone 😄 Paid for $250 |
bonuses have both been paid ✅ |
Hey @NicMendonca, C+ review compensation is due (sorry for the late comment). |
Bump @NicMendonca |
@thesahindia can you accept the job offer, please? |
@thesahindia paid! |
I think this can be closed now? |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
Error message should be consistent as "Please enter a room name"
Actual Result:
"A room with this name already exists" error shows first time
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
**Version Number:**v1.2.48-2
Reproducible in staging?: y
Reproducible in production?: y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
209856169-65c49370-e10c-4b86-9500-af45593cd55d.mov
Recording.1214.mp4
Expensify/Expensify Issue URL:
Issue reported by: @0xmiroslav
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1672852094448169
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: