Skip to content

[HOLD for payment 2023-10-02] [$500] "Intro to your school principal" page is accessible with a public email #27225

Closed

Description

@marcochavezf

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. Sign-up with a public domain
  2. Go to https://staging.new.expensify.com/save-the-world/intro-school-principal (or /teachersunite/intro-school-principal after this PR is merged).

Expected Result:

  1. The user should be redirected to the page Update your email address (which is the page i-am-a-teacher).

Actual Result:

  1. The page "Intro to your school principal" is shown

Workaround:

Navigate to the other page, which should happen automatically

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:
Reproducible in staging?:
Reproducible in production?:
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
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation:

Screen.Recording.2023-09-12.at.16.55.38.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019ebe462993141653
  • Upwork Job ID: 1701832137355866112
  • Last Price Increase: 2023-09-13
  • Automatic offers:
    • aimane-chnaif | Reviewer | 26744505
    • akinwale | Contributor | 26744506

Activity

  1. added
    Daily
    Bug
    on Sep 12, 2023
  2. melvin-bot commented on Sep 12, 2023

    @melvin-bot

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

  3. melvin-bot commented on Sep 12, 2023

    @melvin-bot

    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
  4. marcochavezf commented on Sep 12, 2023

    @marcochavezf
    ContributorAuthor

    For this solution, we should consolidate the content of both pages in just one page i-am-a-teacher since we're planning to share the link with the i-am-a-teacher route, and the content should appear dynamically depending on the domain of the main contact method.

  5. self-assigned this
    on Sep 12, 2023
  6. akinwale commented on Sep 12, 2023

    @akinwale
    Contributor

    Proposal

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

    "Intro to your school principal" page is accessible if a user with a public email accesses the URL directly.

    What is the root cause of that problem?

    There is no check for the current profile email in the IntroSchoolPrincipalPage component.

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

    Solution 1 (consolidation to a single page)

    1. Create a folder in the TeachersUnite page to contain both components (optional)
    2. Update the existing ImTeacherPage with the following changes to render both pages.
    3. Add the withOnyx HOC and add the session key to withOnyx.
    +session: {
    +    key: ONYXKEYS.SESSION,
    +},
    1. Add the check for the public email domain in the component.
    const isLoggedInEmailPublicDomain = LoginUtils.isEmailPublicDomain(props.session.email);
    
    1. Either return the correct page based on the result of the check for public domain.
    return (isLoggedInEmailPublicDomain ? <ImTeacherUpdateEmailPage ...props /> : <IntroSchoolPrincipalPage ...props />);
    
    1. Or create two methods (eg renderImTeacherUpdateEmail() and renderIntroSchoolPrincipal) to render the actual content for each respective page, and then render by delegating to the corresponding method.

    Solution 2 (redirect)
    Make the following updates in the IntroSchoolPrincipalPage component.

    1. Add the session key to withOnyx.
    +session: {
    +    key: ONYXKEYS.SESSION,
    +},
    1. Add the check for the public email domain.
    const isLoggedInEmailPublicDomain = LoginUtils.isEmailPublicDomain(props.session.email);
    
    1. If the current logged in session has an email with a public domain, then redirect the user to the i am a teacher route to update their email address.
    useFocusEffect(() => {
        if (isLoggedInEmailPublicDomain) {
            Navigation.navigate(ROUTES.I_AM_A_TEACHER);
        }
    });
    

    What alternative solutions did you explore? (Optional)

    None.

  7. marcochavezf commented on Sep 13, 2023

    @marcochavezf
    ContributorAuthor

    Making it external to assign a C+ to review the proposal and move this forward

  8. added
    External
    on Sep 13, 2023
  9. changed the title [-]"Intro to your school principal" page is accessible with a public email[/-] [+][$500] "Intro to your school principal" page is accessible with a public email[/+] on Sep 13, 2023
  10. melvin-bot commented on Sep 13, 2023

    @melvin-bot
  11. added
    Help Wanted
    on Sep 13, 2023
  12. melvin-bot commented on Sep 13, 2023

    @melvin-bot

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

  13. melvin-bot commented on Sep 13, 2023

    @melvin-bot

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

  14. 31 remaining items

  15. melvin-bot commented on Sep 22, 2023

    @melvin-bot

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

    • when @akinwale got assigned: 2023-09-19 02:52:24 Z
    • when the PR got merged: 2023-09-22 05:11:29 UTC
    • days elapsed: 3

    On to the next one 🚀

  16. added
    Weekly
    Awaiting Payment
    and removed
    Weekly
    on Sep 25, 2023
  17. changed the title [-][$500] "Intro to your school principal" page is accessible with a public email[/-] [+][HOLD for payment 2023-10-02] [$500] "Intro to your school principal" page is accessible with a public email[/+] on Sep 25, 2023
  18. removed
    Reviewing
    on Sep 25, 2023
  19. melvin-bot commented on Sep 25, 2023

    @melvin-bot

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

  20. melvin-bot commented on Sep 25, 2023

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.73-1 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-02. 🎊

    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
  21. melvin-bot commented on Sep 25, 2023

    @melvin-bot

    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.
    • [@anmurali] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  22. added
    Daily
    and removed
    Weekly
    on Oct 1, 2023
  23. anmurali commented on Oct 4, 2023

    @anmurali

    Both paid.

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions