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 2023-06-05] [$1000] Assign task- 404 error in the console appears when create a task #19134

Closed
1 of 6 tasks
mvtglobally opened this issue May 17, 2023 · 48 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@mvtglobally
Copy link

mvtglobally commented May 17, 2023

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:

  1. Go to URL https://staging.new.expensify.com/
  2. Login
  3. Go to any #announce
  4. Create a task

Expected Result:

No errors in console

Actual Result:

404 error in the console appears

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.15-4
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Bug6058823_Untitled

Bug6058823_Recording__608.mp4

Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012e1b763b4e7b70a1
  • Upwork Job ID: 1658927033624666112
  • Last Price Increase: 2023-05-19
@mvtglobally mvtglobally added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 17, 2023

Triggered auto assignment to @conorpendergrast (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented May 17, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@conorpendergrast
Copy link
Contributor

Yep, reproduced!

image

@conorpendergrast
Copy link
Contributor

@thienlnam I think this should be over to you! I'll label it Internal to get the ball rolling, and will also then assign you too

@conorpendergrast conorpendergrast added the Internal Requires API changes or must be handled by Expensify staff label May 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 17, 2023

Job added to Upwork: https://www.upwork.com/jobs/~012e1b763b4e7b70a1

@conorpendergrast
Copy link
Contributor

If I'm wrong, let me know!

@melvin-bot
Copy link

melvin-bot bot commented May 17, 2023

Triggered auto assignment to Contributor Plus for review of internal employee PR - @thesahindia (Internal)

@thienlnam
Copy link
Contributor

The error is with AuthenticatePusher, not sure why that is showing up. The EditTask command should now be on production and so that error shouldn't be happening anymore

@thienlnam
Copy link
Contributor

I think we can have this external for someone to investigate

@thienlnam thienlnam added External Added to denote the issue can be worked on by a contributor and removed Internal Requires API changes or must be handled by Expensify staff labels May 19, 2023
@melvin-bot melvin-bot bot changed the title Assign task- 404 error in the console appears when create a task [$1000] Assign task- 404 error in the console appears when create a task May 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 19, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 19, 2023

Current assignee @thesahindia is eligible for the External assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 19, 2023

Current assignee @thienlnam is eligible for the External assigner, not assigning anyone new.

@phuchoang23
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Assign task- 404 error in the console appears when create a task

What is the root cause of that problem?

404 error is come from this API to authorize Pusher when our App need to subscribe to a socket channel.
Screenshot 2023-05-20 at 16 03 44

I suspect the API to create Task (+ report) is not finished yet, then we navigate to taskReport in this line
The ReportScreen will load and it triggers this line to subscribe to private socket channels of the report

if (!this.didSubscribeToReportTypingEvents && didCreateReportSuccessfully) {
Report.subscribeToReportTypingEvents(this.props.report.reportID);
this.didSubscribeToReportTypingEvents = true;
}

=> Can cause 404 error because the create Task API is not finished yet (report is not created yet)

Screenshots when navigate to a newly chatReport and a newly taskReport
  • newly taskReport
Screenshot 2023-05-20 at 14 19 10
  • newly chatReport
Screenshot 2023-05-20 at 16 20 20

What changes do you think we should make in order to solve the problem?

To solve this problem we need to ensure the taskReport is created successfully before subscribe to its private channels

More details:
We need to follow this condition:

// Ensures subscription event succeeds when the report/workspace room is created optimistically.
// Check if the optimistic `OpenReport` or `AddWorkspaceRoom` has succeeded by confirming
// any `pendingFields.createChat` or `pendingFields.addWorkspaceRoom` fields are set to null.
// Existing reports created will have empty fields for `pendingFields`.
const didCreateReportSuccessfully = !this.props.report.pendingFields || (!this.props.report.pendingFields.addWorkspaceRoom && !this.props.report.pendingFields.createChat);

That means when build optimisticTaskReport data, we need to add pendingFields.createChat with CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD (and isOptimisticReport: true so it won't trigger OpenReport API when it's not ready).

                pendingFields: {
                    createChat: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
                },
                isOptimisticReport: true,

And reset those fields in successData.

We used this trick in some other places:

Result:
Screenshot 2023-05-20 at 16 10 17

@conorpendergrast
Copy link
Contributor

Unassigning @laurenreidexpensify as I'm already assigned as BugZero

@thesahindia
Copy link
Member

I don't think I will be able to review this today. I have too much on my plate at the moment. @conorpendergrast, can you please reassign?

@conorpendergrast
Copy link
Contributor

Asked in Slack

@phuchoang23
Copy link
Contributor

phuchoang23 commented May 25, 2023

@aimane-chnaif @thienlnam bump for code review

@conorpendergrast
Copy link
Contributor

PR reviewed and on Staging

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 29, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Assign task- 404 error in the console appears when create a task [HOLD for payment 2023-06-05] [$1000] Assign task- 404 error in the console appears when create a task May 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 29, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 29, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.19-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-06-05. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter - N/A, Applause
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented May 29, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@aimane-chnaif] The PR that introduced the bug has been identified. Link to the PR:
  • [@aimane-chnaif] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@aimane-chnaif] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@aimane-chnaif] Determine if we should create a regression test for this bug.
  • [@aimane-chnaif] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@conorpendergrast] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 5, 2023
@conorpendergrast
Copy link
Contributor

Argh, Upwork isn't letting me hire on the existing job. I'll have to create new ones - tomorrow!

@conorpendergrast
Copy link
Contributor

Looks like this was merged in less than 3 business days, so adding a 50% urgency bonus for C and C+

@conorpendergrast
Copy link
Contributor

@aimane-chnaif contract sent via Upwork
@phuchoang23 Can you reply here with your Upwork profile URL please?

@phuchoang23
Copy link
Contributor

@phuchoang23
Copy link
Contributor

@conorpendergrast Did you send contract to me via Upwork?

@conorpendergrast
Copy link
Contributor

I will shortly send the contract, yes!

@conorpendergrast
Copy link
Contributor

@aimane-chnaif paid
@phuchoang23 contract sent!

@phuchoang23
Copy link
Contributor

@conorpendergrast I accepted the offer

@conorpendergrast
Copy link
Contributor

@phuchoang23 Paid!

@conorpendergrast
Copy link
Contributor

Alright, just the BugZero checklist here

@phuchoang23
Copy link
Contributor

@conorpendergrast Thanks 👍

@conorpendergrast
Copy link
Contributor

@aimane-chnaif Bump on the BugZero checklist here please!

@aimane-chnaif
Copy link
Contributor

aimane-chnaif commented Jun 9, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

This bug was introduced while implementing new feature of create task.
This should have been caught earlier in PR review if they tested offline case.
As offline test is already in PR checklist, no further regression test step is needed.

@melvin-bot melvin-bot bot added the Overdue label Jun 12, 2023
@conorpendergrast
Copy link
Contributor

Got it. Sounds like we're all done. Closing, thanks all!

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 Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants