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

Add /workspaces/* path into universal_link #26172

Conversation

studentofcoding
Copy link
Contributor

@studentofcoding studentofcoding commented Aug 29, 2023

Details

The problem is only appearing on Safari Mobile, with the detail of

Workspaces - Visual flickering when navigating back to workspace list from a WS

Some extra note:

  • The scope is on Workspace related page, but we also include /save-the-world/* which is outside of the scope of the issues
  • The Screenshots are Expected results to be (on mobile safari section) since the Smart App Banner only shows on the production code.
  • It seems like on the Save the World page, there is a small bug (different background color) on the SafeArea on top, if that is the case, a bug report has already been sent here & just want to note this, to avoid regression after it's merged

photo_2023-09-01 01 08 29

Fixed Issues

$ 24341
PROPOSAL: #24341 (comment)

Tests

  1. Open the staging weblink
  2. Go to Settings > Workspaces
  3. Select a workspace to open WS settings
  4. Go back to workspace list by tapping on the back button
  5. See that the Smart App Banner is also shown on Workspace Page Detail and the layout is fixed
  • Verify that no errors appear in the JS console

Offline tests

  1. Open the staging weblink
  2. Go to Settings > Workspaces
  3. Select a workspace to open WS settings
  4. Go back to workspace list by tapping on the back button
  5. See that the Smart App Banner is also shown on Workspace Page Detail and the layout is fixed

QA Steps

  1. Open the staging weblink
  2. Go to Settings > Workspaces
  3. Select a workspace to open WS settings
  4. Go back to workspace list by tapping on the back button
  5. See that the Smart App Banner is also shown on Workspace Page Detail and the layout is fixed
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • If we are not using the full Onyx data that we loaded, I've added the proper selector in order to ensure the component only re-renders when the data it is using changes
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Mobile Web - Chrome
Mobile Web - Safari
  • Workspace

:workspace:*

  • Save the world

:save-the-world:*

Desktop
iOS
Android

@studentofcoding studentofcoding marked this pull request as ready for review August 31, 2023 18:42
@studentofcoding studentofcoding requested a review from a team as a code owner August 31, 2023 18:42
@melvin-bot melvin-bot bot requested review from youssef-lr and removed request for a team August 31, 2023 18:43
@melvin-bot
Copy link

melvin-bot bot commented Aug 31, 2023

@youssef-lr Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@allroundexperts
Copy link
Contributor

allroundexperts commented Aug 31, 2023

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android

@allroundexperts
Copy link
Contributor

@studentofcoding How am I supposed to test this on my localhost? Can you please update the test steps?

@studentofcoding
Copy link
Contributor Author

studentofcoding commented Sep 1, 2023

@studentofcoding How am I supposed to test this on my localhost? Can you please update the test steps?

We can't test it locally or on other sites as the Smart App Banner can only be shown on the production/staging site that is listed on associated-domains key in Xcode project points to below domains.

<key>com.apple.developer.associated-domains</key>
	<array>
		<string>applinks:new.expensify.com</string>
		<string>applinks:staging.new.expensify.com</string>
		<string>webcredentials:new.expensify.com</string>
	</array> 

But we can expect it'll behave the same as another path as it's using the same structure, and no other changes are introduced in this case

Anyway Thanks @aswin-s for the detailed explanation

@mountiny mountiny changed the title Add /workspaces/* path into universal_link [HOLD merge freeze] Add /workspaces/* path into universal_link Sep 1, 2023
@studentofcoding
Copy link
Contributor Author

studentofcoding commented Sep 1, 2023

Leave the note here for additional context

The PR are planned to be merged on Sept 1 (after 1 day) but on Hold because of freeze

So after disscusion with Internal Team, it'll have a bonus of 50%

Below are the discussion on slack for context image

@dangrous
Copy link
Contributor

dangrous commented Sep 5, 2023

I'm updating the reviewers on this, not sure why it didn't pick us properly. Ignore this issue, @youssef-lr !

@dangrous dangrous requested review from dangrous and allroundexperts and removed request for youssef-lr September 5, 2023 15:11
Copy link
Contributor

@dangrous dangrous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two edits on the comments!

Do we know of a way to actually test this? Now that we can make different test builds would any of those work, maybe? cc @Julesssss since you worked on the test builds thing

.well-known/apple-app-site-association Outdated Show resolved Hide resolved
.well-known/apple-app-site-association Outdated Show resolved Hide resolved
studentofcoding and others added 2 commits September 6, 2023 22:25
Change comment on Workspace

Co-authored-by: Daniel Gale-Rosen <5487802+dangrous@users.noreply.github.com>
Change comment on Save the World

Co-authored-by: Daniel Gale-Rosen <5487802+dangrous@users.noreply.github.com>
@studentofcoding
Copy link
Contributor Author

Two edits on the comments!

Do we know of a way to actually test this? Now that we can make different test builds would any of those work, maybe? cc @Julesssss since you worked on the test builds thing

Done it @dangrous, also This is our last discussion with Aswin on apple-app-site-association

https://expensify.slack.com/archives/C01GTK53T8Q/p1693544190232139?thread_ts=1693543888.454649&cid=C01GTK53T8Q

@Julesssss
Copy link
Contributor

Julesssss commented Sep 6, 2023

Do we know of a way to actually test this? Now that we can make different test builds would any of those work, maybe? cc @Julesssss since you worked on the test builds thing

I kicked off a test build job for you here. A comment should appear shortly with links to all platforms

@studentofcoding
Copy link
Contributor Author

studentofcoding commented Sep 6, 2023

iOS build failed @Julesssss @dangrous (probably because the Branch isn't synced as Master Branch)

Also upon checking on my iPhone for the web, the Smart App Banner didn't show on all the pages, it's probably related to how it only loads on the listed URL here :

Screenshot 2023-09-07 at 00 25 11

I might be wrong (as my context in this matter is limited) but it seems that the only alternative way to test this is to change https://new.expensify.com/apple-app-site-association and add our URL there, therefore it'll only be testable later on production?

@Expensify Expensify deleted a comment from OSBotify Sep 7, 2023
@dangrous
Copy link
Contributor

dangrous commented Sep 7, 2023

Ah okay. I thinkkkk it'll probably be fine? It's definitely not going to break anything, the question is whether or not it will actually work once deployed, haha. So maybe we just push (when the freeze is off) with prod QA, and handle any issues at that point.

@studentofcoding
Copy link
Contributor Author

Ah okay. I thinkkkk it'll probably be fine? It's definitely not going to break anything, the question is whether or not it will actually work once deployed, haha. So maybe we just push (when the freeze is off) with prod QA, and handle any issues at that point.

Yess, I also think that it'll finee. This is actually intriguing as we only can make sure after its being deployed later lol

Meanwhile, I'll re-check and add another configuration (if needed)

@studentofcoding
Copy link
Contributor Author

As the conferences are done, I think its safe to continue @mountiny ?

Also waiting for your approval @allroundexperts

Thanks!

@studentofcoding
Copy link
Contributor Author

Also Do I need to merge main to this PR branch @dangrous

@mountiny
Copy link
Contributor

@studentofcoding yes please, merge main and retest please. Thanks!

@studentofcoding
Copy link
Contributor Author

Main is merged @dangrous @allroundexperts, It's ready to be merged to main & tested there!

@studentofcoding
Copy link
Contributor Author

Can we remove the HOLD merge freeze @mountiny ? Thanks

@dangrous dangrous changed the title [HOLD merge freeze] Add /workspaces/* path into universal_link Add /workspaces/* path into universal_link Sep 11, 2023
@dangrous
Copy link
Contributor

I think this is good to go, I'm just checking to see what the process is for having this tested on prod instead of on staging

@studentofcoding
Copy link
Contributor Author

I think this is good to go, I'm just checking to see what the process is for having this tested on prod instead of on staging

Noted, I'll standby in case any extra conf needed from my part

Copy link
Contributor

@allroundexperts allroundexperts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's 🚀 it!

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

🎯 @allroundexperts, thanks for reviewing and testing this PR! 🎉

An E/App issue has been created to issue payment here: #27205.

@studentofcoding
Copy link
Contributor Author

Lets merged itt!

cc: @dangrous @allroundexperts

@dangrous dangrous merged commit c0363b7 into Expensify:main Sep 12, 2023
12 checks passed
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/dangrous in version: 1.3.69-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/mountiny in version: 1.3.69-2 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/dangrous in version: 1.3.70-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@kavimuru
Copy link

kavimuru commented Sep 14, 2023

@dangrous @studentofcoding We tested in staging in the last regression. Should we validate in production in this list?
#27313 (comment)

@dangrous
Copy link
Contributor

yes please!

@studentofcoding
Copy link
Contributor Author

Also added additional context here @dangrous @kavimuru as Smart App Banner is showing fine on Staging while on Production it isn't, and this is my hunch on it

My hunch is this behavior is happening because the Production still didn't have the last updated change from Staging, which is the change from internal PR below (that basically change /save-the-world/* into /teachersunite/* that make the Smart App Banner didn't behave as expected

I've poked Aswin as well, hopefully we can get more insight on it 😄

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/thienlnam in version: 1.3.70-8 🚀

platform result
🤖 android 🤖 failure ❌
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

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

Successfully merging this pull request may close these issues.

7 participants