Skip to content
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

[HOLD for payment 2022-05-20][$250] New room - Not able to create a new room, error message appears #8534

Closed
kavimuru opened this issue Apr 7, 2022 · 27 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kavimuru
Copy link

kavimuru commented Apr 7, 2022

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Log in to any expensifail account
  2. Click on the green plus button in the bottom.
  3. Choose new room
  4. Enter room's name
  5. Choose workspace
  6. Click create room

Expected Result:

New room must be created when I click create room

Actual Result:

New room is not created and I see error message

Workaround:

unknown

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number: 1.1.52-0

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:

https://user-images.githubusercontent.com/43996225/162206860-40cf5b13-0f65-476c-b274-047d6fe1060a.mp4
Bug5523390_issue_0704

Expensify/Expensify Issue URL:

Issue reported by: Applause @thesahindia

Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1648760293684219

View all open jobs on GitHub

@melvin-bot
Copy link

melvin-bot bot commented Apr 7, 2022

Triggered auto assignment to @francoisl (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@francoisl
Copy link
Contributor

Reproducible in production.
The API returns a 200 response for the CreatePolicyRoom call, so it's most likely a front-end issue interpreting the response.

image

@melvin-bot melvin-bot bot removed the Overdue label Apr 11, 2022
@francoisl francoisl removed their assignment Apr 11, 2022
@francoisl francoisl added the External Added to denote the issue can be worked on by a contributor label Apr 11, 2022
@melvin-bot
Copy link

melvin-bot bot commented Apr 11, 2022

Triggered auto assignment to @jliexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@thesahindia
Copy link
Member

I think that the backend must be sending the data in the form of an array earlier which was working just fine -

.then(([{reportID}]) => {

But now, you can see the logged response below (we're getting an object with key : report_SOME-ID)

Screenshot 2022-04-12 at 2 03 21 AM

I think we it should be fixed at the backend, but if for some reason we can't then I propose this fix -
We can make a variable for reportID and we just need to set the value after line 1523 (or we can just extract the key from the Object & use it)

App/src/libs/actions/Report.js

Lines 1518 to 1525 in 0596be5

return API.CreatePolicyRoom({policyID, reportName, visibility})
.then((response) => {
if (response.jsonCode !== 200) {
Growl.error(response.message);
return;
}
return fetchChatReportsByIDs([response.reportID]);
})

 Onyx.set(ONYXKEYS.IS_LOADING_CREATE_POLICY_ROOM, true);
+    let reportID;
    return API.CreatePolicyRoom({policyID, reportName, visibility})
        .then((response) => {
            if (response.jsonCode !== 200) {
                Growl.error(response.message);
                return;
            }
+            reportID = response.reportID;
            return fetchChatReportsByIDs([response.reportID]);
        })
        .then(() => {
            if (!reportID) {
                Log.error('Unable to grab policy room after creation', reportID);
                return;
            }

@jliexpensify
Copy link
Contributor

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Apr 12, 2022
@melvin-bot
Copy link

melvin-bot bot commented Apr 12, 2022

Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (Exported)

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 12, 2022
@melvin-bot
Copy link

melvin-bot bot commented Apr 12, 2022

Triggered auto assignment to @AndrewGable (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot changed the title New room - Not able to create a new room, error message appears [$250] New room - Not able to create a new room, error message appears Apr 12, 2022
@rushatgabhane
Copy link
Member

@thesahindia you found the cause. But I think we should fix it here by correctly accessing the reportID

.then(([{reportID}]) => {

Thoughts?

@rushatgabhane
Copy link
Member

bump ^^ @thesahindia

@thesahindia
Copy link
Member

@thesahindia you found the cause. But I think we should fix it here by correctly accessing the reportID

The object key keeps changing( reportID is not the key but the "report_" + value of reportID is ) so to do that we need to extract the key or the simple way would be to just use the reportID that we get in response here

App/src/libs/actions/Report.js

Lines 1518 to 1525 in 0596be5

return API.CreatePolicyRoom({policyID, reportName, visibility})
.then((response) => {
if (response.jsonCode !== 200) {
Growl.error(response.message);
return;
}
return fetchChatReportsByIDs([response.reportID]);
})

I had mentioned this here #8534 (comment)

@aneequeahmad
Copy link
Contributor

PROPOSAL

We can extract the key from the response as below

        .then((response) => {
          const reportID = Object.values(response).map(({ reportID }) => reportID)[0]
            if (!reportID) {
                Log.error('Unable to grab policy room after creation', reportID);
                return;
            }
            

Instead of .then(([{reportID}]) => {

@rushatgabhane
Copy link
Member

New contributors are limited to working on one job at a time, however experienced contributors may work on numerous jobs simultaneously. see contributing.md

@aneequeahmad since you're a new contributor, you're limited to only one job at a time. So I'd suggest that you complete the PR Expensify/expensify-common#441 as soon as possible. After which, you may work on multiple jobs. Thanks!

@rushatgabhane
Copy link
Member

@thesahindia I'm sure we can figure something out using underscore.js. Please let me know when you submit an updated proposal, thanks!

@thesahindia
Copy link
Member

Updated Proposal

We can use _.values to access the object

        .then((response) => {
            const {reportID} = _.values(response)[0];

@rushatgabhane
Copy link
Member

rushatgabhane commented Apr 20, 2022

@AndrewGable I like @thesahindia's proposal. Changes will be made over here -

App/src/libs/actions/Report.js

Lines 1526 to 1527 in 0596be5

.then(([{reportID}]) => {
if (!reportID) {

🎀 👀 🎀 C+ reviewed

@rushatgabhane
Copy link
Member

rushatgabhane commented Apr 20, 2022

@thesahindia a suggestion when posting an updated proposal -

  • Please make sure it contains all the context. So there isn't a need to read the entire thread.

I hope this makes sense, thanks!

@melvin-bot
Copy link

melvin-bot bot commented Apr 20, 2022

📣 @thesahindia You have been assigned to this job by @AndrewGable!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 20, 2022
@AndrewGable
Copy link
Contributor

Looking forward to the PR 👍

@thesahindia
Copy link
Member

PR is up.
cc: @AndrewGable, @rushatgabhane

@melvin-bot melvin-bot bot added the Overdue label Apr 29, 2022
@jliexpensify
Copy link
Contributor

Not overdue Melv!

@melvin-bot melvin-bot bot removed the Overdue label May 2, 2022
@melvin-bot melvin-bot bot added the Overdue label May 10, 2022
@jliexpensify
Copy link
Contributor

Not overdue Melvin

@melvin-bot melvin-bot bot removed the Overdue label May 13, 2022
@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@mallenexpensify mallenexpensify changed the title [$250] New room - Not able to create a new room, error message appears [HOLD for payment 2022-05-20][$250] New room - Not able to create a new room, error message appears May 20, 2022
@mallenexpensify mallenexpensify added the Awaiting Payment Auto-added when associated PR is deployed to production label May 20, 2022
@jliexpensify
Copy link
Contributor

Previous created job was closed, so re-created: https://www.upwork.com/ab/applicants/1528581043536789504/job-details

@rushatgabhane and @thesahindia - have re-invited you. Thanks!

@jliexpensify
Copy link
Contributor

Paid @rushatgabhane , will pay $500 to @thesahindia once he accepts. Cheers!

@mvtglobally
Copy link

Issue not reproducible during KI retests. (Second week)

@thesahindia
Copy link
Member

Accepted the offer, good to go 🚀

@jliexpensify
Copy link
Contributor

jliexpensify commented May 24, 2022

Paid @thesahindia and closing this GH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants