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-10-30] [$500] API - 404 Returns On AuthenticatePusher API #29116

Closed
1 of 6 tasks
m-natarajan opened this issue Oct 9, 2023 · 41 comments
Closed
1 of 6 tasks
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

@m-natarajan
Copy link

m-natarajan commented Oct 9, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.3.79-3
Reproducible in staging?: Yes
Reproducible in production?: Yes
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
Expensify/Expensify Issue URL:
Issue reported by: @ufumerfarooq
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696624674221279

Action Performed:

  1. Open ND App
  2. Login
  3. Open Developer Tools -> Navigate to Network Tab
  4. Observe Results (There is 404 error on ?AuthenticatePusher api and on carefully observing the request base url, it's "https://staging.expensify.com/" not "https://staging.new.expensify.com/")
  5. Go to Console tab and observer results (There is related CORS error for this)

Expected Result:

200 OK response should be received

Actual Result:

404 NOT FOUND received

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
404_authenticate_pusher.mov
404.error.mp4
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01eb77836e6080236f
  • Upwork Job ID: 1711452980972335104
  • Last Price Increase: 2023-10-09
  • Automatic offers:
    • fedirjh | Reviewer | 27184951
@m-natarajan m-natarajan added the External Added to denote the issue can be worked on by a contributor label Oct 9, 2023
@melvin-bot melvin-bot bot changed the title API - 404 Returns On AuthenticatePusher API [$500] API - 404 Returns On AuthenticatePusher API Oct 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01eb77836e6080236f

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

melvin-bot bot commented Oct 9, 2023

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Oct 9, 2023
@shaan147
Copy link

shaan147 commented Oct 9, 2023

How do i run the app on windows? Or is it only for Mac?

@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

📣 @shaan147! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@shaan147
Copy link

shaan147 commented Oct 9, 2023

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01ca8ad8ce36b9eceb

@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

⚠️ Unable to store contributor details cc @thienlnam

@shaan147
Copy link

shaan147 commented Oct 9, 2023

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01ca8ad8ce36b9eceb

@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

⚠️ Invalid email. Please make sure to create an Expensify account with this email first here.

@ufumerfarooq
Copy link

@shaan147 this is producing on web. You can visit staging.new.expensify.com to reproduce

@phoenixxbasit
Copy link

I was able to reproduce the issue but if I reload the same page again the same url endpoint is showing 200 Status.

@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

📣 @phoenixxbasit! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@phoenixxbasit
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01cc75563fcc963ca8

@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@5war00p
Copy link
Contributor

5war00p commented Oct 9, 2023

Proposal

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

API - 404 Returns On AuthenticatePusher API

What is the root cause of that problem?

We have two events which we are subscribing for pusher.

  1. subscribeToReportTypingEvents
  2. subscribeToReportLeavingEvents

These two functions are responsible for subscribing to pusher here in this file https://github.com/Expensify/App/blob/38f15163860d669975cd9f0167944ebd09e0be38/src/libs/actions/Report.js

If we observe this issue only happens in case of login only because the channel name is invalid which is returning 404.

useEffect(() => {
// 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 = !report.pendingFields || (!report.pendingFields.addWorkspaceRoom && !report.pendingFields.createChat);
if (!didSubscribeToReportLeavingEvents.current && didCreateReportSuccessfully) {
Report.subscribeToReportLeavingEvents(reportID);
didSubscribeToReportLeavingEvents.current = true;
}
}, [report, didSubscribeToReportLeavingEvents, reportID]);
, this snippet is responsible for subscribing but we're not checking weather the reportID is empty (at mounting time / no reports available at login so it takes a bit time till OpenApp command completes).

Also we have another issue where we're type-casing null as string in this line

return String(lodashGet(route, 'params.reportID', null));
which makes checking !!reportID everytime true as we're having reportID as a string

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

Update getReportID function to return following

return String(lodashGet(route, 'params.reportID', '')) || null;

If we're worried about the regressions or following up issues that might can cause from reportID being null we can depend on report.reportID which is also reliable here in this situation.

Return if reportID is empty in useEffect block here in this snippet

useEffect(() => {
// 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 = !report.pendingFields || (!report.pendingFields.addWorkspaceRoom && !report.pendingFields.createChat);
if (!didSubscribeToReportLeavingEvents.current && didCreateReportSuccessfully) {
Report.subscribeToReportLeavingEvents(reportID);
didSubscribeToReportLeavingEvents.current = true;
}
}, [report, didSubscribeToReportLeavingEvents, reportID]);

Or Handle conditionally (subscribe only if reportID exists)

What alternative solutions did you explore? (Optional)

NA

@m-natarajan m-natarajan added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 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 Oct 10, 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

@fedirjh One proposal to review here!

@melvin-bot melvin-bot bot removed the Overdue label Oct 12, 2023
@fedirjh
Copy link
Contributor

fedirjh commented Oct 13, 2023

@5war00p's Proposal looks good to me, It seems like we send channel_name with reportID-null to AuthenticatePusher command.

The solution looks good to me.

🎀 👀 🎀 C+ reviewed


Screenshot 2023-10-13 at 11 23 02 AM

@melvin-bot
Copy link

melvin-bot bot commented Oct 13, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.85-4 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-10-24. 🎊

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
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

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 Oct 17, 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:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] 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:
  • [@fedirjh] 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:
  • [@fedirjh] Determine if we should create a regression test for this bug.
  • [@fedirjh] 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:

@parasharrajat
Copy link
Member

We have a regression from this issue's PR #29871

cc: @conorpendergrast

@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @5war00p got assigned: 2023-10-13 18:28:32 Z
  • when the PR got merged: 2023-10-19 18:22:58 UTC
  • days elapsed: 3

On to the next one 🚀

@melvin-bot
Copy link

melvin-bot bot commented Oct 21, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 23, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-10-24] [$500] API - 404 Returns On AuthenticatePusher API [HOLD for payment 2023-10-30] [HOLD for payment 2023-10-24] [$500] API - 404 Returns On AuthenticatePusher API Oct 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.88-11 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-10-30. 🎊

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
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

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

Note to @conorpendergrast: regression penalty!

@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 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:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] 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:
  • [@fedirjh] 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:
  • [@fedirjh] Determine if we should create a regression test for this bug.
  • [@fedirjh] 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 Oct 24, 2023
@conorpendergrast conorpendergrast changed the title [HOLD for payment 2023-10-30] [HOLD for payment 2023-10-24] [$500] API - 404 Returns On AuthenticatePusher API [HOLD for payment 2023-10-30] [$500] API - 404 Returns On AuthenticatePusher API Oct 24, 2023
@conorpendergrast
Copy link
Contributor

Waiting until 2023-10-30 due to the regression

@conorpendergrast conorpendergrast added Weekly KSv2 Daily KSv2 and removed Daily KSv2 Weekly KSv2 labels Oct 24, 2023
@conorpendergrast
Copy link
Contributor

Paying this tomorrow!

@fedirjh
Copy link
Contributor

fedirjh commented Nov 1, 2023

BugZero Checklist:

@melvin-bot melvin-bot bot added the Overdue label Nov 6, 2023
@conorpendergrast
Copy link
Contributor

conorpendergrast commented Nov 6, 2023

Sorry for the delay here!

Payouts due:

Eligible for 50% #urgency bonus? No - due to regression penalty

Upwork job is here.

@melvin-bot melvin-bot bot removed the Overdue label Nov 6, 2023
@5war00p
Copy link
Contributor

5war00p commented Nov 6, 2023

@conorpendergrast offer accepted.

@ufumerfarooq
Copy link

@conorpendergrast offer accepted

@conorpendergrast
Copy link
Contributor

Both paid, contracts ended. Closing out, thanks everyone

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

9 participants